Paparazzi UAS  v6.3_unstable
Paparazzi is a free software Unmanned Aircraft System.
target_pos.c File Reference
#include "target_pos.h"
#include <math.h>
#include "modules/datalink/telemetry.h"
#include "modules/core/abi.h"
+ Include dependency graph for target_pos.c:

Go to the source code of this file.


#define TARGET_POS_TIMEOUT   5000
#define TARGET_RTK_TIMEOUT   1000
#define TARGET_INTEGRATE_XY   true
#define TARGET_INTEGRATE_Z   false


static void gps_cb (uint8_t sender_id, uint32_t stamp, struct GpsState *gps_s)
static void send_target_pos_info (struct transport_tx *trans, struct link_device *dev)
void target_pos_init (void)
void target_parse_target_pos (uint8_t *buf)
 Receive a TARGET_POS message from the ground. More...
bool target_get_pos (struct NedCoor_f *pos, float *heading)
 Get the current target position (NED) and heading. More...
bool target_get_vel (struct NedCoor_f *vel)
 Get the current target velocity (NED) More...
bool target_pos_set_current_offset (float unk)
 Set the current measured distance and heading as offset. More...


struct target_t target
static abi_event gps_ev

Detailed Description

Freek van Tienen Control a rotorcraft to follow at a defined distance from the target

Definition in file target_pos.c.

Macro Definition Documentation


#define TARGET_INTEGRATE_XY   true

Definition at line 56 of file target_pos.c.


#define TARGET_INTEGRATE_Z   false

Definition at line 60 of file target_pos.c.



Definition at line 48 of file target_pos.c.



Definition at line 44 of file target_pos.c.



Definition at line 52 of file target_pos.c.


#define TARGET_POS_TIMEOUT   5000

Definition at line 35 of file target_pos.c.


#define TARGET_RTK_TIMEOUT   1000

Definition at line 40 of file target_pos.c.

Function Documentation

◆ gps_cb()

static void gps_cb ( uint8_t  sender_id,
uint32_t stamp  ,
struct GpsState gps_s 

Definition at line 109 of file target_pos.c.

References LlaCoor_i::alt, target_t::gps_lla, LlaCoor_i::lat, GpsState::lla_pos, LlaCoor_i::lon, and target.

Referenced by target_pos_init().

+ Here is the caller graph for this function:

◆ send_target_pos_info()

static void send_target_pos_info ( struct transport_tx *  trans,
struct link_device *  dev 

◆ target_get_pos()

◆ target_get_vel()

bool target_get_vel ( struct NedCoor_f vel)

Get the current target velocity (NED)

Definition at line 191 of file target_pos.c.

References target_pos_t::climb, target_pos_t::course, get_sys_time_msec(), target_pos_t::ground_speed, State::ned_initialized_i, target_t::pos, target_pos_t::recv_time, state, target, target_t::target_pos_timeout, target_pos_t::valid, NedCoor_f::x, NedCoor_f::y, and NedCoor_f::z.

Referenced by target_get_pos().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ target_parse_target_pos()

void target_parse_target_pos ( uint8_t buf)

◆ target_pos_init()

void target_pos_init ( void  )

Definition at line 99 of file target_pos.c.

References ABI_BROADCAST, DefaultPeriodic, gps_cb(), gps_ev, register_periodic_telemetry(), and send_target_pos_info().

+ Here is the call graph for this function:

◆ target_pos_set_current_offset()

Variable Documentation

◆ gps_ev

abi_event gps_ev

Definition at line 78 of file target_pos.c.

Referenced by target_pos_init().

◆ target

struct target_t target
Initial value:
= {
.pos = {0},
.offset = {
.target_pos_timeout = TARGET_POS_TIMEOUT,
.rtk_timeout = TARGET_RTK_TIMEOUT,
.integrate_xy = TARGET_INTEGRATE_XY,
.integrate_z = TARGET_INTEGRATE_Z
Definition: target_pos.c:52
Definition: target_pos.c:44
Definition: target_pos.c:35
Definition: target_pos.c:60
Definition: target_pos.c:48
Definition: target_pos.c:56
Definition: target_pos.c:40

Definition at line 1 of file target_pos.c.

Referenced by georeference_run(), gps_cb(), lsm303d_spi_init(), mavlink_common_message_handler(), nav_eight(), nav_set_heading_towards(), px4flash_event(), recursive_least_squares(), send_target_pos_info(), target_get_pos(), target_get_vel(), target_parse_target_pos(), target_pos_set_current_offset(), and update_target_point().