Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
object_tracking.c File Reference
#include "modules/ctrl/object_tracking.h"
#include "firmwares/rotorcraft/navigation.h"
#include "modules/core/abi.h"
#include "generated/airframe.h"
#include "generated/modules.h"
+ Include dependency graph for object_tracking.c:

Go to the source code of this file.

Macros

#define OBJECT_TRACKING_ID   ABI_BROADCAST
 
#define OBJECT_TRACKING_TIMEOUT   3.0f
 
#define OBJECT_TRACKING_RATE   RadOfDeg(10)
 
#define OBJECT_TRACKING_SEARCH_RATE   RadOfDeg(20)
 
#define OBJECT_TRACKING_DEBUG   FALSE
 

Functions

static void get_object (uint8_t sender_id, uint32_t id, uint8_t frame, float bearing, float height, float distance)
 
void object_tracking_init (void)
 init function More...
 
void object_tracking_run (void)
 run function More...
 

Variables

float object_tracking_rate
 max turn rate in control mode in rad/s More...
 
float object_tracking_search_rate
 max turn rate in search mode in rad/s More...
 
static uint8_t object_frame
 
static float object_bearing
 
static float object_height
 
static float timeout
 
abi_event object_ev
 
static const float nav_dt = 1.f / NAVIGATION_FREQUENCY
 

Detailed Description

Author
Gautier Hattenberger gauti.nosp@m.er.h.nosp@m.atten.nosp@m.berg.nosp@m.er@en.nosp@m.ac.f.nosp@m.r Control a rotorcraft heading to track an object detected by a camera

Definition in file object_tracking.c.

Macro Definition Documentation

◆ OBJECT_TRACKING_DEBUG

#define OBJECT_TRACKING_DEBUG   FALSE

Definition at line 55 of file object_tracking.c.

◆ OBJECT_TRACKING_ID

#define OBJECT_TRACKING_ID   ABI_BROADCAST

Definition at line 35 of file object_tracking.c.

◆ OBJECT_TRACKING_RATE

#define OBJECT_TRACKING_RATE   RadOfDeg(10)

Definition at line 45 of file object_tracking.c.

◆ OBJECT_TRACKING_SEARCH_RATE

#define OBJECT_TRACKING_SEARCH_RATE   RadOfDeg(20)

Definition at line 50 of file object_tracking.c.

◆ OBJECT_TRACKING_TIMEOUT

#define OBJECT_TRACKING_TIMEOUT   3.0f

Definition at line 40 of file object_tracking.c.

Function Documentation

◆ get_object()

static void get_object ( uint8_t  sender_id,
uint32_t  id,
uint8_t  frame,
float  bearing,
float  height,
float  distance 
)
static

Definition at line 77 of file object_tracking.c.

References frame, object_bearing, object_frame, object_height, and timeout.

Referenced by object_tracking_init().

+ Here is the caller graph for this function:

◆ object_tracking_init()

void object_tracking_init ( void  )

◆ object_tracking_run()

void object_tracking_run ( void  )

run function

should be called in a flight plan stay block using pre_call

ex: <block name="Track Object"> <stay wp="STDBY" pre_call="object_tracking_run()"> </block>

Definition at line 102 of file object_tracking.c.

References DefaultChannel, DefaultDevice, FLOAT_ANGLE_NORMALIZE, RotorcraftNavigation::heading, msg, nav, nav_dt, NormCourseRad, object_bearing, object_frame, object_height, object_tracking_rate, object_tracking_search_rate, OBJECT_TRACKING_TIMEOUT, FloatEulers::psi, stateGetNedToBodyEulers_f(), and timeout.

+ Here is the call graph for this function:

Variable Documentation

◆ nav_dt

const float nav_dt = 1.f / NAVIGATION_FREQUENCY
static

Definition at line 74 of file object_tracking.c.

Referenced by object_tracking_run().

◆ object_bearing

float object_bearing
static

Definition at line 68 of file object_tracking.c.

Referenced by get_object(), object_tracking_init(), and object_tracking_run().

◆ object_ev

abi_event object_ev

Definition at line 72 of file object_tracking.c.

Referenced by object_tracking_init().

◆ object_frame

uint8_t object_frame
static

Definition at line 67 of file object_tracking.c.

Referenced by get_object(), object_tracking_init(), and object_tracking_run().

◆ object_height

float object_height
static

Definition at line 69 of file object_tracking.c.

Referenced by get_object(), object_tracking_init(), and object_tracking_run().

◆ object_tracking_rate

float object_tracking_rate

max turn rate in control mode in rad/s

Definition at line 64 of file object_tracking.c.

Referenced by object_tracking_init(), and object_tracking_run().

◆ object_tracking_search_rate

float object_tracking_search_rate

max turn rate in search mode in rad/s

Definition at line 65 of file object_tracking.c.

Referenced by object_tracking_init(), and object_tracking_run().

◆ timeout