29 #include "generated/flight_plan.h"
34 #if PERIODIC_TELEMETRY
42 pprz_msg_send_WP_MOVED_ENU(trans,
dev, AC_ID,
53 struct EnuCoor_f wp_tmp_float[NB_WAYPOINT] = WAYPOINTS_ENU;
54 struct LlaCoor_i wp_tmp_lla_i[NB_WAYPOINT] = WAYPOINTS_LLA_WGS84;
56 bool is_global[NB_WAYPOINT] = WAYPOINTS_GLOBAL;
70 #if PERIODIC_TELEMETRY
194 &(new_pos->
y), &(new_pos->
z));
263 &lla->
lat, &lla->
lon, &hmsl);
320 &lla->
lat, &lla->
lon, &hmsl);
Common code for AP and FBW telemetry.
#define POS_FLOAT_OF_BFP(_ai)
#define POS_BFP_OF_REAL(_af)
int32_t lat
in degrees*1e7
int32_t hmsl
Height above mean sea level in mm.
int32_t alt
in millimeters above WGS84 reference ellipsoid
struct LlaCoor_i lla
Reference point in lla.
int32_t lon
in degrees*1e7
#define ENU_FLOAT_OF_BFP(_o, _i)
#define ENU_BFP_OF_REAL(_o, _i)
#define DEG_OF_EM7DEG(_r)
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.
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.
void lla_of_ecef_i(struct LlaCoor_i *out, struct EcefCoor_i *in)
Convert a ECEF to LLA.
vector in EarthCenteredEarthFixed coordinates
vector in East North Up coordinates
vector in Latitude, Longitude and Altitude
struct LtpDef_i ned_origin_i
Definition of the local (flat earth) coordinate system.
static struct LlaCoor_i * stateGetPositionLla_i(void)
Get position in LLA coordinates (int).
bool ned_initialized_i
true if local int coordinate frame is initialsed
static struct EnuCoor_i * stateGetPositionEnu_i(void)
Get position in local ENU coordinates (int).
void waypoint_copy(uint8_t wp_dest, uint8_t wp_src)
copy one waypoint to another, this includes all flags from the source waypoint
void waypoint_globalize(uint8_t wp_id)
update global LLA coordinates from its ENU coordinates
void waypoint_set_here_2d(uint8_t wp_id)
set waypoint to current horizontal location without modifying altitude
void waypoints_localize_all(void)
update local ENU coordinates of global waypoints
struct LlaCoor_i * waypoint_get_lla(uint8_t wp_id)
Get LLA coordinates of waypoint.
void waypoint_position_copy(uint8_t wp_dest, uint8_t wp_src)
void waypoint_move_xy_i(uint8_t wp_id, int32_t x, int32_t y)
bool waypoint_is_global(uint8_t wp_id)
float waypoint_get_lon_rad(uint8_t wp_id)
Get longitude of waypoint in rad.
float waypoint_get_alt(uint8_t wp_id)
Get altitude of waypoint in meters (above reference)
float waypoint_get_x(uint8_t wp_id)
Get X/East coordinate of waypoint in meters.
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
float waypoint_get_lon_deg(uint8_t wp_id)
Get longitude of waypoint in deg.
void waypoint_set_global_flag(uint8_t wp_id)
void waypoint_set_latlon(uint8_t wp_id, struct LlaCoor_i *lla)
set waypoint latitude/longitude without updating altitude
void waypoints_init(void)
initialize global and local waypoints
float waypoint_get_lla_alt(uint8_t wp_id)
float waypoint_get_lat_deg(uint8_t wp_id)
Get latitude of waypoint in deg.
void waypoint_move_enu_i(uint8_t wp_id, struct EnuCoor_i *new_pos)
struct EnuCoor_i * waypoint_get_enu_i(uint8_t wp_id)
Get ENU coordinates (integer)
float waypoint_get_y(uint8_t wp_id)
Get Y/North coordinate of waypoint in meters.
const uint8_t nb_waypoint
void waypoint_set_enu_i(uint8_t wp_id, struct EnuCoor_i *enu)
void waypoint_clear_global_flag(uint8_t wp_id)
void waypoint_set_lla(uint8_t wp_id, struct LlaCoor_i *lla)
void waypoint_set_alt_i(uint8_t wp_id, int32_t alt)
void waypoint_move_here_2d(uint8_t wp_id)
struct Waypoint waypoints[NB_WAYPOINT]
size == nb_waypoint, waypoint 0 is a dummy waypoint
void waypoint_localize(uint8_t wp_id)
update local ENU coordinates from its LLA coordinates
void waypoint_set_alt(uint8_t wp_id, float alt)
Set altitude of waypoint in meters (above reference)
static void send_wp_moved(struct transport_tx *trans, struct link_device *dev)
struct EnuCoor_f * waypoint_get_enu_f(uint8_t wp_id)
Get ENU coordinates (float)
void waypoint_move_lla(uint8_t wp_id, struct LlaCoor_i *lla)
float waypoint_get_lat_rad(uint8_t wp_id)
Get latitude of waypoint in rad.
void waypoint_set_enu(uint8_t wp_id, struct EnuCoor_f *enu)
Set local ENU waypoint coordinates.
uint8_t flags
bitmask encoding valid representations and if local or global
struct EnuCoor_i enu_i
with INT32_POS_FRAC
vector in East North Up coordinates Units: meters
API to get/set the generic vehicle states.
static const struct usb_device_descriptor dev
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Periodic telemetry system header (includes downlink utility and generated code).
#define DefaultPeriodic
Set default periodic telemetry.
int int32_t
Typedef defining 32 bit int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.