Paparazzi UAS  v5.14.0_stable-0-g3f680d1
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
object_tracking.c File Reference
#include "modules/ctrl/object_tracking.h"
#include "firmwares/rotorcraft/navigation.h"
#include "subsystems/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 / NAV_FREQ
 

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

#define OBJECT_TRACKING_DEBUG   FALSE

Definition at line 55 of file object_tracking.c.

#define OBJECT_TRACKING_ID   ABI_BROADCAST

Definition at line 35 of file object_tracking.c.

Referenced by object_tracking_init().

#define OBJECT_TRACKING_RATE   RadOfDeg(10)

Definition at line 45 of file object_tracking.c.

Referenced by object_tracking_init().

#define OBJECT_TRACKING_SEARCH_RATE   RadOfDeg(20)

Definition at line 50 of file object_tracking.c.

Referenced by object_tracking_init().

#define OBJECT_TRACKING_TIMEOUT   3.0f

Definition at line 40 of file object_tracking.c.

Referenced by object_tracking_init(), and object_tracking_run().

Function Documentation

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 object_bearing, object_frame, object_height, and timeout.

Referenced by object_tracking_init().

+ Here is the caller graph for this function:

void object_tracking_init ( void  )
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 ANGLE_BFP_OF_REAL, ANGLE_FLOAT_OF_BFP, DefaultChannel, DefaultDevice, FLOAT_ANGLE_NORMALIZE, INT32_COURSE_NORMALIZE, msg, nav_dt, nav_heading, 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

const float nav_dt = 1.f / NAV_FREQ
static

Definition at line 74 of file object_tracking.c.

Referenced by object_tracking_run().

float object_bearing
static

Definition at line 68 of file object_tracking.c.

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

abi_event object_ev

Definition at line 72 of file object_tracking.c.

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().

float object_height
static

Definition at line 69 of file object_tracking.c.

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

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().

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().