|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
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++) {
int32_t lon
in degrees*1e7
static float stateGetHorizontalSpeedDir_f(void)
Get dir of horizontal ground speed (float).
#define LLA_BFP_OF_REAL(_o, _i)
static int put_alt(uint8_t *buf)
static struct LlaCoor_i * stateGetPositionLla_i(void)
Get position in LLA coordinates (int).
struct LlaCoor_i * waypoint_get_lla(uint8_t wp_id)
Get LLA coordinates of waypoint.
bool e_identification_started
void lla_of_utm_f(struct LlaCoor_f *lla, struct UtmCoor_f *utm)
struct point waypoints[NB_WAYPOINT]
size == nb_waypoint, waypoint 0 is a dummy waypoint
static struct uart_periph * dev
bool autopilot_in_flight(void)
get in_flight flag
int32_t lat
in degrees*1e7
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
Device independent GPS code (interface)
struct pprz_autopilot autopilot
Global autopilot structure.
static int put_horizontal_speed(uint8_t *buf)
float alt
in meters (above WGS84 reference ellipsoid or above MSL)
uint8_t zone
UTM zone number.
static int put_lat_lon_home(uint8_t *buf)
void e_identification_fr_init()
static int put_route(uint8_t *buf)
static int put_lon(uint8_t *buf)
static const float offset[]
static float stateGetHorizontalSpeedNorm_f(void)
Get norm of horizontal ground speed (float).
vector in Latitude, Longitude and Altitude
void uart_put_buffer(struct uart_periph *p, long fd, const uint8_t *data, uint16_t len)
Uart transmit buffer implementation.
position in UTM coordinates Units: meters
void e_identification_fr_periodic()
int32_t hmsl
height above mean sea level (MSL) in mm
static int put_lat(uint8_t *buf)
struct GpsState gps
global GPS state
bool launch
request launch
vector in Latitude, Longitude and Altitude