Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
navigation.h File Reference

Rotorcraft navigation functions. More...

#include "std.h"
#include "math/pprz_geodetic_int.h"
#include "math/pprz_geodetic_float.h"
#include "state.h"
#include "modules/nav/waypoints.h"
#include "modules/nav/common_flight_plan.h"
#include "autopilot.h"
#include "generated/airframe.h"
+ Include dependency graph for navigation.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  RotorcraftNavigation
 General Navigation structure. More...
 

Macros

#define DEFAULT_CIRCLE_RADIUS   5.f
 default nav_circle_radius in meters More...
 
#define NAV_CLIMB_VSPEED   0.5f
 
#define NAV_DESCEND_VSPEED   -0.8f
 
#define ARRIVED_AT_WAYPOINT   3.0f
 minimum horizontal distance to waypoint to mark as arrived More...
 
#define FAILSAFE_MODE_DISTANCE   (1.2*MAX_DIST_FROM_HOME)
 Maximum distance from HOME waypoint before going into failsafe mode. More...
 
#define NAV_CARROT_DIST   12
 Carrot distance during navigation. More...
 
#define CARROT   0
 default approaching_time for a wp More...
 
#define NAVIGATION_FREQUENCY   20
 default navigation frequency More...
 
#define NAV_HORIZONTAL_MODE_WAYPOINT   0
 Nav modes these modes correspond to the flight plan instructions used to set the high level navigation. More...
 
#define NAV_HORIZONTAL_MODE_ROUTE   1
 
#define NAV_HORIZONTAL_MODE_CIRCLE   2
 
#define NAV_HORIZONTAL_MODE_ATTITUDE   3
 
#define NAV_HORIZONTAL_MODE_NONE   4
 
#define NAV_HORIZONTAL_MODE_GUIDED   5
 
#define NAV_VERTICAL_MODE_MANUAL   0
 
#define NAV_VERTICAL_MODE_CLIMB   1
 
#define NAV_VERTICAL_MODE_ALT   2
 
#define NAV_VERTICAL_MODE_GUIDED   3
 
#define NAV_SETPOINT_MODE_POS   0
 Nav setpoint modes these modes correspond to submodes defined by navigation routines to tell which setpoint should be considered. More...
 
#define NAV_SETPOINT_MODE_SPEED   1
 
#define NAV_SETPOINT_MODE_ACCEL   2
 
#define NAV_SETPOINT_MODE_ATTITUDE   3
 
#define NAV_SETPOINT_MODE_QUAT   4
 
#define NAV_SETPOINT_MODE_RATE   5
 
#define NAV_SETPOINT_MODE_MANUAL   6
 
#define GetPosX()   (stateGetPositionEnu_f()->x)
 Get current x (east) position in local coordinates. More...
 
#define GetPosY()   (stateGetPositionEnu_f()->y)
 Get current y (north) position in local coordinates. More...
 
#define GetPosAlt()   (stateGetPositionEnu_f()->z+state.ned_origin_f.hmsl)
 Get current altitude above MSL. More...
 
#define GetPosHeight()   (stateGetPositionEnu_f()->z)
 Get current height above reference. More...
 
#define GetAltRef()   (state.ned_origin_f.hmsl)
 Get current altitude reference for local coordinates. More...
 
#define NavStartDetectGround()   ({ autopilot.detect_ground_once = true; false; })
 
#define NavDetectGround()   nav_detect_ground()
 
#define NavSetFailsafe   nav_set_failsafe
 
#define NavSetGroundReferenceHere   nav_reset_reference
 
#define NavSetAltitudeReferenceHere   nav_reset_alt
 
#define NavSetWaypointHere   waypoint_set_here_2d
 
#define NavCopyWaypoint   waypoint_copy
 
#define NavCopyWaypointPositionOnly   waypoint_position_copy
 
#define NavCheckWaypointTime(wp, time)   nav_check_wp_time(&waypoints[wp].enu_f, time)
 
#define NavAttitude(_roll)
 
#define NavVerticalAutoThrottleMode(_pitch)
 Set the climb control to auto-throttle with the specified pitch pre-command. More...
 
#define NavVerticalAltitudeMode(_alt, _pre_climb)
 Set the vertical mode to altitude control with the specified altitude setpoint and climb pre-command. More...
 
#define NavVerticalClimbMode(_climb)
 Set the vertical mode to climb control with the specified climb setpoint. More...
 
#define NavVerticalThrottleMode(_throttle)
 Set the vertical mode to fixed throttle with the specified setpoint. More...
 
#define NavHeading   nav_set_heading_rad
 Set the heading of the rotorcraft, nothing else. More...
 
#define NavSetMaxSpeed(_speed)
 Set maximum speed. More...
 
#define nav_IncreaseShift(x)   {}
 
#define nav_SetNavRadius(x)   {}
 
#define navigation_SetFlightAltitude(x)
 
#define NavVerticalAutoPitchMode(_throttle)   {}
 Unused compat macros. More...
 
#define NavFollow(_i, _d, _h)   {}
 

Typedefs

typedef void(* navigation_stage_init) (void)
 
typedef void(* navigation_goto) (struct EnuCoor_f *wp)
 
typedef void(* navigation_route) (struct EnuCoor_f *wp_start, struct EnuCoor_f *wp_end)
 
typedef bool(* navigation_approaching) (struct EnuCoor_f *wp_to, struct EnuCoor_f *wp_from, float approaching_time)
 
typedef void(* navigation_circle) (struct EnuCoor_f *wp_center, float radius)
 
typedef void(* navigation_oval_init) (void)
 
typedef void(* navigation_oval) (struct EnuCoor_f *wp1, struct EnuCoor_f *wp2, float radius)
 

Functions

void nav_register_stage_init (navigation_stage_init nav_stage_init)
 Registering functions. More...
 
void nav_register_goto_wp (navigation_goto nav_goto, navigation_route nav_route, navigation_approaching nav_approaching)
 Register functions. More...
 
void nav_register_circle (navigation_circle nav_circle)
 
void nav_register_oval (navigation_oval_init _nav_oval_init, navigation_oval nav_oval)
 
void nav_init (void)
 Navigation Initialisation. More...
 
void nav_run (void)
 
void nav_parse_BLOCK (uint8_t *buf)
 
void nav_parse_MOVE_WP (uint8_t *buf)
 
float get_dist2_to_waypoint (uint8_t wp_id)
 Returns squared horizontal distance to given waypoint. More...
 
float get_dist2_to_point (struct EnuCoor_f *p)
 Returns squared horizontal distance to given point. More...
 
void compute_dist2_to_home (void)
 Computes squared distance to the HOME waypoint potentially sets too_far_from_home. More...
 
void nav_home (void)
 Home mode navigation (circle around HOME) More...
 
void nav_reset_reference (void)
 Reset the geographic reference to the current GPS fix. More...
 
void nav_reset_alt (void)
 Reset the altitude reference to the current GPS alt. More...
 
void nav_periodic_task (void)
 Navigation main: call to the code generated from the XML flight plan. More...
 
bool nav_is_in_flight (void)
 
void nav_glide_points (struct EnuCoor_f *start_point, struct EnuCoor_f *end_point)
 
void nav_set_heading_rad (float rad)
 heading utility functions More...
 
void nav_set_heading_deg (float deg)
 Set nav_heading in degrees. More...
 
void nav_set_heading_towards (float x, float y)
 Set heading to point towards x,y position in local coordinates. More...
 
void nav_set_heading_towards_waypoint (uint8_t wp)
 Set heading in the direction of a waypoint. More...
 
void nav_set_heading_towards_target (void)
 Set heading in the direction of the target. More...
 
void nav_set_heading_current (void)
 Set heading to the current yaw angle. More...
 
void nav_set_failsafe (void)
 
bool nav_detect_ground (void)
 
static void NavKillThrottle (void)
 
static void NavResurrect (void)
 
bool nav_check_wp_time (struct EnuCoor_f *wp, uint16_t stay_time)
 Check the time spent in a radius of 'ARRIVED_AT_WAYPOINT' around a wp
More...
 
static void NavGotoWaypoint (uint8_t wp)
 
static void NavSegment (uint8_t wp_start, uint8_t wp_end)
 
static bool NavApproaching (uint8_t wp, float approaching_time)
 
static bool NavApproachingFrom (uint8_t to, uint8_t from, float approaching_time)
 
static void NavCircleWaypoint (uint8_t wp_center, float radius)
 
static void nav_oval_init (void)
 
static void Oval (uint8_t wp1, uint8_t wp2, float radius)
 
static void NavGlide (uint8_t wp_start, uint8_t wp_end)
 Nav glide routine. More...
 

Variables

struct RotorcraftNavigation nav
 
float flight_altitude
 Dynamically adjustable, reset to nav_altitude when it is changing. More...
 

Detailed Description

Rotorcraft navigation functions.

Definition in file navigation.h.


Data Structure Documentation

◆ RotorcraftNavigation

struct RotorcraftNavigation

General Navigation structure.

Definition at line 119 of file navigation.h.

+ Collaboration diagram for RotorcraftNavigation:
Data Fields
struct EnuCoor_f accel accel setpoint (in m/s)
struct EnuCoor_f carrot carrot position (also used for GCS display)
float climb climb setpoint (in m/s)
float climb_vspeed climb speed setting, mostly used in flight plans
float descend_vspeed descend speed setting, mostly used in flight plans
float dist2_to_home squared distance to home waypoint
float failsafe_mode_dist2 maximum squared distance to home wp before going to failsafe mode
float fp_altitude altitude setpoint from flight plan (in meters)
float fp_max_speed maximum speed setpoint from flight plan (in m/s), negative value means unset or invalid, do not use
float heading heading setpoint (in radians)
uint8_t horizontal_mode
float nav_altitude current altitude setpoint (in meters): might differ from fp_altitude depending on altitude shift from operator
navigation_approaching nav_approaching
navigation_circle nav_circle
navigation_goto nav_goto
navigation_oval nav_oval
navigation_oval_init nav_oval_init
navigation_route nav_route
navigation_stage_init nav_stage_init
float pitch pitch angle (in radians)
struct FloatQuat quat quaternion setpoint
float radius radius setpoint (in meters)
struct FloatRates rates rates setpoint (in rad/s)
float roll roll angle (in radians)
uint8_t setpoint_mode
struct EnuCoor_f speed speed setpoint (in m/s)
struct EnuCoor_f target final target position (in meters)
uint32_t throttle throttle command (in pprz_t)
bool too_far_from_home too_far flag
uint8_t vertical_mode

Macro Definition Documentation

◆ ARRIVED_AT_WAYPOINT

#define ARRIVED_AT_WAYPOINT   3.0f

minimum horizontal distance to waypoint to mark as arrived

Definition at line 55 of file navigation.h.

◆ CARROT

#define CARROT   0

default approaching_time for a wp

Definition at line 70 of file navigation.h.

◆ DEFAULT_CIRCLE_RADIUS

#define DEFAULT_CIRCLE_RADIUS   5.f

default nav_circle_radius in meters

Definition at line 42 of file navigation.h.

◆ FAILSAFE_MODE_DISTANCE

#define FAILSAFE_MODE_DISTANCE   (1.2*MAX_DIST_FROM_HOME)

Maximum distance from HOME waypoint before going into failsafe mode.

Definition at line 60 of file navigation.h.

◆ GetAltRef

#define GetAltRef ( )    (state.ned_origin_f.hmsl)

Get current altitude reference for local coordinates.

This is the ground_alt from the flight plan at first, but might be updated later through a call to NavSetGroundReferenceHere() or NavSetAltitudeReferenceHere(), e.g. in the GeoInit flight plan block.

Definition at line 192 of file navigation.h.

◆ GetPosAlt

#define GetPosAlt ( )    (stateGetPositionEnu_f()->z+state.ned_origin_f.hmsl)

Get current altitude above MSL.

Definition at line 183 of file navigation.h.

◆ GetPosHeight

#define GetPosHeight ( )    (stateGetPositionEnu_f()->z)

Get current height above reference.

Definition at line 185 of file navigation.h.

◆ GetPosX

#define GetPosX ( )    (stateGetPositionEnu_f()->x)

Get current x (east) position in local coordinates.

Definition at line 179 of file navigation.h.

◆ GetPosY

#define GetPosY ( )    (stateGetPositionEnu_f()->y)

Get current y (north) position in local coordinates.

Definition at line 181 of file navigation.h.

◆ NAV_CARROT_DIST

#define NAV_CARROT_DIST   12

Carrot distance during navigation.

Definition at line 65 of file navigation.h.

◆ NAV_CLIMB_VSPEED

#define NAV_CLIMB_VSPEED   0.5f

Definition at line 46 of file navigation.h.

◆ NAV_DESCEND_VSPEED

#define NAV_DESCEND_VSPEED   -0.8f

Definition at line 50 of file navigation.h.

◆ NAV_HORIZONTAL_MODE_ATTITUDE

#define NAV_HORIZONTAL_MODE_ATTITUDE   3

Definition at line 88 of file navigation.h.

◆ NAV_HORIZONTAL_MODE_CIRCLE

#define NAV_HORIZONTAL_MODE_CIRCLE   2

Definition at line 87 of file navigation.h.

◆ NAV_HORIZONTAL_MODE_GUIDED

#define NAV_HORIZONTAL_MODE_GUIDED   5

Definition at line 90 of file navigation.h.

◆ NAV_HORIZONTAL_MODE_NONE

#define NAV_HORIZONTAL_MODE_NONE   4

Definition at line 89 of file navigation.h.

◆ NAV_HORIZONTAL_MODE_ROUTE

#define NAV_HORIZONTAL_MODE_ROUTE   1

Definition at line 86 of file navigation.h.

◆ NAV_HORIZONTAL_MODE_WAYPOINT

#define NAV_HORIZONTAL_MODE_WAYPOINT   0

Nav modes these modes correspond to the flight plan instructions used to set the high level navigation.

Definition at line 85 of file navigation.h.

◆ nav_IncreaseShift

#define nav_IncreaseShift (   x)    {}

Definition at line 380 of file navigation.h.

◆ nav_SetNavRadius

#define nav_SetNavRadius (   x)    {}

Definition at line 381 of file navigation.h.

◆ NAV_SETPOINT_MODE_ACCEL

#define NAV_SETPOINT_MODE_ACCEL   2

Definition at line 102 of file navigation.h.

◆ NAV_SETPOINT_MODE_ATTITUDE

#define NAV_SETPOINT_MODE_ATTITUDE   3

Definition at line 103 of file navigation.h.

◆ NAV_SETPOINT_MODE_MANUAL

#define NAV_SETPOINT_MODE_MANUAL   6

Definition at line 106 of file navigation.h.

◆ NAV_SETPOINT_MODE_POS

#define NAV_SETPOINT_MODE_POS   0

Nav setpoint modes these modes correspond to submodes defined by navigation routines to tell which setpoint should be considered.

Definition at line 100 of file navigation.h.

◆ NAV_SETPOINT_MODE_QUAT

#define NAV_SETPOINT_MODE_QUAT   4

Definition at line 104 of file navigation.h.

◆ NAV_SETPOINT_MODE_RATE

#define NAV_SETPOINT_MODE_RATE   5

Definition at line 105 of file navigation.h.

◆ NAV_SETPOINT_MODE_SPEED

#define NAV_SETPOINT_MODE_SPEED   1

Definition at line 101 of file navigation.h.

◆ NAV_VERTICAL_MODE_ALT

#define NAV_VERTICAL_MODE_ALT   2

Definition at line 94 of file navigation.h.

◆ NAV_VERTICAL_MODE_CLIMB

#define NAV_VERTICAL_MODE_CLIMB   1

Definition at line 93 of file navigation.h.

◆ NAV_VERTICAL_MODE_GUIDED

#define NAV_VERTICAL_MODE_GUIDED   3

Definition at line 95 of file navigation.h.

◆ NAV_VERTICAL_MODE_MANUAL

#define NAV_VERTICAL_MODE_MANUAL   0

Definition at line 92 of file navigation.h.

◆ NavAttitude

#define NavAttitude (   _roll)
Value:
{ \
nav.horizontal_mode = NAV_HORIZONTAL_MODE_ATTITUDE; \
nav.setpoint_mode = NAV_SETPOINT_MODE_ATTITUDE; \
nav.roll = _roll; \
}
#define NAV_SETPOINT_MODE_ATTITUDE
Definition: navigation.h:103
#define NAV_HORIZONTAL_MODE_ATTITUDE
Definition: navigation.h:88

Definition at line 257 of file navigation.h.

◆ NavCheckWaypointTime

#define NavCheckWaypointTime (   wp,
  time 
)    nav_check_wp_time(&waypoints[wp].enu_f, time)

Definition at line 250 of file navigation.h.

◆ NavCopyWaypoint

#define NavCopyWaypoint   waypoint_copy

Definition at line 245 of file navigation.h.

◆ NavCopyWaypointPositionOnly

#define NavCopyWaypointPositionOnly   waypoint_position_copy

Definition at line 246 of file navigation.h.

◆ NavDetectGround

#define NavDetectGround ( )    nav_detect_ground()

Definition at line 226 of file navigation.h.

◆ NavFollow

#define NavFollow (   _i,
  _d,
  _h 
)    {}

Definition at line 395 of file navigation.h.

◆ NavHeading

#define NavHeading   nav_set_heading_rad

Set the heading of the rotorcraft, nothing else.

Definition at line 290 of file navigation.h.

◆ NAVIGATION_FREQUENCY

#define NAVIGATION_FREQUENCY   20

default navigation frequency

Definition at line 78 of file navigation.h.

◆ navigation_SetFlightAltitude

#define navigation_SetFlightAltitude (   x)
Value:
{ \
flight_altitude = x; \
nav.nav_altitude = flight_altitude - state.ned_origin_f.hmsl; \
}
struct State state
Definition: state.c:36
struct LtpDef_f ned_origin_f
Definition of the local (flat earth) coordinate system.
Definition: state.h:220
float hmsl
Height above mean sea level in meters.
float flight_altitude
Dynamically adjustable, reset to nav_altitude when it is changing.
Definition: nav.c:74

Definition at line 382 of file navigation.h.

◆ NavSetAltitudeReferenceHere

#define NavSetAltitudeReferenceHere   nav_reset_alt

Definition at line 242 of file navigation.h.

◆ NavSetFailsafe

#define NavSetFailsafe   nav_set_failsafe

Definition at line 239 of file navigation.h.

◆ NavSetGroundReferenceHere

#define NavSetGroundReferenceHere   nav_reset_reference

Definition at line 241 of file navigation.h.

◆ NavSetMaxSpeed

#define NavSetMaxSpeed (   _speed)
Value:
{ \
nav.fp_max_speed = _speed; \
}

Set maximum speed.

Definition at line 293 of file navigation.h.

◆ NavSetWaypointHere

#define NavSetWaypointHere   waypoint_set_here_2d

Definition at line 244 of file navigation.h.

◆ NavStartDetectGround

#define NavStartDetectGround ( )    ({ autopilot.detect_ground_once = true; false; })

Definition at line 225 of file navigation.h.

◆ NavVerticalAltitudeMode

#define NavVerticalAltitudeMode (   _alt,
  _pre_climb 
)
Value:
{ \
nav.vertical_mode = NAV_VERTICAL_MODE_ALT; \
nav.fp_altitude = _alt; \
}
#define NAV_VERTICAL_MODE_ALT
Definition: navigation.h:94

Set the vertical mode to altitude control with the specified altitude setpoint and climb pre-command.

Definition at line 271 of file navigation.h.

◆ NavVerticalAutoPitchMode

#define NavVerticalAutoPitchMode (   _throttle)    {}

Unused compat macros.

Definition at line 390 of file navigation.h.

◆ NavVerticalAutoThrottleMode

#define NavVerticalAutoThrottleMode (   _pitch)
Value:
{ \
nav.pitch = _pitch; \
}

Set the climb control to auto-throttle with the specified pitch pre-command.

Definition at line 265 of file navigation.h.

◆ NavVerticalClimbMode

#define NavVerticalClimbMode (   _climb)
Value:
{ \
nav.vertical_mode = NAV_VERTICAL_MODE_CLIMB; \
nav.climb = _climb; \
nav.speed.z = _climb; \
}
#define NAV_VERTICAL_MODE_CLIMB
Definition: navigation.h:93

Set the vertical mode to climb control with the specified climb setpoint.

Definition at line 277 of file navigation.h.

◆ NavVerticalThrottleMode

#define NavVerticalThrottleMode (   _throttle)
Value:
{ \
nav.vertical_mode = NAV_VERTICAL_MODE_MANUAL; \
nav.throttle = _throttle; \
}
#define NAV_VERTICAL_MODE_MANUAL
Definition: navigation.h:92

Set the vertical mode to fixed throttle with the specified setpoint.

Definition at line 284 of file navigation.h.

Typedef Documentation

◆ navigation_approaching

typedef bool(* navigation_approaching) (struct EnuCoor_f *wp_to, struct EnuCoor_f *wp_from, float approaching_time)

Definition at line 111 of file navigation.h.

◆ navigation_circle

typedef void(* navigation_circle) (struct EnuCoor_f *wp_center, float radius)

Definition at line 112 of file navigation.h.

◆ navigation_goto

typedef void(* navigation_goto) (struct EnuCoor_f *wp)

Definition at line 109 of file navigation.h.

◆ navigation_oval

typedef void(* navigation_oval) (struct EnuCoor_f *wp1, struct EnuCoor_f *wp2, float radius)

Definition at line 114 of file navigation.h.

◆ navigation_oval_init

typedef void(* navigation_oval_init) (void)

Definition at line 113 of file navigation.h.

◆ navigation_route

typedef void(* navigation_route) (struct EnuCoor_f *wp_start, struct EnuCoor_f *wp_end)

Definition at line 110 of file navigation.h.

◆ navigation_stage_init

typedef void(* navigation_stage_init) (void)

Definition at line 108 of file navigation.h.

Function Documentation

◆ compute_dist2_to_home()

void compute_dist2_to_home ( void  )

Computes squared distance to the HOME waypoint potentially sets too_far_from_home.

Computes squared distance to the HOME waypoint potentially sets too_far_from_home.

Updates dist2_to_home and potentially sets too_far_from_home

Definition at line 326 of file navigation.c.

◆ get_dist2_to_point()

float get_dist2_to_point ( struct EnuCoor_f p)

Returns squared horizontal distance to given point.

Definition at line 308 of file navigation.c.

◆ get_dist2_to_waypoint()

float get_dist2_to_waypoint ( uint8_t  wp_id)

Returns squared horizontal distance to given waypoint.

Definition at line 318 of file navigation.c.

◆ nav_check_wp_time()

bool nav_check_wp_time ( struct EnuCoor_f wp,
uint16_t  stay_time 
)

Check the time spent in a radius of 'ARRIVED_AT_WAYPOINT' around a wp

Definition at line 180 of file navigation.c.

References ARRIVED_AT_WAYPOINT, autopilot, ENU_BFP_OF_REAL, pprz_autopilot::flight_time, float_vect2_norm(), INT_VECT3_ZERO, stateGetPositionEnu_f(), VECT2_DIFF, EnuCoor_i::x, and EnuCoor_i::y.

Referenced by mission_nav_path(), mission_nav_segment(), and mission_nav_wp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nav_detect_ground()

bool nav_detect_ground ( void  )

Definition at line 267 of file navigation.c.

References autopilot, and pprz_autopilot::ground_detected.

◆ nav_glide_points()

void nav_glide_points ( struct EnuCoor_f start_point,
struct EnuCoor_f end_point 
)

Definition at line 282 of file navigation.c.

References float_vect2_norm2(), NavVerticalAltitudeMode, pos_diff, stateGetPositionEnu_f(), VECT2_DIFF, FloatVect2::x, FloatVect2::y, and EnuCoor_f::z.

Referenced by nav_land_run(), and NavGlide().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nav_home()

void nav_home ( void  )

Home mode navigation (circle around HOME)

Home mode navigation (circle around HOME)

Nominal speed

Nominal speed

Nominal speed

Definition at line 424 of file nav.c.

◆ nav_init()

void nav_init ( void  )

Navigation Initialisation.

Definition at line 532 of file nav.c.

◆ nav_is_in_flight()

bool nav_is_in_flight ( void  )

Definition at line 277 of file navigation.c.

◆ nav_oval_init()

static void nav_oval_init ( void  )
inlinestatic

Definition at line 350 of file navigation.h.

References nav, and RotorcraftNavigation::nav_oval_init.

◆ nav_parse_BLOCK()

void nav_parse_BLOCK ( uint8_t buf)

Definition at line 115 of file navigation.c.

◆ nav_parse_MOVE_WP()

void nav_parse_MOVE_WP ( uint8_t buf)

Definition at line 121 of file navigation.c.

◆ nav_periodic_task()

void nav_periodic_task ( void  )

Navigation main: call to the code generated from the XML flight plan.

Definition at line 445 of file nav.c.

◆ nav_register_circle()

void nav_register_circle ( navigation_circle  nav_circle)

Definition at line 399 of file navigation.c.

◆ nav_register_goto_wp()

void nav_register_goto_wp ( navigation_goto  nav_goto,
navigation_route  nav_route,
navigation_approaching  nav_approaching 
)

Register functions.

Definition at line 392 of file navigation.c.

◆ nav_register_oval()

void nav_register_oval ( navigation_oval_init  _nav_oval_init,
navigation_oval  nav_oval 
)

Definition at line 404 of file navigation.c.

◆ nav_register_stage_init()

void nav_register_stage_init ( navigation_stage_init  nav_stage_init)

Registering functions.

Registering functions.

Definition at line 387 of file navigation.c.

References nav, RotorcraftNavigation::nav_stage_init, and nav_stage_init().

Referenced by nav_rotorcraft_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nav_reset_alt()

void nav_reset_alt ( void  )

Reset the altitude reference to the current GPS alt.

Definition at line 241 of file navigation.c.

◆ nav_reset_reference()

void nav_reset_reference ( void  )

Reset the geographic reference to the current GPS fix.

Definition at line 234 of file navigation.c.

◆ nav_run()

void nav_run ( void  )

Definition at line 165 of file navigation.c.

◆ nav_set_failsafe()

void nav_set_failsafe ( void  )

Definition at line 380 of file navigation.c.

◆ nav_set_heading_current()

void nav_set_heading_current ( void  )

Set heading to the current yaw angle.

Definition at line 375 of file navigation.c.

◆ nav_set_heading_deg()

void nav_set_heading_deg ( float  deg)

Set nav_heading in degrees.

Definition at line 344 of file navigation.c.

◆ nav_set_heading_rad()

void nav_set_heading_rad ( float  rad)

heading utility functions

heading utility functions

Definition at line 337 of file navigation.c.

◆ nav_set_heading_towards()

void nav_set_heading_towards ( float  x,
float  y 
)

Set heading to point towards x,y position in local coordinates.

Definition at line 350 of file navigation.c.

◆ nav_set_heading_towards_target()

void nav_set_heading_towards_target ( void  )

Set heading in the direction of the target.

Definition at line 369 of file navigation.c.

◆ nav_set_heading_towards_waypoint()

void nav_set_heading_towards_waypoint ( uint8_t  wp)

Set heading in the direction of a waypoint.

Definition at line 363 of file navigation.c.

◆ NavApproaching()

static bool NavApproaching ( uint8_t  wp,
float  approaching_time 
)
inlinestatic

Definition at line 320 of file navigation.h.

References nav, RotorcraftNavigation::nav_approaching, and waypoint_get_enu_f().

+ Here is the call graph for this function:

◆ NavApproachingFrom()

static bool NavApproachingFrom ( uint8_t  to,
uint8_t  from,
float  approaching_time 
)
inlinestatic

Definition at line 329 of file navigation.h.

References nav, RotorcraftNavigation::nav_approaching, and waypoint_get_enu_f().

+ Here is the call graph for this function:

◆ NavCircleWaypoint()

static void NavCircleWaypoint ( uint8_t  wp_center,
float  radius 
)
inlinestatic

Definition at line 340 of file navigation.h.

References nav, RotorcraftNavigation::nav_circle, and waypoint_get_enu_f().

+ Here is the call graph for this function:

◆ NavGlide()

static void NavGlide ( uint8_t  wp_start,
uint8_t  wp_end 
)
inlinestatic

Nav glide routine.

Definition at line 367 of file navigation.h.

References nav_glide_points(), and waypoint_get_enu_f().

+ Here is the call graph for this function:

◆ NavGotoWaypoint()

static void NavGotoWaypoint ( uint8_t  wp)
inlinestatic

Definition at line 302 of file navigation.h.

References nav, RotorcraftNavigation::nav_goto, and waypoint_get_enu_f().

+ Here is the call graph for this function:

◆ NavKillThrottle()

static void NavKillThrottle ( void  )
inlinestatic

Definition at line 229 of file navigation.h.

References AP_MODE_NAV, autopilot_get_mode(), and autopilot_set_motors_on().

+ Here is the call graph for this function:

◆ NavResurrect()

static void NavResurrect ( void  )
inlinestatic

Definition at line 233 of file navigation.h.

References AP_MODE_NAV, autopilot_get_mode(), and autopilot_set_motors_on().

Referenced by nav_takeoff_run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NavSegment()

static void NavSegment ( uint8_t  wp_start,
uint8_t  wp_end 
)
inlinestatic

Definition at line 311 of file navigation.h.

References nav, RotorcraftNavigation::nav_route, and waypoint_get_enu_f().

+ Here is the call graph for this function:

◆ Oval()

static void Oval ( uint8_t  wp1,
uint8_t  wp2,
float  radius 
)
inlinestatic

Definition at line 355 of file navigation.h.

References nav, RotorcraftNavigation::nav_oval, and waypoint_get_enu_f().

+ Here is the call graph for this function:

Variable Documentation

◆ flight_altitude

float flight_altitude
extern

Dynamically adjustable, reset to nav_altitude when it is changing.

Definition at line 74 of file nav.c.

Referenced by formation_flight(), nav_init(), and nav_set_altitude().

◆ nav