|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
38 #include "generated/modules.h"
39 #include "generated/flight_plan.h"
44 #include "pprzlink/messages.h"
64 #if PERIODIC_TELEMETRY
72 pprz_msg_send_WP_MOVED_ENU(trans,
dev, AC_ID,
100 #if PERIODIC_TELEMETRY
230 #ifdef InGeofenceSector
281 #ifdef AP_MODE_FAILSAFE
void(* nav_rover_oval_init)(void)
float dist2_to_home
squared distance to home waypoint
bool too_far_from_home
too_far flag
void compute_dist2_to_home(void)
Computes squared distance to the HOME waypoint potentially sets too_far_from_home.
void ins_reset_altitude_ref(void)
INS altitude reference reset.
struct EnuCoor_f carrot
carrot position
bool nav_check_wp_time(struct EnuCoor_i *wp, uint16_t stay_time)
Check the time spent in a radius of 'ARRIVED_AT_WAYPOINT' around a wp
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
void(* nav_rover_goto)(struct EnuCoor_f *wp)
struct EnuCoor_f target
final target
void nav_circle(struct EnuCoor_i *wp_center, int32_t radius)
static struct FloatEulers * stateGetNedToBodyEulers_f(void)
Get vehicle body attitude euler angles (float).
void nav_set_heading_towards(float x, float y)
Set heading to point towards x,y position in local coordinates.
#define NAV_MODE_WAYPOINT
Nav modes.
void nav_reset_reference(void)
Reset the geographic reference to the current GPS fix.
struct RoverNavigation nav
#define NormCourseRad(x)
Normalize a rad angle between 0 and 2*PI.
float get_dist2_to_waypoint(uint8_t wp_id)
Returns squared horizontal distance to given waypoint.
struct point waypoints[NB_WAYPOINT]
size == nb_waypoint, waypoint 0 is a dummy waypoint
void ins_reset_local_origin(void)
local implemetation of the ins_reset functions
void nav_set_heading_current(void)
Set heading to the current yaw angle.
Paparazzi fixed point algebra.
#define VECT2_DIFF(_c, _a, _b)
#define VECT2_COPY(_a, _b)
void nav_register_goto_wp(nav_rover_goto nav_goto, nav_rover_route nav_route, nav_rover_approaching nav_approaching)
Register functions.
void nav_init(void)
Navigation Initialisation.
bool autopilot_in_flight(void)
get in_flight flag
struct FloatVect2 pos_diff
uint8_t last_wp
Index of last waypoint.
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
void(* nav_rover_route)(struct EnuCoor_f *wp_start, struct EnuCoor_f *wp_end)
void(* nav_rover_oval)(struct EnuCoor_f *wp1, struct EnuCoor_f *wp2, float radius)
Device independent GPS code (interface)
nav_rover_route nav_route
#define DEFAULT_CIRCLE_RADIUS
default nav_circle_radius in meters
const uint8_t nb_waypoint
void(* nav_rover_circle)(struct EnuCoor_f *wp_center, float radius)
static const struct usb_device_descriptor dev
float get_dist2_to_point(struct EnuCoor_i *p)
Returns squared horizontal distance to given point.
void nav_route(struct EnuCoor_i *wp_start, struct EnuCoor_i *wp_end)
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
void nav_oval(uint8_t p1, uint8_t p2, float radius)
Navigation along a figure O.
vector in East North Up coordinates Units: meters
nav_rover_circle nav_circle
float failsafe_mode_dist2
maximum squared distance to home wp before going to failsafe mode
void nav_home(void)
Home mode navigation.
General Navigation structure.
void nav_register_circle(nav_rover_circle nav_circle)
uint16_t f
Camera baseline, in meters (i.e. horizontal distance between the two cameras of the stereo setup)
Common code for AP and FBW telemetry.
void set_exception_flag(uint8_t flag_num)
static void send_wp_moved(struct transport_tx *trans, struct link_device *dev)
void waypoints_init(void)
initialize global and local waypoints
void waypoints_localize_all(void)
update local ENU coordinates of global waypoints
#define FAILSAFE_MODE_DISTANCE
Maximum distance from HOME waypoint before going into failsafe mode.
void nav_periodic_task(void)
Navigation main: call to the code generated from the XML flight plan.
void nav_register_oval(nav_rover_oval_init nav_oval_init, nav_rover_oval nav_oval)
bool autopilot_set_mode(uint8_t new_autopilot_mode)
set autopilot mode
bool(* nav_rover_approaching)(struct EnuCoor_f *wp_to, struct EnuCoor_f *wp_from, float approaching_time)
void nav_set_heading_deg(float deg)
Set nav_heading in degrees.
void nav_init_stage(void)
needs to be implemented by fixedwing and rotorcraft seperately
float speed
speed setpoint
static void nav_goto(struct EnuCoor_f *wp)
Implement basic nav function.
bool exception_flag[10]
array of flags that might be used in flight plans
float shift
lateral shift (in meters)
struct EnuCoor_f last_pos
last stage position
void nav_set_heading_towards_waypoint(uint8_t wp)
Set heading in the direction of a waypoint.
bool nav_is_in_flight(void)
const float max_dist2_from_home
void nav_set_heading_rad(float rad)
Set nav_heading in radians.
float heading
heading setpoint (in radians)
#define DefaultPeriodic
Set default periodic telemetry.
nav_rover_oval_init nav_oval_init
void nav_set_heading_towards_target(void)
Set heading in the direction of the target.
float radius
radius setpoint
#define VECT3_COPY(_a, _b)
nav_rover_approaching nav_approaching
void nav_set_failsafe(void)
const float max_dist_from_home
static bool nav_approaching(struct EnuCoor_f *wp, struct EnuCoor_f *from, float approaching_time)
float turn
turn rate setpoint