Paparazzi UAS  v6.3_unstable
Paparazzi is a free software Unmanned Aircraft System.
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 Freek van Tienen <>
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
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  * <>.
19  */
26 #ifndef TARGET_POS_H
27 #define TARGET_POS_H
29 #include "std.h"
30 #include "math/pprz_geodetic_int.h"
33 struct target_pos_t {
34  bool valid;
37  struct LlaCoor_i lla;
38  float ground_speed;
39  float course;
40  float heading;
41  float climb;
42 };
45  float heading;
46  float distance;
47  float height;
48 };
50 struct target_t {
51  struct target_pos_t pos;
52  struct target_offset_t offset;
55  bool integrate_xy;
56  bool integrate_z;
57  struct LlaCoor_i gps_lla;
58 };
60 extern struct target_t target;
61 extern void target_pos_init(void);
62 extern void target_parse_target_pos(uint8_t *buf);
63 extern bool target_get_pos(struct NedCoor_f *pos, float *heading);
64 extern bool target_get_vel(struct NedCoor_f *vel);
65 extern bool target_pos_set_current_offset(float unk);
67 #endif
vector in Latitude, Longitude and Altitude
Paparazzi floating point math for geodetic calculations.
vector in North East Down coordinates Units: meters
Paparazzi fixed point math for geodetic calculations.
bool target_get_pos(struct NedCoor_f *pos, float *heading)
Get the current target position (NED) and heading.
Definition: target_pos.c:142
struct target_t target
Definition: target_pos.c:64
float height
Target offset height.
Definition: target_pos.h:47
float course
Ground course of the target [deg].
Definition: target_pos.h:39
uint32_t recv_time
Time of when the target position message was received [msec].
Definition: target_pos.h:35
void target_parse_target_pos(uint8_t *buf)
Receive a TARGET_POS message from the ground.
Definition: target_pos.c:121
float ground_speed
Ground speed of the target [m/s].
Definition: target_pos.h:38
float heading
Target offset heading.
Definition: target_pos.h:45
struct LlaCoor_i lla
Lat, lon and altitude position of the target.
Definition: target_pos.h:37
struct target_pos_t pos
The target position message.
Definition: target_pos.h:51
float distance
Target offset distance.
Definition: target_pos.h:46
uint32_t tow
Time of week of the target position measurement.
Definition: target_pos.h:36
void target_pos_init(void)
Definition: target_pos.c:99
bool integrate_z
Enable integration of the position in Z (Up) frame.
Definition: target_pos.h:56
uint32_t rtk_timeout
RTK message timeout [msec].
Definition: target_pos.h:54
float climb
Climb speed, z-up [m/s].
Definition: target_pos.h:41
struct LlaCoor_i gps_lla
GPS LLA position.
Definition: target_pos.h:57
struct target_offset_t offset
The target offset relative to ground heading.
Definition: target_pos.h:52
bool valid
If the data of the target position is valid.
Definition: target_pos.h:34
uint32_t target_pos_timeout
Ground target position message timeout [msec].
Definition: target_pos.h:53
bool integrate_xy
Enable integration of the position in X-Y (North/East) frame.
Definition: target_pos.h:55
bool target_get_vel(struct NedCoor_f *vel)
Get the current target velocity (NED)
Definition: target_pos.c:191
float heading
Heading of the target [deg].
Definition: target_pos.h:40
bool target_pos_set_current_offset(float unk)
Set the current measured distance and heading as offset.
Definition: target_pos.c:209
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
Definition: vl53l1_types.h:78
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
Definition: vl53l1_types.h:98
float heading
Definition: wedgebug.c:258