Paparazzi UAS  v4.0.4_stable-3-gf39211a
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
common_nav.h File Reference
#include "std.h"
#include "subsystems/navigation/common_flight_plan.h"
+ Include dependency graph for common_nav.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  point
 

Macros

#define WaypointX(_wp)   (waypoints[_wp].x)
 
#define WaypointY(_wp)   (waypoints[_wp].y)
 
#define WaypointAlt(_wp)   (waypoints[_wp].a)
 
#define Height(_h)   (_h + ground_alt)
 
#define NavSetGroundReferenceHere()   ({ nav_reset_reference(); nav_update_waypoints_alt(); FALSE; })
 
#define NavSetWaypointHere(_wp)
 

Functions

void nav_move_waypoint (uint8_t wp_id, float utm_east, float utm_north, float alt)
 
void compute_dist2_to_home (void)
 Computes square distance to the HOME waypoint potentially sets too_far_from_home. More...
 
unit_t nav_reset_reference (void) __attribute__((unused))
 Reset the geographic reference to the current GPS fix. More...
 
unit_t nav_update_waypoints_alt (void) __attribute__((unused))
 Shift altitude of the waypoint according to a new ground altitude. More...
 
void common_nav_periodic_task_4Hz (void)
 

Variables

float max_dist_from_home
 
float dist2_to_home
 
float dist2_to_wp
 
bool_t too_far_from_home
 
const uint8_t nb_waypoint
 
struct point waypoints []
 
float ground_alt
 size == nb_waypoint, waypoint 0 is a dummy waypoint More...
 
int32_t nav_utm_east0
 
int32_t nav_utm_north0
 
uint8_t nav_utm_zone0
 

Macro Definition Documentation

#define Height (   _h)    (_h + ground_alt)

Definition at line 45 of file common_nav.h.

#define NavSetGroundReferenceHere ( )    ({ nav_reset_reference(); nav_update_waypoints_alt(); FALSE; })

Definition at line 66 of file common_nav.h.

#define NavSetWaypointHere (   _wp)
Value:
({ \
})
float estimator_y
north position in meters
Definition: estimator.c:43
#define FALSE
Definition: imu_chimu.h:141
float estimator_x
east position in meters
Definition: estimator.c:42
struct point waypoints[]
Definition: navigation.c:40
float y
Definition: common_nav.h:38
float x
Definition: common_nav.h:37

Definition at line 68 of file common_nav.h.

#define WaypointAlt (   _wp)    (waypoints[_wp].a)

Definition at line 44 of file common_nav.h.

#define WaypointX (   _wp)    (waypoints[_wp].x)

Definition at line 42 of file common_nav.h.

#define WaypointY (   _wp)    (waypoints[_wp].y)

Definition at line 43 of file common_nav.h.

Function Documentation

void common_nav_periodic_task_4Hz ( void  )

Definition at line 97 of file common_nav.c.

References block_time, and stage_time.

Referenced by navigation_task().

+ Here is the caller graph for this function:

void compute_dist2_to_home ( void  )

Computes square distance to the HOME waypoint potentially sets too_far_from_home.

Definition at line 49 of file common_nav.c.

References dist2_to_home, estimator_x, estimator_y, too_far_from_home, point::x, and point::y.

void nav_move_waypoint ( uint8_t  wp_id,
float  utm_east,
float  utm_north,
float  alt 
)
unit_t nav_update_waypoints_alt ( void  )

Shift altitude of the waypoint according to a new ground altitude.

Definition at line 89 of file common_nav.c.

References point::a, ground_alt, and previous_ground_alt.

Variable Documentation

float dist2_to_home

Definition at line 31 of file common_nav.c.

Referenced by compute_dist2_to_home(), monitor_task(), and nav_home().

float dist2_to_wp

Definition at line 32 of file common_nav.c.

Referenced by nav_approaching_xy(), nav_home(), and nav_periodic_task().

float max_dist_from_home

Definition at line 44 of file common_nav.c.

Referenced by nav_move_waypoint().

const uint8_t nb_waypoint

Definition at line 38 of file navigation.c.

Referenced by cam_waypoint_target(), nav_init(), and nav_move_waypoint().

bool_t too_far_from_home

Definition at line 34 of file common_nav.c.

Referenced by compute_dist2_to_home(), and telecommand_task().