29 #include "generated/flight_plan.h"
37 struct EnuCoor_f wp_tmp_float[NB_WAYPOINT] = WAYPOINTS_ENU;
38 struct LlaCoor_i wp_tmp_lla_i[NB_WAYPOINT] = WAYPOINTS_LLA_WGS84;
40 bool is_global[NB_WAYPOINT] = WAYPOINTS_GLOBAL;
130 &(new_pos->
y), &(new_pos->
z));
190 &lla->
lat, &lla->
lon, &hmsl);
void waypoint_set_global_flag(uint8_t wp_id)
void ecef_of_enu_pos_i(struct EcefCoor_i *ecef, struct LtpDef_i *def, struct EnuCoor_i *enu)
Convert a local ENU position to ECEF.
vector in EarthCenteredEarthFixed coordinates
void waypoint_set_alt_i(uint8_t wp_id, int32_t alt)
vector in East North Up coordinates Units: meters
#define POS_BFP_OF_REAL(_af)
float waypoint_get_alt(uint8_t wp_id)
Get altitude of waypoint in meters (above reference)
vector in Latitude, Longitude and Altitude
void waypoint_position_copy(uint8_t wp_dest, uint8_t wp_src)
void waypoint_set_alt(uint8_t wp_id, float alt)
Set altitude of waypoint in meters (above reference)
int32_t hmsl
Height above mean sea level in mm.
int32_t alt
in millimeters above WGS84 reference ellipsoid
void waypoint_move_lla(uint8_t wp_id, struct LlaCoor_i *lla)
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.
void waypoint_set_here(uint8_t wp_id)
set waypoint to current location and altitude
struct Waypoint waypoints[NB_WAYPOINT]
size == nb_waypoint, waypoint 0 is a dummy waypoint
float waypoint_get_x(uint8_t wp_id)
Get X/East coordinate of waypoint in meters.
void waypoint_set_latlon(uint8_t wp_id, struct LlaCoor_i *lla)
set waypoint latitude/longitude without updating altitude
float waypoint_get_y(uint8_t wp_id)
Get Y/North coordinate of waypoint in meters.
void waypoint_move_enu_i(uint8_t wp_id, struct EnuCoor_i *new_pos)
#define ENU_FLOAT_OF_BFP(_o, _i)
struct LlaCoor_i lla
Reference point in lla.
void waypoint_copy(uint8_t wp_dest, uint8_t wp_src)
copy one waypoint to another, this includes all flags from the source waypoint
int32_t lon
in degrees*1e7
const uint8_t nb_waypoint
bool ned_initialized_i
true if local int coordinate frame is initialsed
struct LtpDef_i ned_origin_i
Definition of the local (flat earth) coordinate system.
void waypoint_set_enu_i(uint8_t wp_id, struct EnuCoor_i *enu)
void waypoint_clear_global_flag(uint8_t wp_id)
void waypoint_globalize(uint8_t wp_id)
update global LLA coordinates from its ENU coordinates
vector in East North Up coordinates
API to get/set the generic vehicle states.
Common code for AP and FBW telemetry.
void waypoint_set_here_2d(uint8_t wp_id)
set waypoint to current horizontal location without modifying altitude
struct EnuCoor_i enu_i
with INT32_POS_FRAC
bool waypoint_is_global(uint8_t wp_id)
#define ENU_BFP_OF_REAL(_o, _i)
void waypoint_set_enu(uint8_t wp_id, struct EnuCoor_f *enu)
Set local ENU waypoint coordinates.
#define POS_FLOAT_OF_BFP(_ai)
void lla_of_ecef_i(struct LlaCoor_i *out, struct EcefCoor_i *in)
Convert a ECEF to LLA.
uint8_t flags
bitmask encoding valid representations and if local or global
static struct EnuCoor_i * stateGetPositionEnu_i(void)
Get position in local ENU coordinates (int).
void enu_of_lla_point_i(struct EnuCoor_i *enu, struct LtpDef_i *def, struct LlaCoor_i *lla)
Convert a point from LLA to local ENU.
struct LlaCoor_i * waypoint_get_lla(uint8_t wp_id)
Get LLA coordinates of waypoint.
void waypoints_localize_all(void)
update local ENU coordinates of global waypoints
int32_t lat
in degrees*1e7
void waypoint_localize(uint8_t wp_id)
update local ENU coordinates from its LLA coordinates
void waypoints_init(void)
initialize global and local waypoints
static struct LlaCoor_i * stateGetPositionLla_i(void)
Get position in LLA coordinates (int).
void waypoint_set_lla(uint8_t wp_id, struct LlaCoor_i *lla)