Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
traffic_info.c
Go to the documentation of this file.
1/*
2 * Copyright (C) Pascal Brisset, Antoine Drouin (2008), Kirk Scheper (2016)
3 *
4 * This file is part of paparazzi
5 *
6 * paparazzi is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * paparazzi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with paparazzi; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
19 */
28
29#include "generated/airframe.h" // AC_ID
30#include "generated/flight_plan.h" // NAV_MSL0
31
34#include "pprzlink/dl_protocol.h" // datalink messages
35#include "pprzlink/messages.h" // telemetry messages
36
37#include "state.h"
40
41#if TRAFFIC_INFO_USE_LOG
43#if !USE_CHIBIOS_RTOS
44static FILE* pprzLogFile = NULL;
45
46/* Set the default log path to bebop storage */
47#ifndef TRAFFIC_INFO_FILE_PATH
48#define TRAFFIC_INFO_FILE_PATH /data/ftp/internal_000/acinfo
49#endif
50
51#endif // !USE_CHIBIOS_RTOS
52#endif // TRAFFIC_INFO_USE_LOG
53
54/* number of ac being tracked */
56/* index of ac in the list of traffic info aircraft (ti_acs) */
58/* container for available traffic info */
60
61/* Geoid height (msl) over ellipsoid [mm] */
63
64/* Send ACINFO_LLA message from the datalink class */
65static void send_acinfo_lla(struct transport_tx *trans, struct link_device *dev)
66{
68 struct LlaCoor_i* lla = stateGetPositionLla_i();
69 uint32_t itow = gps.tow;
71 int16_t climb = (int16_t)(stateGetSpeedEnu_f()->z*10.f);
72 int32_t alt = (int32_t)(lla->alt/10);
73 uint8_t ac_id = AC_ID;
74
75 // broadcast GPS message
76 struct pprzlink_msg msg;
77 msg.trans = trans;
78 msg.dev = dev;
79 msg.sender_id = AC_ID;
80 msg.receiver_id = PPRZLINK_MSG_BROADCAST;
81 msg.component_id = 0;
83 &course,
84 &lla->lat, &lla->lon, &alt,
85 &itow, &speed, &climb, &ac_id);
86
87#if TRAFFIC_INFO_USE_LOG
88 struct LlaCoor_f* lla_f = stateGetPositionLla_f();
89 struct EnuCoor_f* enu_f = stateGetPositionEnu_f();
91 LogWrite(pprzLogFile, "S,%d,%d,%.7f,%.7f,%.3f,%.3f,%.3f,%.3f,%d,0\n", // 0 at the end to have same length than receive log lines
92 msg.sender_id, msg.receiver_id,
93 DegOfRad(lla_f->lat), DegOfRad(lla_f->lon), lla_f->alt,
94 enu_f->x, enu_f->y, enu_f->z,
95 itow);
96 }
97#endif
98}
99
101{
103
104 ti_acs_id[0] = 0; // ground station
105 ti_acs_id[AC_ID] = 1;
107 ti_acs_idx = 2;
108
110
111#if PERIODIC_TELEMETRY
113#endif
114}
115
129
131{
133 uint8_t msg_id = IdOfPprzMsg(buf);
135 uint32_t itow = 0;
136
137 /* handle telemetry message */
138#if PPRZLINK_DEFAULT_VER == 2
140#else
141 if (sender_id > 0) {
142#endif
143 switch (msg_id) {
144 case DL_GPS_SMALL: {
146
147 // decode compressed values
148 int16_t course = (int16_t)((multiplex_speed >> 21) & 0x7FF); // bits 31-21 course in decideg
149 if (course & 0x400) {
150 course |= 0xF800; // fix for twos complements
151 }
152 course *= 2; // scale course by resolution
153 int16_t gspeed = (int16_t)((multiplex_speed >> 10) & 0x7FF); // bits 20-10 ground speed cm/s
154 if (gspeed & 0x400) {
155 gspeed |= 0xF800; // fix for twos complements
156 }
157 int16_t climb = (int16_t)(multiplex_speed & 0x3FF); // bits 9-0 z climb speed in cm/s
158 if (climb & 0x200) {
159 climb |= 0xFC00; // fix for twos complements
160 }
162
164 DL_GPS_SMALL_lat(buf),
165 DL_GPS_SMALL_lon(buf),
166 (int32_t)DL_GPS_SMALL_alt(buf) * 10,
167 course,
168 gspeed,
169 climb,
170 itow);
171 }
172 break;
173 case DL_GPS: {
174 itow = DL_GPS_itow(buf);
176 DL_GPS_utm_east(buf),
177 DL_GPS_utm_north(buf),
178 DL_GPS_alt(buf),
179 DL_GPS_utm_zone(buf),
180 DL_GPS_course(buf),
181 DL_GPS_speed(buf),
182 DL_GPS_climb(buf),
183 itow);
184 }
185 break;
186 case DL_GPS_LLA: {
187 itow = DL_GPS_LLA_itow(buf);
189 DL_GPS_LLA_lat(buf),
190 DL_GPS_LLA_lon(buf),
191 DL_GPS_LLA_alt(buf),
193 DL_GPS_LLA_speed(buf),
194 DL_GPS_LLA_climb(buf),
195 itow);
196 }
197 break;
198 case DL_GPS_INT: {
199 struct LtpDef_i def = {0};
200 struct EcefCoor_i ecef_pos = {
201 .x = DL_GPS_INT_ecef_x(buf),
202 .y = DL_GPS_INT_ecef_y(buf),
203 .z = DL_GPS_INT_ecef_z(buf),
204 };
205 struct EcefCoor_i ecef_vel = {
206 .x = DL_GPS_INT_ecef_xd(buf),
207 .y = DL_GPS_INT_ecef_yd(buf),
208 .z = DL_GPS_INT_ecef_zd(buf),
209 };
210 struct NedCoor_i ned_vel;
211 ltp_def_from_ecef_i(&def, &ecef_pos);
212 ned_of_ecef_vect_i(&ned_vel, &def, &ecef_vel);
213 struct NedCoor_f ned_vel_f;
215 int16_t course = (int16_t)(10.f * DegOfRad(atan2f(ned_vel_f.y, ned_vel_f.x))); // decideg
217 int16_t climb = (int16_t)(CM_OF_M(-ned_vel_f.z));
218 itow = DL_GPS_INT_tow(buf);
220 DL_GPS_INT_lat(buf),
221 DL_GPS_INT_lon(buf),
222 DL_GPS_INT_alt(buf),
223 course,
224 gspeed,
225 climb,
226 itow);
227 }
228 break;
229 default:
230 return FALSE;
231 }
232 /* handle datalink message */
233 } else if (class_id == DL_datalink_CLASS_ID) {
234 switch (msg_id) {
235 case DL_ACINFO: {
236 sender_id = DL_ACINFO_ac_id(buf); // may overwrite GCS id
237 itow = DL_ACINFO_itow(buf);
241 DL_ACINFO_alt(buf) * 10,
243 DL_ACINFO_course(buf),
244 DL_ACINFO_speed(buf),
245 DL_ACINFO_climb(buf),
246 itow);
247 }
248 break;
249 case DL_ACINFO_LLA: {
250 sender_id = DL_ACINFO_LLA_ac_id(buf); // may overwrite GCS id
251 itow = DL_ACINFO_LLA_itow(buf);
255 DL_ACINFO_LLA_alt(buf) * 10,
259 itow);
260 }
261 break;
262 default:
263 return FALSE;
264 }
265 } else {
266 return FALSE; // unsupported class
267 }
268#if TRAFFIC_INFO_USE_LOG
272 LogWrite(pprzLogFile, "R,%d,%d,%.7f,%.7f,%.3f,%.3f,%.3f,%.3f,%d,%d\n",
274 DegOfRad(lla_f->lat), DegOfRad(lla_f->lon), lla_f->alt,
275 enu_f->x, enu_f->y, enu_f->z,
276 itow, gps.tow);
277 }
278#endif
279 return TRUE;
280}
281
282
284 uint16_t gspeed, uint16_t climb, uint32_t itow)
285{
286 if (ti_acs_idx < NB_ACS) {
287 if (id > 0 && ti_acs_id[id] == 0) { // new aircraft id
288 ti_acs_id[id] = ti_acs_idx++;
289 ti_acs[ti_acs_id[id]].ac_id = id;
290 }
291
292 if (itow < ti_acs[ti_acs_id[id]].itow) {
293 return; // don't update on old data
294 }
295
296 ti_acs[ti_acs_id[id]].status = 0;
297
299 if (utm_zone == my_zone) {
302 ti_acs[ti_acs_id[id]].utm_pos_i.alt = alt;
305
306 } else { // store other uav in utm extended zone
307 struct UtmCoor_i utm = {.east = utm_east, .north = utm_north, .alt = alt, .zone = utm_zone};
308 struct LlaCoor_i lla;
309 lla_of_utm_i(&lla, &utm);
310 LLA_COPY(ti_acs[ti_acs_id[id]].lla_pos_i, lla);
312
313 utm.zone = my_zone;
314 utm_of_lla_i(&utm, &lla);
315
316 UTM_COPY(ti_acs[ti_acs_id[id]].utm_pos_i, utm);
318 }
319
321 ti_acs[ti_acs_id[id]].gspeed = MOfCm(gspeed);
322 ti_acs[ti_acs_id[id]].climb = MOfCm(climb);
324
325 ti_acs[ti_acs_id[id]].itow = itow;
326 }
327}
328
330 int16_t course, uint16_t gspeed, int16_t climb, uint32_t itow)
331{
332 if (ti_acs_idx < NB_ACS) {
333 if (id > 0 && ti_acs_id[id] == 0) {
334 ti_acs_id[id] = ti_acs_idx++;
335 ti_acs[ti_acs_id[id]].ac_id = id;
336 }
337
338 if (itow < ti_acs[ti_acs_id[id]].itow) {
339 return; // don't update on old data
340 }
341
342 ti_acs[ti_acs_id[id]].status = 0;
343
344 struct LlaCoor_i lla = {.lat = lat, .lon = lon, .alt = alt};
345 LLA_COPY(ti_acs[ti_acs_id[id]].lla_pos_i, lla);
347
349 ti_acs[ti_acs_id[id]].gspeed = MOfCm(gspeed);
350 ti_acs[ti_acs_id[id]].climb = MOfCm(climb);
352
353 ti_acs[ti_acs_id[id]].itow = itow;
354 }
355}
356
357/* Conversion funcitons for computing ac position in requested reference frame from
358 * any other available reference frame
359 */
360
361/* compute UTM position of aircraft with ac_id (int) */
363{
364 uint8_t ac_nr = ti_acs_id[ac_id];
366 {
367 return;
368 }
369
370 /* LLA_i -> UTM_i is more accurate than from UTM_f */
372 {
373 // use my zone as reference, i.e zone extend
375 utm_of_lla_i(&ti_acs[ac_nr].utm_pos_i, &ti_acs[ac_nr].lla_pos_i);
379 {
380 UTM_BFP_OF_REAL(ti_acs[ac_nr].utm_pos_i, ti_acs[ac_nr].utm_pos_f);
382 {
383 // use my zone as reference, i.e zone extend
385 utm_of_lla_f(&ti_acs[ac_nr].utm_pos_f, &ti_acs[ac_nr].lla_pos_f);
389 UTM_BFP_OF_REAL(ti_acs[ac_nr].utm_pos_i, ti_acs[ac_nr].utm_pos_f);
390 }
392}
393
394/* compute LLA position of aircraft with ac_id (int) */
396{
397 uint8_t ac_nr = ti_acs_id[ac_id];
399 {
400 return;
401 }
402
404 {
405 LLA_BFP_OF_REAL(ti_acs[ac_nr].lla_pos_i, ti_acs[ac_nr].lla_pos_f);
407 {
408 lla_of_utm_i(&ti_acs[ac_nr].lla_pos_i, &ti_acs[ac_nr].utm_pos_i);
412 {
413 lla_of_utm_f(&ti_acs[ac_nr].lla_pos_f, &ti_acs[ac_nr].utm_pos_f);
417 LLA_BFP_OF_REAL(ti_acs[ac_nr].lla_pos_i, ti_acs[ac_nr].lla_pos_f);
418 }
420}
421
422/* compute ENU position of aircraft with ac_id (int) */
424{
425 uint8_t ac_nr = ti_acs_id[ac_id];
427 {
428 return;
429 }
430
432 {
433 ENU_BFP_OF_REAL(ti_acs[ac_nr].enu_pos_i, ti_acs[ac_nr].enu_pos_f);
434 }
435 else if (state.ned_initialized_i)
436 {
438 {
439 struct EnuCoor_i enu;
441 // convert ENU pos from cm to BFP with INT32_POS_FRAC
442 enu.x = POS_BFP_OF_REAL(enu.x) / 100;
443 enu.y = POS_BFP_OF_REAL(enu.y) / 100;
444 enu.z = POS_BFP_OF_REAL(enu.z) / 100;
447 {
450 ENU_BFP_OF_REAL(ti_acs[ac_nr].enu_pos_i, ti_acs[ac_nr].enu_pos_f)
451 }
452 } else if (state.utm_initialized_f)
453 {
454 /* if utm origin is initialized we use the ENU = UTM - UTM_ORIGIN as in state to facilitate comparison */
457 ENU_BFP_OF_REAL(ti_acs[ac_nr].enu_pos_i, ti_acs[ac_nr].enu_pos_f);
458 }
460}
461
462/* compute UTM position of aircraft with ac_id (float) */
464{
465 uint8_t ac_nr = ti_acs_id[ac_id];
467 {
468 return;
469 }
470
472 {
473 UTM_FLOAT_OF_BFP(ti_acs[ac_nr].utm_pos_f, ti_acs[ac_nr].utm_pos_i);
475 {
476 // use my zone as reference, i.e zone extend
478 utm_of_lla_i(&ti_acs[ac_nr].utm_pos_i, &ti_acs[ac_nr].lla_pos_i);
482 UTM_FLOAT_OF_BFP(ti_acs[ac_nr].utm_pos_f, ti_acs[ac_nr].utm_pos_i);
484 {
485 /* not very accurate with float ~5cm */
487 utm_of_lla_f(&ti_acs[ac_nr].utm_pos_f, &ti_acs[ac_nr].lla_pos_f);
490 }
492}
493
494/* compute LLA position of aircraft with ac_id (float) */
496{
497 uint8_t ac_nr = ti_acs_id[ac_id];
499 {
500 return;
501 }
502
504 {
505 LLA_FLOAT_OF_BFP(ti_acs[ac_nr].lla_pos_f, ti_acs[ac_nr].lla_pos_i);
507 {
508 lla_of_utm_i(&ti_acs[ac_nr].lla_pos_i, &ti_acs[ac_nr].utm_pos_i);
512 LLA_FLOAT_OF_BFP(ti_acs[ac_nr].lla_pos_f, ti_acs[ac_nr].lla_pos_i);
514 {
515 lla_of_utm_f(&ti_acs[ac_nr].lla_pos_f, &ti_acs[ac_nr].utm_pos_f);
518 }
520}
521
522/* compute ENU position of aircraft with ac_id (float) */
524{
525 uint8_t ac_nr = ti_acs_id[ac_id];
527 {
528 return;
529 }
530
532 {
533 ENU_FLOAT_OF_BFP(ti_acs[ac_nr].enu_pos_f, ti_acs[ac_nr].enu_pos_i);
534 }
535 else if (state.ned_initialized_i)
536 {
538 {
541 {
542 struct EnuCoor_i enu;
544 // convert ENU pos from cm to BFP with INT32_POS_FRAC
545 enu.x = POS_BFP_OF_REAL(enu.x) / 100;
546 enu.y = POS_BFP_OF_REAL(enu.y) / 100;
547 enu.z = POS_BFP_OF_REAL(enu.z) / 100;
550 ENU_FLOAT_OF_BFP(ti_acs[ac_nr].enu_pos_f, ti_acs[ac_nr].enu_pos_i);
551 }
552 } else if (state.utm_initialized_f)
553 {
554 /* if utm origin is initialized we use the ENU = UTM - UTM_ORIGIN as in state to facilitate comparison */
556 }
558}
559
560/* compute ENU velocity of aircraft with ac_id (int) */
581
582/* compute ENU position of aircraft with ac_id (float) */
601
603{
604#if TRAFFIC_INFO_USE_LOG
606#endif
607}
608
610{
611#if TRAFFIC_INFO_USE_LOG
614 }
615#endif
616}
617
static int16_t course[3]
static uint8_t status
static struct uart_periph * dev
struct GpsState gps
global GPS state
Definition gps.c:74
uint32_t gps_tow_from_sys_ticks(uint32_t sys_ticks)
Convert time in sys_time ticks to GPS time of week.
Definition gps.c:419
uint32_t tow
GPS time of week in ms.
Definition gps.h:112
int32_t hmsl
height above mean sea level (MSL) in mm
Definition gps.h:97
struct LlaCoor_i lla_pos
position in LLA (lat,lon: deg*1e7; alt: mm over ellipsoid)
Definition gps.h:95
#define GPS_VALID_POS_LLA_BIT
Definition gps.h:49
#define GPS_VALID_HMSL_BIT
Definition gps.h:53
uint8_t valid_fields
bitfield indicating valid fields (GPS_VALID_x_BIT)
Definition gps.h:91
struct LlaCoor_f lla_pos_f
Position in Latitude, Longitude and Altitude.
struct EnuCoor_f enu_vel_f
speed in North East Down coordinates
uint8_t ac_id
uint32_t itow
ms
float climb
m/s
struct LlaCoor_i lla_pos_i
Position in Latitude, Longitude and Altitude.
float gspeed
m/s
struct UtmCoor_i utm_pos_i
Position in UTM coordinates.
uint16_t status
Holds the status bits for all acinfo position and velocity representations.
struct UtmCoor_f utm_pos_f
Position in UTM coordinates.
float course
rad
struct EnuCoor_i enu_pos_i
Position in North East Down coordinates.
#define AC_INFO_VEL_ENU_I
bool parse_acinfo_dl(uint8_t *buf)
Parse all datalink or telemetry messages that contain global position of other acs Messages currently...
#define AC_INFO_POS_LLA_I
uint8_t ti_acs_idx
#define AC_INFO_VEL_ENU_F
void set_ac_info_utm(uint8_t id, uint32_t utm_east, uint32_t utm_north, uint32_t alt, uint8_t utm_zone, uint16_t course, uint16_t gspeed, uint16_t climb, uint32_t itow)
Set Aircraft info.
void acInfoCalcPositionUtm_f(uint8_t ac_id)
void traffic_info_log_stop(void)
#define AC_INFO_POS_LLA_F
void acInfoCalcPositionEnu_f(uint8_t ac_id)
void acInfoCalcVelocityEnu_f(uint8_t ac_id)
void acInfoCalcPositionUtm_i(uint8_t ac_id)
void acInfoCalcPositionLla_i(uint8_t ac_id)
void acInfoCalcPositionLla_f(uint8_t ac_id)
void set_ac_info_lla(uint8_t id, int32_t lat, int32_t lon, int32_t alt, int16_t course, uint16_t gspeed, int16_t climb, uint32_t itow)
Set Aircraft info.
static struct LlaCoor_i * acInfoGetPositionLla_i(uint8_t ac_id)
Get position from LLA coordinates (int).
#define AC_INFO_POS_ENU_F
#define AC_INFO_POS_UTM_F
#define AC_INFO_POS_UTM_I
#define AC_INFO_POS_ENU_I
void traffic_info_init(void)
#define AC_INFO_VEL_LOCAL_F
struct acInfo ti_acs[NB_ACS]
uint8_t ti_acs_id[NB_ACS_ID]
static struct LlaCoor_f * acInfoGetPositionLla_f(uint8_t ac_id)
Get position from LLA coordinates (float).
static struct EnuCoor_f * acInfoGetPositionEnu_f(uint8_t ac_id)
Get position in local ENU coordinates (float).
void acInfoCalcPositionEnu_i(uint8_t ac_id)
void acInfoCalcVelocityEnu_i(uint8_t ac_id)
static struct UtmCoor_f * acInfoGetPositionUtm_f(uint8_t ac_id)
Get position from UTM coordinates (float).
void traffic_info_log_start(void)
#define FLOAT_VECT2_NORM(_v)
#define SPEEDS_BFP_OF_REAL(_ef, _ei)
#define SPEEDS_FLOAT_OF_BFP(_ef, _ei)
#define POS_BFP_OF_REAL(_af)
#define LLA_COPY(_pos1, _pos2)
#define ENU_OF_UTM_DIFF(_pos, _utm1, _utm2)
#define UTM_COPY(_u1, _u2)
int32_t lat
in degrees*1e7
int32_t alt
in millimeters (above WGS84 reference ellipsoid or above MSL)
int32_t alt
in millimeters above WGS84 reference ellipsoid
uint8_t zone
UTM zone number.
int32_t x
in centimeters
int32_t east
in centimeters
int32_t lon
in degrees*1e7
int32_t north
in centimeters
#define ENU_FLOAT_OF_BFP(_o, _i)
void lla_of_utm_i(struct LlaCoor_i *lla, struct UtmCoor_i *utm)
Convert a UTM to LLA.
#define ENU_BFP_OF_REAL(_o, _i)
#define LLA_BFP_OF_REAL(_o, _i)
void ltp_def_from_ecef_i(struct LtpDef_i *def, struct EcefCoor_i *ecef)
#define UTM_BFP_OF_REAL(_o, _i)
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 ned_of_ecef_vect_i(struct NedCoor_i *ned, struct LtpDef_i *def, struct EcefCoor_i *ecef)
Rotate a vector from ECEF to NED.
#define CM_OF_M(_m)
#define VECT3_FLOAT_OF_CM(_o, _i)
#define LLA_FLOAT_OF_BFP(_o, _i)
void utm_of_lla_i(struct UtmCoor_i *utm, struct LlaCoor_i *lla)
Convert a LLA to UTM.
#define UTM_FLOAT_OF_BFP(_o, _i)
vector in EarthCenteredEarthFixed coordinates
vector in East North Up coordinates
vector in Latitude, Longitude and Altitude
definition of the local (flat earth) coordinate system
vector in North East Down coordinates
position in UTM coordinates
static int32_t wgs84_ellipsoid_to_geoid_i(int32_t lat, int32_t lon)
Get WGS84 ellipsoid/geoid separation.
struct State state
Definition state.c:36
static struct LlaCoor_f * stateGetPositionLla_f(void)
Get position in LLA coordinates (float).
Definition state.h:857
static struct LtpDef_f * stateGetNedOrigin_f(void)
Get the coordinate NED frame origin (float)
Definition state.h:566
static struct LlaCoor_i * stateGetPositionLla_i(void)
Get position in LLA coordinates (int).
Definition state.h:812
bool utm_initialized_f
True if utm origin (float) coordinate frame is initialsed.
Definition state.h:264
static struct UtmCoor_f * stateGetUtmOrigin_f(void)
Get the coordinate UTM frame origin (int)
Definition state.h:576
bool ned_initialized_i
true if local int coordinate frame is initialsed
Definition state.h:199
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
Definition state.h:848
static struct LtpDef_i * stateGetNedOrigin_i(void)
Get the coordinate NED frame origin (int)
Definition state.h:556
static float stateGetHorizontalSpeedNorm_f(void)
Get norm of horizontal ground speed (float).
Definition state.h:1076
static float stateGetHorizontalSpeedDir_f(void)
Get dir of horizontal ground speed (float).
Definition state.h:1085
static struct EnuCoor_f * stateGetSpeedEnu_f(void)
Get ground speed in local ENU coordinates (float).
Definition state.h:1058
uint8_t msg[10]
Buffer used for general comunication over SPI (out buffer)
static FILE * pprzLogFile
Generic definitions and tools for logging on ChibiOS or Linux.
#define LogOpen(_file, _path, _name)
#define LogFileIsOpen(_file)
#define LogWrite
#define LogClose(_file)
uint16_t foo
Definition main_demo5.c:58
void lla_of_utm_f(struct LlaCoor_f *lla, struct UtmCoor_f *utm)
void enu_of_lla_point_f(struct EnuCoor_f *enu, struct LtpDef_f *def, struct LlaCoor_f *lla)
void utm_of_lla_f(struct UtmCoor_f *utm, struct LlaCoor_f *lla)
float alt
in meters (normally above WGS84 reference ellipsoid)
float y
in meters
float x
in meters
float alt
in meters (above WGS84 reference ellipsoid or above MSL)
uint8_t zone
UTM zone number.
float lon
in radians
float lat
in radians
float z
in meters
vector in East North Up coordinates Units: meters
vector in Latitude, Longitude and Altitude
vector in North East Down coordinates Units: meters
Constants UTM (Mercator) projections.
WGS-84 Geoid Heights.
#define NB_ACS_ID
Definition rssi.c:35
#define NB_ACS
Definition rssi.c:38
API to get/set the generic vehicle states.
#define TRUE
Definition std.h:4
#define FALSE
Definition std.h:5
volatile uint32_t nb_tick
SYS_TIME_TICKS since startup.
Definition sys_time.h:74
int16_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint16_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Definition telemetry.c:51
Periodic telemetry system header (includes downlink utility and generated code).
#define DefaultPeriodic
Set default periodic telemetry.
Definition telemetry.h:66
static void send_acinfo_lla(struct transport_tx *trans, struct link_device *dev)
static void update_geoid_height(void)
Update estimate of the geoid height Requires an available hsml and/or lla measurement,...
int32_t geoid_height
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
int int32_t
Typedef defining 32 bit int type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
short int16_t
Typedef defining 16 bit short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.