35 #ifndef TARGET_POS_TIMEOUT
36 #define TARGET_POS_TIMEOUT 5000
40 #ifndef TARGET_RTK_TIMEOUT
41 #define TARGET_RTK_TIMEOUT 1000
44 #ifndef TARGET_OFFSET_HEADING
45 #define TARGET_OFFSET_HEADING 180.0
48 #ifndef TARGET_OFFSET_DISTANCE
49 #define TARGET_OFFSET_DISTANCE 12.0
52 #ifndef TARGET_OFFSET_HEIGHT
53 #define TARGET_OFFSET_HEIGHT -1.2
56 #ifndef TARGET_INTEGRATE_XY
57 #define TARGET_INTEGRATE_XY true
60 #ifndef TARGET_INTEGRATE_Z
61 #define TARGET_INTEGRATE_Z false
82 #if PERIODIC_TELEMETRY
86 pprz_msg_send_TARGET_POS_INFO(trans,
dev, AC_ID,
102 #if PERIODIC_TELEMETRY
111 uint32_t stamp __attribute__((unused)),
124 if(DL_TARGET_POS_ac_id(buf) != AC_ID)
148 struct NedCoor_i target_pos_cm, drone_pos_cm;
156 pos->
x = (target_pos_cm.
x - drone_pos_cm.
x) * 0.01;
157 pos->
y = (target_pos_cm.
y - drone_pos_cm.
y) * 0.01;
158 pos->
z = (target_pos_cm.
z - drone_pos_cm.
z) * 0.01;
170 pos->
x = pos->
x + vel.
x * time_diff;
171 pos->
y = pos->
y + vel.
y * time_diff;
175 pos->
z = pos->
z + vel.
z * time_diff;
220 pos.
x = target_pos_cm.
x * 0.01;
221 pos.
y = target_pos_cm.
y * 0.01;
222 pos.
z = target_pos_cm.
z * 0.01;
Main include for ABI (AirBorneInterface).
#define ABI_BROADCAST
Broadcast address.
Event structure to store callbacks in a linked list.
uint32_t get_sys_time_msec(void)
Get the time in milliseconds since startup.
uint32_t gps_tow_from_sys_ticks(uint32_t sys_ticks)
Convert time in sys_time ticks to GPS time of week.
struct LlaCoor_i lla_pos
position in LLA (lat,lon: deg*1e7; alt: mm over ellipsoid)
data structure for GPS information
int32_t lat
in degrees*1e7
int32_t alt
in millimeters above WGS84 reference ellipsoid
int32_t lon
in degrees*1e7
void ned_of_lla_point_i(struct NedCoor_i *ned, struct LtpDef_i *def, struct LlaCoor_i *lla)
Convert a point from LLA to local NED.
vector in North East Down coordinates
bool ned_initialized_i
true if local int coordinate frame is initialsed
static struct LtpDef_i * stateGetNedOrigin_i(void)
Get the coordinate NED frame origin (int)
static struct NedCoor_f * stateGetPositionNed_f(void)
Get position in local NED coordinates (float).
vector in North East Down coordinates Units: meters
API to get/set the generic vehicle states.
static const struct usb_device_descriptor dev
volatile uint32_t nb_tick
SYS_TIME_TICKS since startup.
bool target_get_pos(struct NedCoor_f *pos, float *heading)
Get the current target position (NED) and heading.
static void gps_cb(uint8_t sender_id, uint32_t stamp, struct GpsState *gps_s)
#define TARGET_OFFSET_HEIGHT
void target_parse_target_pos(uint8_t *buf)
Receive a TARGET_POS message from the ground.
static void send_target_pos_info(struct transport_tx *trans, struct link_device *dev)
#define TARGET_OFFSET_HEADING
#define TARGET_POS_TIMEOUT
#define TARGET_INTEGRATE_Z
#define TARGET_OFFSET_DISTANCE
#define TARGET_INTEGRATE_XY
void target_pos_init(void)
#define TARGET_RTK_TIMEOUT
bool target_get_vel(struct NedCoor_f *vel)
Get the current target velocity (NED)
bool target_pos_set_current_offset(float unk)
Set the current measured distance and heading as offset.
float height
Target offset height.
float course
Ground course of the target [deg].
uint32_t recv_time
Time of when the target position message was received [msec].
float ground_speed
Ground speed of the target [m/s].
float heading
Target offset heading.
struct LlaCoor_i lla
Lat, lon and altitude position of the target.
struct target_pos_t pos
The target position message.
float distance
Target offset distance.
uint32_t tow
Time of week of the target position measurement.
bool integrate_z
Enable integration of the position in Z (Up) frame.
float climb
Climb speed, z-up [m/s].
struct LlaCoor_i gps_lla
GPS LLA position.
struct target_offset_t offset
The target offset relative to ground heading.
bool valid
If the data of the target position is valid.
uint32_t target_pos_timeout
Ground target position message timeout [msec].
bool integrate_xy
Enable integration of the position in X-Y (North/East) frame.
float heading
Heading of the target [deg].
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.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.