Paparazzi UAS  v6.2_unstable
Paparazzi is a free software Unmanned Aircraft System.
shift_tracking.c File Reference
#include "modules/ctrl/shift_tracking.h"
#include "firmwares/fixedwing/nav.h"
#include "autopilot.h"
#include "modules/core/abi.h"
#include "math/pprz_algebra_float.h"
#include "generated/airframe.h"
#include "filters/pid.h"
+ Include dependency graph for shift_tracking.c:

Go to the source code of this file.

Data Structures

struct  shift_tracking_private


#define SHIFT_TRACKING_DIR   { -1.0f, 0.f, 0.f }
#define SHIFT_TRACKING_KP   1.5f
#define SHIFT_TRACKING_KI   0.5f
#define SHIFT_TRACKING_KD   1.f


static void get_pos (uint8_t sender_id, uint32_t id, float x, float y, float z, float noise_x, float noise_y, float noise_z)
void shift_tracking_init (void)
 init function More...
void shift_tracking_reset (void)
 reset function More...
void shift_tracking_run (float *shift)
 run function More...
void shift_tracking_update_gains (void)


struct shift_tracking_t shift_tracking
static const float nav_dt = 1.f / NAVIGATION_FREQUENCY
static struct shift_tracking_private stp
static const float dir [] = SHIFT_TRACKING_DIR

Data Structure Documentation

◆ shift_tracking_private

struct shift_tracking_private

Definition at line 81 of file shift_tracking.c.

+ Collaboration diagram for shift_tracking_private:
Data Fields
struct FloatVect3 dir tracking direction
struct PID_f pid PID controller.
struct FloatVect3 pos last position report
abi_event pos_ev
float * shift keep track of the shift variable to change

Macro Definition Documentation



Definition at line 46 of file shift_tracking.c.


#define SHIFT_TRACKING_DIR   { -1.0f, 0.f, 0.f }

Definition at line 56 of file shift_tracking.c.



Definition at line 41 of file shift_tracking.c.


#define SHIFT_TRACKING_KD   1.f

Definition at line 68 of file shift_tracking.c.


#define SHIFT_TRACKING_KI   0.5f

Definition at line 64 of file shift_tracking.c.


#define SHIFT_TRACKING_KP   1.5f

Definition at line 60 of file shift_tracking.c.



Definition at line 72 of file shift_tracking.c.

Function Documentation

◆ get_pos()

static void get_pos ( uint8_t  sender_id,
uint32_t  id,
float  x,
float  y,
float  z,
float  noise_x,
float  noise_y,
float  noise_z 

Definition at line 94 of file shift_tracking.c.

References shift_tracking_private::pos, stp, FloatVect3::x, FloatVect3::y, and FloatVect3::z.

Referenced by shift_tracking_init().

+ Here is the caller graph for this function:

◆ shift_tracking_init()

◆ shift_tracking_reset()

void shift_tracking_reset ( void  )

reset function

reset integral and offset command

Definition at line 127 of file shift_tracking.c.

References shift_tracking_private::pid, reset_pid_f(), shift_tracking_t::shift, shift_tracking_private::shift, shift_tracking, and stp.

+ Here is the call graph for this function:

◆ shift_tracking_run()

void shift_tracking_run ( float *  shift)

run function

should be called in flight plan pre_call

[out]shiftpointer to the navigation shift to control

Definition at line 136 of file shift_tracking.c.

References shift_tracking_private::dir, nav_dt, shift_tracking_private::pid, shift_tracking_private::pos, shift_tracking_t::shift, shift_tracking_private::shift, shift_tracking, SHIFT_TRACKING_MAXSHIFT, stp, update_pid_f(), FloatVect3::x, and FloatVect3::y.

+ Here is the call graph for this function:

◆ shift_tracking_update_gains()

void shift_tracking_update_gains ( void  )

Definition at line 163 of file shift_tracking.c.

References shift_tracking_t::kd, shift_tracking_t::ki, shift_tracking_t::kp, shift_tracking_private::pid, set_gains_pid_f(), shift_tracking, and stp.

+ Here is the call graph for this function:

Variable Documentation

◆ dir

◆ nav_dt

const float nav_dt = 1.f / NAVIGATION_FREQUENCY

Definition at line 78 of file shift_tracking.c.

Referenced by shift_tracking_run().

◆ shift_tracking

◆ stp