Documentation
¶
Index ¶
- Constants
- Variables
- func InitNavLog(enabled bool, categories string, callsign string)
- func LogRoute(callsign string, simTime Time, waypoints av.WaypointArray)
- func NavLog(callsign string, simTime Time, category string, format string, args ...any)
- func NavLogEnabled(category string) bool
- func TurnAngle(from, to math.MagneticHeading, turn av.TurnDirection) float32
- type DeferredNavHeading
- type DepartureHeadingState
- type FlightState
- type FlyHold
- type FollowTraffic
- type InterceptState
- type LateralManeuver
- type ManeuverComplete
- type ManeuverCompleteType
- type Nav
- func (nav *Nav) AfterFixAltitude(fix string, alt float32) av.CommandIntent
- func (nav *Nav) AfterFixSpeed(fix string, sr *av.SpeedRestriction) av.CommandIntent
- func (nav *Nav) AltitudeOurDiscretion() av.CommandIntent
- func (nav *Nav) ApproachHeading(callsign string, wxs wx.Sample, simTime Time) (heading math.MagneticHeading, turn av.TurnDirection)
- func (nav *Nav) AssignAltitude(alt float32, afterSpeed bool, simTime Time, delayReduction time.Duration) av.CommandIntent
- func (nav *Nav) AssignCompoundSpeed(segments []av.CompoundSpeedSegment) av.CommandIntent
- func (nav *Nav) AssignHeading(hdg math.MagneticHeading, turn av.TurnDirection, simTime Time, ...) av.CommandIntent
- func (nav *Nav) AssignMach(mach float32, afterAltitude bool, temp av.Temperature) av.CommandIntent
- func (nav *Nav) AssignSpeed(sr *av.SpeedRestriction, afterAltitude bool) av.CommandIntent
- func (nav *Nav) AssignSpeedUntil(sr *av.SpeedRestriction, until *av.SpeedUntil) av.CommandIntent
- func (nav *Nav) AssignedHeading() (math.MagneticHeading, bool)
- func (nav *Nav) AssignedWaypoints() []av.Waypoint
- func (nav *Nav) AtFixCleared(fix, id string, simTime Time, delayReduction time.Duration, straightIn bool) av.CommandIntent
- func (nav *Nav) AtFixIntercept(fix string, simTime Time, delayReduction time.Duration) av.CommandIntent
- func (nav *Nav) CancelApproachClearance() av.CommandIntent
- func (nav *Nav) Check(lg *log.Logger)
- func (nav *Nav) ClearedApproach(approach string, traffic *FollowTraffic, simTime Time, straightIn bool) av.CommandIntent
- func (nav *Nav) ClearedVisualApproach(follow *FollowTraffic, lahsoRunway string) av.CommandIntent
- func (nav *Nav) ClimbViaSID(simTime Time) av.CommandIntent
- func (nav *Nav) ContactMessage(reportingPoints []av.ReportingPoint, star string, runway string, ...) *av.RadioTransmission
- func (nav *Nav) CrossDMEAt(dist float32, ar *av.AltitudeRestriction, sr *av.SpeedRestriction) av.CommandIntent
- func (nav *Nav) CrossDistanceFromFixAt(fix string, dist float32, dir math.CardinalOrdinalDirection, ...) av.CommandIntent
- func (nav *Nav) CrossFixAt(fix string, ar *av.AltitudeRestriction, sr *av.SpeedRestriction) av.CommandIntent
- func (nav *Nav) DepartFixDirect(fixa string, fixb string) av.CommandIntent
- func (nav *Nav) DepartFixHeading(fix string, hdg math.MagneticHeading) av.CommandIntent
- func (nav *Nav) DepartOnCourse(alt float32, exit string, simTime Time)
- func (nav *Nav) DepartureHeading() (int, DepartureHeadingState)
- func (nav *Nav) DepartureMessage(sid string, reportHeading bool) *av.RadioTransmission
- func (nav *Nav) DescendViaSTAR(simTime Time) av.CommandIntent
- func (nav *Nav) DirectFix(fix string, turn av.TurnDirection, simTime Time, delayReduction time.Duration) av.CommandIntent
- func (nav *Nav) DistanceAlongRoute(fix string) (float32, error)
- func (nav *Nav) DistanceToEndOfApproach() (float32, error)
- func (nav *Nav) DivertToAirport(airport string)
- func (nav *Nav) ETA(p math.Point2LL) float32
- func (nav *Nav) EnqueueDirectFix(wps []av.Waypoint, turn av.TurnDirection, simTime Time, ...)
- func (nav *Nav) EnqueueHeading(hdg math.MagneticHeading, turn av.TurnDirection, approachCleared bool, ...)
- func (nav *Nav) EnqueueOnCourse(simTime Time)
- func (nav *Nav) ExpectApproach(airport *av.Airport, approach string, ...) av.CommandIntent
- func (nav *Nav) ExpectDirect(fix string) av.CommandIntent
- func (nav *Nav) ExpediteClimb() av.CommandIntent
- func (nav *Nav) ExpediteClimbThrough(throughAlt float32) av.CommandIntent
- func (nav *Nav) ExpediteDescent() av.CommandIntent
- func (nav *Nav) ExpediteDescentThrough(throughAlt float32) av.CommandIntent
- func (nav *Nav) FlyPresentHeading(simTime Time, delayReduction time.Duration) av.CommandIntent
- func (nav *Nav) GoAroundWithProcedure(altitude float32, runwayEndWP av.Waypoint)
- func (nav *Nav) GoodRateClimb() av.CommandIntent
- func (nav *Nav) GoodRateDescent() av.CommandIntent
- func (nav *Nav) GoodRateThrough(throughAlt float32) av.CommandIntent
- func (nav *Nav) HoldAtFix(callsign string, fix string, hold *av.Hold) av.CommandIntent
- func (nav *Nav) InterceptApproach(airport string, lg *log.Logger) av.CommandIntent
- func (nav *Nav) InterceptedButNotCleared() bool
- func (nav *Nav) IsAirborne() bool
- func (nav *Nav) Mach(temp av.Temperature) float32
- func (nav *Nav) MaintainMaximumForward() av.CommandIntent
- func (nav *Nav) MaintainPresentSpeed() av.CommandIntent
- func (nav *Nav) MaintainSlowestPractical() av.CommandIntent
- func (nav *Nav) OnApproach(checkAltitude bool) bool
- func (nav *Nav) OnExtendedCenterline(maxNmDeviation float32) bool
- func (nav *Nav) RestoreSnapshot(snap NavSnapshot)
- func (nav *Nav) ResumeOwnNavigation() av.CommandIntent
- func (nav *Nav) SayAltitude() av.CommandIntent
- func (nav *Nav) SayHeading() av.CommandIntent
- func (nav *Nav) SayIndicatedSpeed() av.CommandIntent
- func (nav *Nav) SayMach(temp av.Temperature) av.CommandIntent
- func (nav *Nav) SaySpeed(temp av.Temperature) av.CommandIntent
- func (nav *Nav) Summary(fp av.FlightPlan, model *wx.Model, simTime Time, lg *log.Logger) string
- func (nav *Nav) TAS(temp av.Temperature) float32
- func (nav *Nav) TakeSnapshot() NavSnapshot
- func (nav *Nav) TargetAltitude() (float32, float32, bool)
- func (nav *Nav) TargetHeading(callsign string, wxs wx.Sample, simTime Time) (heading math.MagneticHeading, turn av.TurnDirection, rate float32)
- func (nav *Nav) TargetSpeed(targetAltitude float32, fp *av.FlightPlan, wxs wx.Sample, ...) (float32, float32)
- func (nav *Nav) Update(callsign string, model *wx.Model, fp *av.FlightPlan, simTime Time, ...) UpdateResult
- func (nav *Nav) UpdateWithWeather(callsign string, wxs wx.Sample, fp *av.FlightPlan, simTime Time, ...) UpdateResult
- type NavAirwork
- type NavAltitude
- type NavApproach
- type NavFixAssignment
- type NavHeading
- type NavSnapshot
- type NavSpeed
- type RateQualifier
- type Time
- func (s Time) Add(d time.Duration) Time
- func (s Time) After(o Time) bool
- func (s Time) Before(o Time) bool
- func (s Time) Compare(o Time) int
- func (s Time) Equal(o Time) bool
- func (s Time) Format(layout string) string
- func (s Time) Hour() int
- func (s Time) IsZero() bool
- func (s Time) MarshalJSON() ([]byte, error)
- func (s Time) MarshalMsgpack() ([]byte, error)
- func (s Time) Minute() int
- func (s Time) Second() int
- func (s Time) String() string
- func (s Time) Sub(o Time) time.Duration
- func (s Time) Time() time.Time
- func (s Time) UTC() Time
- func (s Time) UnixMilli() int64
- func (s *Time) UnmarshalJSON(b []byte) error
- func (s *Time) UnmarshalMsgpack(b []byte) error
- type UpdateResult
Constants ¶
const ( )
Available logging categories
const MaxIAS = 290
const MaximumRate = 100000
const StandardTurnRate = 3
Variables ¶
var ( ErrClearedForUnexpectedApproach = errors.New("Cleared for unexpected approach") ErrFixIsTooFarAway = errors.New("Fix is too far away") ErrFixNotInRoute = errors.New("Fix not in aircraft's route") ErrInvalidApproach = errors.New("Invalid approach") ErrInvalidFix = errors.New("Invalid fix") ErrNotClearedForApproach = errors.New("Aircraft has not been cleared for an approach") ErrNotFlyingRoute = errors.New("Aircraft is not currently flying its assigned route") ErrUnableCommand = errors.New("Unable") ErrUnknownApproach = errors.New("Unknown approach") )
Errors used by the nav package
Functions ¶
func InitNavLog ¶
InitNavLog is a no-op in release builds
func LogRoute ¶
func LogRoute(callsign string, simTime Time, waypoints av.WaypointArray)
LogRoute is a no-op in release builds
func NavLogEnabled ¶
NavLogEnabled always returns false in release builds
func TurnAngle ¶
func TurnAngle(from, to math.MagneticHeading, turn av.TurnDirection) float32
Types ¶
type DeferredNavHeading ¶
DeferredNavHeading stores a heading assignment from the controller and the time at which to start executing it; this time is set to be a few seconds after the controller issues it in order to model the delay before pilots start to follow assignments.
type DepartureHeadingState ¶ added in v0.14.0
type DepartureHeadingState int
DepartureHeadingState describes the state of a departure's heading assignment.
const ( // NoHeading indicates no heading is assigned or upcoming NoHeading DepartureHeadingState = iota // OnHeading indicates the aircraft is currently flying an assigned heading OnHeading // TurningToHeading indicates the aircraft is about to turn to a heading TurningToHeading )
type FlightState ¶
type FlightState struct {
InitialDepartureClimb bool
DepartureAirportLocation math.Point2LL
DepartureAirportElevation float32
ArrivalAirport av.Waypoint
ArrivalAirportLocation math.Point2LL
ArrivalAirportElevation float32
MagneticVariation float32
NmPerLongitude float32
Position math.Point2LL
Heading math.MagneticHeading
Altitude float32
PrevAltitude float32
IAS, GS float32 // speeds...
BankAngle float32 // degrees
AltitudeRate float32 // + -> climb, - -> descent
}
func (FlightState) LogValue ¶
func (fs FlightState) LogValue() slog.Value
func (*FlightState) Summary ¶
func (fs *FlightState) Summary() string
type FlyHold ¶
type FlyHold struct {
Hold av.Hold
FixLocation math.Point2LL
Entry av.HoldEntry
Maneuvers []LateralManeuver
Cancel bool // when set, we end the hold after the last leg
}
func (*FlyHold) GetHeading ¶
type FollowTraffic ¶ added in v0.14.3
type FollowTraffic struct {
Position math.Point2LL
Route av.WaypointArray
}
FollowTraffic describes a leader aircraft to sequence behind on a visual approach. Route (when non-empty) is the leader's own waypoints, used for tight in-trail spacing; Position alone is used as a join-point override on the reference approach.
type InterceptState ¶
type InterceptState int
const ( NotIntercepting InterceptState = iota InitialHeading TurningToJoin OnApproachCourse )
type LateralManeuver ¶ added in v0.14.2
type LateralManeuver struct {
Heading math.MagneticHeading // heading to fly
Track math.MagneticHeading // if non-zero, wind-corrected heading via headingForTrack
FlyToward math.Point2LL // if non-zero, heading = bearing to this point each tick
Turn av.TurnDirection
Until ManeuverComplete
AssignAltitude *float32 // if non-nil, set nav.Altitude when this maneuver becomes active
ClearAltitudeOnFinal bool
Fix string
Actions av.WaypointActions
}
LateralManeuver describes a single phase of flight: fly a heading, track, or dynamically selected point until a condition is met. A sequence of LateralManeuvers forms a procedure turn, hold circuit, or ordered heading-leg instruction.
func (*LateralManeuver) String ¶ added in v0.14.2
func (m *LateralManeuver) String() string
type ManeuverComplete ¶ added in v0.14.2
type ManeuverComplete struct {
Type ManeuverCompleteType
Heading math.MagneticHeading // target heading (UntilHeading)
Seconds float32 // duration in seconds (UntilTime)
Dist float32 // distance in nm (UntilDist)
Fix math.Point2LL // target fix (UntilFix, UntilIntercept)
Altitude int // target altitude (UntilAltitude)
// UntilIntercept: inbound course to intercept and turn direction for the intercept turn.
InterceptCourse math.MagneticHeading
InterceptTurn av.TurnDirection
// UntilDME: DME distance from a fix.
DMEDistance float32
DMEFix math.Point2LL
DMEFixElevation int
// Lazy-init start state for time/distance conditions.
Start Time // captured on first Done() call (UntilTime)
StartPos math.Point2LL // captured on first Done() call (UntilDist)
}
ManeuverComplete encapsulates the completion condition for a lateral maneuver. Type selects the condition; the relevant field(s) provide its parameters. Time and distance conditions capture their start state lazily on first check.
func (*ManeuverComplete) Done ¶ added in v0.14.2
func (mc *ManeuverComplete) Done(nav *Nav, simTime Time, wxs wx.Sample, targetHdg math.MagneticHeading) bool
type ManeuverCompleteType ¶ added in v0.14.2
type ManeuverCompleteType int
ManeuverCompleteType discriminates maneuver completion conditions.
const ( UntilHeading ManeuverCompleteType = iota // done when aircraft heading ≈ Until.Heading UntilTime // done after Until.Seconds elapsed (lazy start) UntilDist // done after Until.Dist nm flown (lazy start) UntilFix // done when ETA to Until.Fix < 2s UntilIntercept // done when shouldTurnToIntercept fires for course through Fix UntilControllerIntervention // never completes; lasts until controller issues a new instruction UntilAltitude // done when reaching Until.Altitude UntilDME // done when crossing Until.DMEDistance from Until.DMEFix )
type Nav ¶
type Nav struct {
// controller that the pilot has not yet started to follow. Note that
// only a single such assignment is stored; for example, if the
// controller issues a first heading and then a second shortly
// afterward, before the first has been followed, it's fine for the
// second to override it.
DeferredNavHeading *DeferredNavHeading
// direct to; when the actual direct instruction comes, there is less
// delay since the pilot is prepared.
ExpectedDirectFix string
}
State related to navigation. Pointers are used for optional values; nil -> unset/unspecified.
func MakeArrivalNav ¶
func MakeDepartureNav ¶
func MakeOverflightNav ¶
func MakeOverflightNav(callsign av.ADSBCallsign, of *av.Overflight, fp av.FlightPlan, perf av.AircraftPerformance, nmPerLongitude float32, magneticVariation float32, model *wx.Model, simTime Time, lg *log.Logger) *Nav
func (*Nav) AfterFixAltitude ¶ added in v0.14.3
func (nav *Nav) AfterFixAltitude(fix string, alt float32) av.CommandIntent
func (*Nav) AfterFixSpeed ¶ added in v0.14.3
func (nav *Nav) AfterFixSpeed(fix string, sr *av.SpeedRestriction) av.CommandIntent
func (*Nav) AltitudeOurDiscretion ¶
func (nav *Nav) AltitudeOurDiscretion() av.CommandIntent
func (*Nav) ApproachHeading ¶
func (nav *Nav) ApproachHeading(callsign string, wxs wx.Sample, simTime Time) (heading math.MagneticHeading, turn av.TurnDirection)
func (*Nav) AssignAltitude ¶
func (*Nav) AssignCompoundSpeed ¶ added in v0.14.3
func (nav *Nav) AssignCompoundSpeed(segments []av.CompoundSpeedSegment) av.CommandIntent
func (*Nav) AssignHeading ¶
func (nav *Nav) AssignHeading(hdg math.MagneticHeading, turn av.TurnDirection, simTime Time, delayReduction time.Duration) av.CommandIntent
func (*Nav) AssignMach ¶ added in v0.14.1
func (nav *Nav) AssignMach(mach float32, afterAltitude bool, temp av.Temperature) av.CommandIntent
func (*Nav) AssignSpeed ¶
func (nav *Nav) AssignSpeed(sr *av.SpeedRestriction, afterAltitude bool) av.CommandIntent
func (*Nav) AssignSpeedUntil ¶ added in v0.14.0
func (nav *Nav) AssignSpeedUntil(sr *av.SpeedRestriction, until *av.SpeedUntil) av.CommandIntent
func (*Nav) AssignedHeading ¶
func (nav *Nav) AssignedHeading() (math.MagneticHeading, bool)
AssignedHeading returns the aircraft's current heading assignment, if any, regardless of whether the pilot has yet started following it.
func (*Nav) AssignedWaypoints ¶
AssignedWaypoints returns the route that should be flown following a controller instruction. If an instruction has been issued but the delay hasn't passed, these are different than the waypoints currently being used for navigation.
func (*Nav) AtFixCleared ¶
func (*Nav) AtFixIntercept ¶ added in v0.14.0
func (*Nav) CancelApproachClearance ¶
func (nav *Nav) CancelApproachClearance() av.CommandIntent
func (*Nav) ClearedApproach ¶
func (nav *Nav) ClearedApproach(approach string, traffic *FollowTraffic, simTime Time, straightIn bool) av.CommandIntent
func (*Nav) ClearedVisualApproach ¶ added in v0.14.3
func (nav *Nav) ClearedVisualApproach(follow *FollowTraffic, lahsoRunway string) av.CommandIntent
ClearedVisualApproach finalizes a non-charted visual approach clearance for the runway named on Nav.Approach.Assigned (a synthesized VisualApproach). It picks the route the aircraft will fly:
- If the aircraft has been committed to an ILS/Localizer reference (via "direct {fix}" or "at {fix} intercept the localizer"), the reference's own routes are installed so the localizer altitudes/centerline take effect.
- Otherwise, when a leader's route is supplied via follow.Route, tight in-trail sequencing along that route is attempted first.
- Otherwise, a synthetic descent profile (TOD/_3NM_FINAL anchors) is constructed from the visual references.
func (*Nav) ClimbViaSID ¶
func (nav *Nav) ClimbViaSID(simTime Time) av.CommandIntent
func (*Nav) ContactMessage ¶
func (nav *Nav) ContactMessage(reportingPoints []av.ReportingPoint, star string, runway string, reportHeading bool, isDeparture bool) *av.RadioTransmission
func (*Nav) CrossDMEAt ¶ added in v0.14.3
func (nav *Nav) CrossDMEAt(dist float32, ar *av.AltitudeRestriction, sr *av.SpeedRestriction) av.CommandIntent
CrossDMEAt inserts a synthetic crossing restriction at a given DME from the runway threshold of the currently cleared visual approach. The synthetic waypoint is placed along the approach route by walking backwards from the threshold accumulating track miles; if dist exceeds the total route length, the point is extrapolated backwards along the first leg.
func (*Nav) CrossDistanceFromFixAt ¶ added in v0.14.3
func (nav *Nav) CrossDistanceFromFixAt(fix string, dist float32, dir math.CardinalOrdinalDirection, ar *av.AltitudeRestriction, sr *av.SpeedRestriction) av.CommandIntent
func (*Nav) CrossFixAt ¶
func (nav *Nav) CrossFixAt(fix string, ar *av.AltitudeRestriction, sr *av.SpeedRestriction) av.CommandIntent
func (*Nav) DepartFixDirect ¶
func (nav *Nav) DepartFixDirect(fixa string, fixb string) av.CommandIntent
func (*Nav) DepartFixHeading ¶
func (nav *Nav) DepartFixHeading(fix string, hdg math.MagneticHeading) av.CommandIntent
func (*Nav) DepartureHeading ¶ added in v0.14.0
func (nav *Nav) DepartureHeading() (int, DepartureHeadingState)
DepartureHeading returns the heading a departure will fly and its state. Returns the heading and state based on: - OnHeading: aircraft has an assigned heading - TurningToHeading: first waypoint has a heading (about to turn) - NoHeading: no assigned heading and first waypoint has no heading
func (*Nav) DepartureMessage ¶
func (nav *Nav) DepartureMessage(sid string, reportHeading bool) *av.RadioTransmission
func (*Nav) DescendViaSTAR ¶
func (nav *Nav) DescendViaSTAR(simTime Time) av.CommandIntent
func (*Nav) DirectFix ¶
func (nav *Nav) DirectFix(fix string, turn av.TurnDirection, simTime Time, delayReduction time.Duration) av.CommandIntent
func (*Nav) DistanceToEndOfApproach ¶
distanceToEndOfApproach returns the remaining distance to the last waypoint (usually runway threshold) of the currently assigned approach.
func (*Nav) DivertToAirport ¶
func (*Nav) ETA ¶
ETA returns the estimated time in seconds until the aircraft will arrive at `p`, assuming it is flying direct.
func (*Nav) EnqueueDirectFix ¶
func (*Nav) EnqueueHeading ¶
func (nav *Nav) EnqueueHeading(hdg math.MagneticHeading, turn av.TurnDirection, approachCleared bool, simTime Time, delayReduction time.Duration)
EnqueueHeading enqueues the given heading assignment to be followed a few seconds in the future. It should only be called for heading changes due to controller instructions to the pilot and never in cases where the autopilot is changing the heading assignment. delayReduction is subtracted from the pilot-reaction delay (floored at zero) to offset latency already spent receiving the voice transmission.
func (*Nav) EnqueueOnCourse ¶
func (*Nav) ExpectApproach ¶
func (nav *Nav) ExpectApproach(airport *av.Airport, approach string, runwayWaypoints map[string]av.WaypointArray) av.CommandIntent
func (*Nav) ExpectDirect ¶ added in v0.14.2
func (nav *Nav) ExpectDirect(fix string) av.CommandIntent
func (*Nav) ExpediteClimb ¶
func (nav *Nav) ExpediteClimb() av.CommandIntent
func (*Nav) ExpediteClimbThrough ¶ added in v0.14.3
func (nav *Nav) ExpediteClimbThrough(throughAlt float32) av.CommandIntent
func (*Nav) ExpediteDescent ¶
func (nav *Nav) ExpediteDescent() av.CommandIntent
func (*Nav) ExpediteDescentThrough ¶ added in v0.14.3
func (nav *Nav) ExpediteDescentThrough(throughAlt float32) av.CommandIntent
func (*Nav) FlyPresentHeading ¶
func (*Nav) GoAroundWithProcedure ¶ added in v0.14.1
GoAroundWithProcedure initiates a go-around with a defined procedure. The runwayEndWP waypoint should have Location (opposite threshold), FlyOver, Heading (outbound), AltitudeRestriction, and GoAroundContactController set.
func (*Nav) GoodRateClimb ¶ added in v0.14.3
func (nav *Nav) GoodRateClimb() av.CommandIntent
func (*Nav) GoodRateDescent ¶ added in v0.14.3
func (nav *Nav) GoodRateDescent() av.CommandIntent
func (*Nav) GoodRateThrough ¶ added in v0.14.3
func (nav *Nav) GoodRateThrough(throughAlt float32) av.CommandIntent
func (*Nav) InterceptApproach ¶
func (*Nav) InterceptedButNotCleared ¶
func (*Nav) IsAirborne ¶
func (*Nav) MaintainMaximumForward ¶
func (nav *Nav) MaintainMaximumForward() av.CommandIntent
func (*Nav) MaintainPresentSpeed ¶ added in v0.14.0
func (nav *Nav) MaintainPresentSpeed() av.CommandIntent
func (*Nav) MaintainSlowestPractical ¶
func (nav *Nav) MaintainSlowestPractical() av.CommandIntent
func (*Nav) OnApproach ¶
func (*Nav) OnExtendedCenterline ¶
OnExtendedCenterline checks if the flight position is less than maxNmDeviation from the infinite line defined by the assigned approach localizer
func (*Nav) RestoreSnapshot ¶ added in v0.14.0
func (nav *Nav) RestoreSnapshot(snap NavSnapshot)
RestoreSnapshot restores nav state from a previously captured snapshot. The aircraft's physical state (FlightState) is NOT restored - only control assignments.
func (*Nav) ResumeOwnNavigation ¶
func (nav *Nav) ResumeOwnNavigation() av.CommandIntent
func (*Nav) SayAltitude ¶
func (nav *Nav) SayAltitude() av.CommandIntent
func (*Nav) SayHeading ¶
func (nav *Nav) SayHeading() av.CommandIntent
func (*Nav) SayIndicatedSpeed ¶ added in v0.14.1
func (nav *Nav) SayIndicatedSpeed() av.CommandIntent
func (*Nav) SayMach ¶ added in v0.14.1
func (nav *Nav) SayMach(temp av.Temperature) av.CommandIntent
func (*Nav) SaySpeed ¶
func (nav *Nav) SaySpeed(temp av.Temperature) av.CommandIntent
func (*Nav) Summary ¶
Full human-readable summary of nav state for use when paused and mouse hover on the scope
func (*Nav) TakeSnapshot ¶ added in v0.14.0
func (nav *Nav) TakeSnapshot() NavSnapshot
TakeSnapshot captures the current controller-modifiable nav state for later rollback.
func (*Nav) TargetAltitude ¶
TargetAltitude returns the target altitude, the rate to use (ft/min), and whether the descent is geometric (following a computed glidepath to a fix).
func (*Nav) TargetHeading ¶
func (nav *Nav) TargetHeading(callsign string, wxs wx.Sample, simTime Time) (heading math.MagneticHeading, turn av.TurnDirection, rate float32)
func (*Nav) TargetSpeed ¶
func (nav *Nav) TargetSpeed(targetAltitude float32, fp *av.FlightPlan, wxs wx.Sample, bravo *av.AirspaceGrid) (float32, float32)
func (*Nav) Update ¶
func (nav *Nav) Update(callsign string, model *wx.Model, fp *av.FlightPlan, simTime Time, bravo *av.AirspaceGrid) UpdateResult
func (*Nav) UpdateWithWeather ¶
func (nav *Nav) UpdateWithWeather(callsign string, wxs wx.Sample, fp *av.FlightPlan, simTime Time, bravo *av.AirspaceGrid) UpdateResult
UpdateWithWeather is a helper for simulations that use pre-fetched weather
type NavAirwork ¶
type NavAirwork struct {
}
func StartAirwork ¶
func StartAirwork(wp av.Waypoint, nav Nav) *NavAirwork
func (*NavAirwork) Start360 ¶
func (aw *NavAirwork) Start360(nav Nav)
func (*NavAirwork) TargetAltitude ¶
func (aw *NavAirwork) TargetAltitude() (float32, float32, bool)
func (*NavAirwork) TargetHeading ¶
func (aw *NavAirwork) TargetHeading() (math.MagneticHeading, av.TurnDirection, float32)
func (*NavAirwork) TargetSpeed ¶
func (aw *NavAirwork) TargetSpeed() (float32, float32, bool)
func (*NavAirwork) Update ¶
func (aw *NavAirwork) Update(nav *Nav) bool
type NavAltitude ¶
type NavAltitude struct {
// restriction at the way point; we keep trying until we get there (or
// are given another instruction..)
Restriction *av.AltitudeRestriction
}
type NavApproach ¶
type NavApproach struct {
}
func (*NavApproach) HasLocalizer ¶ added in v0.14.3
func (na *NavApproach) HasLocalizer() bool
HasLocalizer reports whether the aircraft is currently flying localizer-style course geometry.
type NavFixAssignment ¶
type NavFixAssignment struct {
Altitude *av.AltitudeRestriction
Speed *av.SpeedRestriction
}
Fix *av.Waypoint
Heading *math.MagneticHeading
Turn *av.TurnDirection
Speed *av.SpeedRestriction
CancelSpeed bool // cancel speed restrictions when passing this fix
Altitude *float32
}
}
type NavHeading ¶
type NavHeading struct {
}
type NavSnapshot ¶ added in v0.14.0
type NavSnapshot struct {
}
NavSnapshot captures all controller-modifiable state in Nav for rollback purposes. It does NOT include FlightState (aircraft physical position/heading/altitude) - only control assignments that can be rolled back.
type NavSpeed ¶
type NavSpeed struct {
Restriction *av.SpeedRestriction
}
type RateQualifier ¶ added in v0.14.3
type RateQualifier int
const ( RateNormal RateQualifier = iota RateGood // faster than normal, not maximum RateExpedite // maximum rate )
type Time ¶ added in v0.14.3
type Time struct {
// contains filtered or unexported fields
}
Time represents simulation time in the nav package — the virtual clock that advances according to the sim rate, pauses, etc. It is a distinct type from time.Time so that sim-time and wall-clock time cannot be accidentally mixed.
func (Time) MarshalJSON ¶ added in v0.14.3
func (Time) MarshalMsgpack ¶ added in v0.14.3
func (Time) Time ¶ added in v0.14.3
Time converts back to time.Time. Use when crossing out of the nav domain (e.g., weather lookups that need real timestamps).
func (*Time) UnmarshalJSON ¶ added in v0.14.3
func (*Time) UnmarshalMsgpack ¶ added in v0.14.3
type UpdateResult ¶ added in v0.14.3
type UpdateResult struct {
PassedWaypoint *av.Waypoint
ActionEvents []av.WaypointActionEvent
}