Paparazzi UAS
v5.10_stable-5-g83a0da5-dirty
Paparazzi is a free software Unmanned Aircraft System.
|
#include "subsystems/navigation/waypoints.h"
#include "state.h"
#include "subsystems/datalink/downlink.h"
#include "generated/flight_plan.h"
Go to the source code of this file.
Functions | |
void | waypoints_init (void) |
initialize global and local waypoints More... | |
bool | waypoint_is_global (uint8_t wp_id) |
void | waypoint_set_global_flag (uint8_t wp_id) |
void | waypoint_clear_global_flag (uint8_t wp_id) |
float | waypoint_get_x (uint8_t wp_id) |
Get X/East coordinate of waypoint in meters. More... | |
float | waypoint_get_y (uint8_t wp_id) |
Get Y/North coordinate of waypoint in meters. More... | |
float | waypoint_get_alt (uint8_t wp_id) |
Get altitude of waypoint in meters (above reference) More... | |
void | waypoint_set_enu_i (uint8_t wp_id, struct EnuCoor_i *enu) |
void | waypoint_set_enu (uint8_t wp_id, struct EnuCoor_f *enu) |
Set local ENU waypoint coordinates. More... | |
void | waypoint_move_enu_i (uint8_t wp_id, struct EnuCoor_i *new_pos) |
void | waypoint_set_xy_i (uint8_t wp_id, int32_t x, int32_t y) |
Set only local XY coordinates of waypoint without update altitude. More... | |
void | waypoint_set_alt_i (uint8_t wp_id, int32_t alt) |
void | waypoint_set_alt (uint8_t wp_id, float alt) |
Set altitude of waypoint in meters (above reference) More... | |
void | waypoint_set_lla (uint8_t wp_id, struct LlaCoor_i *lla) |
void | waypoint_move_lla (uint8_t wp_id, struct LlaCoor_i *lla) |
void | waypoint_set_latlon (uint8_t wp_id, struct LlaCoor_i *lla) |
set waypoint latitude/longitude without updating altitude More... | |
void | waypoint_set_here (uint8_t wp_id) |
set waypoint to current location and altitude More... | |
void | waypoint_set_here_2d (uint8_t wp_id) |
set waypoint to current horizontal location without modifying altitude More... | |
void | waypoint_globalize (uint8_t wp_id) |
update global LLA coordinates from its ENU coordinates More... | |
void | waypoint_localize (uint8_t wp_id) |
update local ENU coordinates from its LLA coordinates More... | |
void | waypoints_localize_all (void) |
update local ENU coordinates of global waypoints More... | |
struct LlaCoor_i * | waypoint_get_lla (uint8_t wp_id) |
Get LLA coordinates of waypoint. More... | |
void | waypoint_copy (uint8_t wp_dest, uint8_t wp_src) |
copy one waypoint to another, this includes all flags from the source waypoint More... | |
void | waypoint_position_copy (uint8_t wp_dest, uint8_t wp_src) |
Variables | |
const uint8_t | nb_waypoint = NB_WAYPOINT |
struct Waypoint | waypoints [NB_WAYPOINT] |
size == nb_waypoint, waypoint 0 is a dummy waypoint More... | |
void waypoint_clear_global_flag | ( | uint8_t | wp_id | ) |
Definition at line 70 of file waypoints.c.
References nb_waypoint, waypoints, and WP_FLAG_GLOBAL.
copy one waypoint to another, this includes all flags from the source waypoint
Definition at line 295 of file waypoints.c.
References nb_waypoint, and waypoints.
Referenced by drop_zone_set().
float waypoint_get_alt | ( | uint8_t | wp_id | ) |
Get altitude of waypoint in meters (above reference)
Definition at line 93 of file waypoints.c.
References Waypoint::enu_f, nb_waypoint, waypoints, and EnuCoor_f::z.
Referenced by stereocam_droplet_periodic().
Get LLA coordinates of waypoint.
If the waypoint does not have its global coordinates set, the LLA representation is computed if the local origin is set.
wp_id | waypoint id |
Definition at line 282 of file waypoints.c.
References Waypoint::lla, nb_waypoint, waypoint_globalize(), waypoint_is_global(), waypoints, and WP_FLAG_LLA_I.
Referenced by mavlink_send_wp().
float waypoint_get_x | ( | uint8_t | wp_id | ) |
Get X/East coordinate of waypoint in meters.
Definition at line 77 of file waypoints.c.
References Waypoint::enu_f, nb_waypoint, waypoints, and EnuCoor_f::x.
Referenced by mission_point_of_lla(), and stereocam_droplet_periodic().
float waypoint_get_y | ( | uint8_t | wp_id | ) |
Get Y/North coordinate of waypoint in meters.
Definition at line 85 of file waypoints.c.
References Waypoint::enu_f, nb_waypoint, waypoints, and EnuCoor_f::y.
Referenced by mission_point_of_lla(), and stereocam_droplet_periodic().
void waypoint_globalize | ( | uint8_t | wp_id | ) |
update global LLA coordinates from its ENU coordinates
Definition at line 237 of file waypoints.c.
References ecef_of_enu_pos_i(), Waypoint::enu_i, lla_of_ecef_i(), State::ned_initialized_i, State::ned_origin_i, state, waypoints, and WP_FLAG_LLA_I.
Referenced by waypoint_get_lla(), waypoint_set_alt(), waypoint_set_alt_i(), waypoint_set_enu(), waypoint_set_enu_i(), and waypoint_set_xy_i().
bool waypoint_is_global | ( | uint8_t | wp_id | ) |
Definition at line 55 of file waypoints.c.
References nb_waypoint, waypoints, and WP_FLAG_GLOBAL.
Referenced by waypoint_get_lla(), waypoint_move_lla(), waypoint_set_here(), waypoint_set_here_2d(), and waypoints_localize_all().
void waypoint_localize | ( | uint8_t | wp_id | ) |
update local ENU coordinates from its LLA coordinates
Definition at line 248 of file waypoints.c.
References ENU_FLOAT_OF_BFP, Waypoint::enu_i, enu_of_lla_point_i(), Waypoint::lla, State::ned_initialized_i, State::ned_origin_i, POS_BFP_OF_REAL, state, waypoints, WP_FLAG_ENU_F, WP_FLAG_ENU_I, EnuCoor_i::x, EnuCoor_i::y, and EnuCoor_i::z.
Referenced by waypoint_set_latlon(), waypoint_set_lla(), and waypoints_localize_all().
Definition at line 125 of file waypoints.c.
References DefaultChannel, DefaultDevice, nb_waypoint, waypoint_set_enu_i(), EnuCoor_i::x, EnuCoor_i::y, and EnuCoor_i::z.
Definition at line 180 of file waypoints.c.
References LlaCoor_i::alt, DefaultChannel, DefaultDevice, Waypoint::enu_i, LtpDef_i::hmsl, LlaCoor_i::lat, LtpDef_i::lla, LlaCoor_i::lon, nb_waypoint, State::ned_origin_i, state, waypoint_is_global(), waypoint_set_lla(), waypoints, EnuCoor_i::y, and EnuCoor_i::z.
Referenced by firmware_parse_msg().
Definition at line 302 of file waypoints.c.
References Waypoint::enu_f, Waypoint::enu_i, LlaCoor_i::lat, Waypoint::lla, LlaCoor_i::lon, nb_waypoint, waypoints, EnuCoor_f::x, EnuCoor_i::x, EnuCoor_f::y, and EnuCoor_i::y.
void waypoint_set_alt | ( | uint8_t | wp_id, |
float | alt | ||
) |
Set altitude of waypoint in meters (above reference)
Definition at line 160 of file waypoints.c.
References LlaCoor_i::alt, Waypoint::enu_f, Waypoint::enu_i, nb_waypoint, POS_BFP_OF_REAL, waypoint_globalize(), waypoints, EnuCoor_f::z, and EnuCoor_i::z.
Referenced by follow_me_periodic().
Definition at line 150 of file waypoints.c.
References LlaCoor_i::alt, Waypoint::enu_f, Waypoint::enu_i, nb_waypoint, POS_FLOAT_OF_BFP, waypoint_globalize(), waypoints, EnuCoor_f::z, and EnuCoor_i::z.
Referenced by georeference_project().
Set local ENU waypoint coordinates.
Definition at line 113 of file waypoints.c.
References ENU_BFP_OF_REAL, Waypoint::enu_f, nb_waypoint, waypoint_globalize(), waypoints, WP_FLAG_ENU_F, WP_FLAG_ENU_I, and WP_FLAG_LLA_I.
Referenced by mavlink_wp_message_handler(), stereocam_droplet_periodic(), and waypoints_init().
Definition at line 101 of file waypoints.c.
References ENU_FLOAT_OF_BFP, Waypoint::enu_i, nb_waypoint, waypoint_globalize(), waypoints, WP_FLAG_ENU_F, WP_FLAG_ENU_I, and WP_FLAG_LLA_I.
Referenced by follow_wp(), waypoint_move_enu_i(), and waypoint_set_here().
void waypoint_set_global_flag | ( | uint8_t | wp_id | ) |
Definition at line 63 of file waypoints.c.
References nb_waypoint, waypoints, and WP_FLAG_GLOBAL.
Referenced by waypoints_init().
void waypoint_set_here | ( | uint8_t | wp_id | ) |
set waypoint to current location and altitude
Definition at line 212 of file waypoints.c.
References nb_waypoint, stateGetPositionEnu_i(), stateGetPositionLla_i(), waypoint_is_global(), waypoint_set_enu_i(), and waypoint_set_lla().
void waypoint_set_here_2d | ( | uint8_t | wp_id | ) |
set waypoint to current horizontal location without modifying altitude
Definition at line 225 of file waypoints.c.
References nb_waypoint, stateGetPositionEnu_i(), stateGetPositionLla_i(), waypoint_is_global(), waypoint_set_latlon(), and waypoint_set_xy_i().
set waypoint latitude/longitude without updating altitude
Definition at line 200 of file waypoints.c.
References LlaCoor_i::lat, Waypoint::lla, LlaCoor_i::lon, nb_waypoint, waypoint_localize(), waypoints, and WP_FLAG_LLA_I.
Referenced by waypoint_set_here_2d().
Definition at line 170 of file waypoints.c.
References Waypoint::lla, nb_waypoint, waypoint_localize(), waypoints, and WP_FLAG_LLA_I.
Referenced by mavlink_wp_message_handler(), waypoint_move_lla(), waypoint_set_here(), and waypoints_init().
Set only local XY coordinates of waypoint without update altitude.
Definition at line 138 of file waypoints.c.
References Waypoint::enu_f, Waypoint::enu_i, nb_waypoint, POS_FLOAT_OF_BFP, waypoint_globalize(), waypoints, EnuCoor_f::x, EnuCoor_i::x, EnuCoor_f::y, and EnuCoor_i::y.
Referenced by georeference_filter(), georeference_project(), moveWaypointForwards(), run_avoid_navigation_onvision(), and waypoint_set_here_2d().
void waypoints_init | ( | void | ) |
initialize global and local waypoints
Definition at line 35 of file waypoints.c.
References Waypoint::flags, nb_waypoint, waypoint_set_enu(), waypoint_set_global_flag(), waypoint_set_lla(), and waypoints.
Referenced by nav_init().
void waypoints_localize_all | ( | void | ) |
update local ENU coordinates of global waypoints
update local ENU coordinates of all global waypoints
Definition at line 265 of file waypoints.c.
References nb_waypoint, waypoint_is_global(), and waypoint_localize().
Referenced by main_init(), nav_reset_alt(), and nav_reset_reference().
const uint8_t nb_waypoint = NB_WAYPOINT |
Definition at line 31 of file waypoints.c.
Referenced by waypoint_clear_global_flag(), waypoint_copy(), waypoint_get_alt(), waypoint_get_lla(), waypoint_get_x(), waypoint_get_y(), waypoint_is_global(), waypoint_move_enu_i(), waypoint_move_lla(), waypoint_position_copy(), waypoint_set_alt(), waypoint_set_alt_i(), waypoint_set_enu(), waypoint_set_enu_i(), waypoint_set_global_flag(), waypoint_set_here(), waypoint_set_here_2d(), waypoint_set_latlon(), waypoint_set_lla(), waypoint_set_xy_i(), waypoints_init(), and waypoints_localize_all().
struct Waypoint waypoints[NB_WAYPOINT] |
size == nb_waypoint, waypoint 0 is a dummy waypoint
Definition at line 32 of file waypoints.c.
Referenced by waypoint_clear_global_flag(), waypoint_copy(), waypoint_get_alt(), waypoint_get_lla(), waypoint_get_x(), waypoint_get_y(), waypoint_globalize(), waypoint_is_global(), waypoint_localize(), waypoint_move_lla(), waypoint_position_copy(), waypoint_set_alt(), waypoint_set_alt_i(), waypoint_set_enu(), waypoint_set_enu_i(), waypoint_set_global_flag(), waypoint_set_latlon(), waypoint_set_lla(), waypoint_set_xy_i(), and waypoints_init().