30 #include "generated/airframe.h"
31 #include "generated/flight_plan.h"
33 #if defined(ROTORCRAFT_FIRMWARE)
37 #define MAX_BUF_LEN 50
47 int32_t belat = __builtin_bswap32(lat);
49 buf[1] =
sizeof(belat);
50 memcpy(buf + 2, &belat,
sizeof(belat));
51 return sizeof(belat) + 2;
57 int32_t belon = __builtin_bswap32(lon);
59 buf[1] =
sizeof(belon);
60 memcpy(buf + 2, &belon,
sizeof(belon));
61 return sizeof(belon) + 2;
67 int16_t bealt = __builtin_bswap16(alt);
69 buf[1] =
sizeof(bealt);
70 memcpy(buf + 2, &bealt,
sizeof(bealt));
71 return sizeof(bealt) + 2;
78 buf[1] =
sizeof(speed);
79 memcpy(buf + 2, &speed,
sizeof(speed));
80 return sizeof(speed) + 2;
87 if (route_normalized >= 0) {
90 route = (
uint16_t)(360 + route_normalized);
92 uint16_t beroute = __builtin_bswap16(route);
94 buf[1] =
sizeof(beroute);
95 memcpy(buf + 2, &beroute,
sizeof(beroute));
96 return sizeof(beroute) + 2;
102 #if defined(FIXEDWING_FIRMWARE)
114 ptr_home_lla_i = &home_lla_i;
117 #elif defined(ROTORCRAFT_FIRMWARE)
120 #error Not a fixedwing or a rotorcraft, not yet supported
125 int32_t belat_home = __builtin_bswap32(lat_home);
126 int32_t belon_home = __builtin_bswap32(lon_home);
130 buf[
offset++] =
sizeof(belat_home);
131 memcpy(buf +
offset, &belat_home,
sizeof(belat_home));
132 offset +=
sizeof(belat_home);
135 buf[
offset++] =
sizeof(belon_home);
136 memcpy(buf +
offset, &belon_home,
sizeof(belon_home));
137 offset +=
sizeof(belon_home);
149 #if defined(FIXEDWING_FIRMWARE)
151 #elif defined(ROTORCRAFT_FIRMWARE)
154 #error "firmware unsupported!"
176 for (
int i = 1; i <
offset; i++) {
struct pprz_autopilot autopilot
Global autopilot structure.
bool autopilot_in_flight(void)
get in_flight flag
bool launch
request launch
struct point waypoints[NB_WAYPOINT]
size == nb_waypoint, waypoint 0 is a dummy waypoint
static const float offset[]
static int put_lon(uint8_t *buf)
void e_identification_fr_init()
static int put_lat_lon_home(uint8_t *buf)
static int put_lat(uint8_t *buf)
static int put_horizontal_speed(uint8_t *buf)
static int put_route(uint8_t *buf)
bool e_identification_started
void e_identification_fr_periodic()
static struct uart_periph * dev
static int put_alt(uint8_t *buf)
struct GpsState gps
global GPS state
Device independent GPS code (interface)
int32_t hmsl
height above mean sea level (MSL) in mm
int32_t lat
in degrees*1e7
int32_t lon
in degrees*1e7
#define LLA_BFP_OF_REAL(_o, _i)
vector in Latitude, Longitude and Altitude
static struct LlaCoor_i * stateGetPositionLla_i(void)
Get position in LLA coordinates (int).
static float stateGetHorizontalSpeedNorm_f(void)
Get norm of horizontal ground speed (float).
static float stateGetHorizontalSpeedDir_f(void)
Get dir of horizontal ground speed (float).
struct LlaCoor_i * waypoint_get_lla(uint8_t wp_id)
Get LLA coordinates of waypoint.
void lla_of_utm_f(struct LlaCoor_f *lla, struct UtmCoor_f *utm)
float alt
in meters (above WGS84 reference ellipsoid or above MSL)
uint8_t zone
UTM zone number.
vector in Latitude, Longitude and Altitude
position in UTM coordinates Units: meters
API to get/set the generic vehicle states.
void WEAK uart_put_buffer(struct uart_periph *p, long fd, const uint8_t *data, uint16_t len)
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
int int32_t
Typedef defining 32 bit int type.
short int16_t
Typedef defining 16 bit short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.