Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
ctc.c File Reference
#include <math.h>
#include <std.h>
#include <stdio.h>
#include "modules/multi/ctc/ctc.h"
#include "subsystems/datalink/telemetry.h"
#include "subsystems/navigation/common_nav.h"
#include "firmwares/fixedwing/stabilization/stabilization_attitude.h"
#include "autopilot.h"
+ Include dependency graph for ctc.c:

Go to the source code of this file.

Macros

#define CTC_MAX_AC   4
 
#define CTC_GAIN_K1   0.001
 
#define CTC_GAIN_K2   0.001
 
#define CTC_GAIN_ALPHA   0.01
 
#define CTC_TIMEOUT   1500
 
#define CTC_OMEGA   0.25
 
#define CTC_TIME_BROAD   100
 

Functions

static void send_ctc (struct transport_tx *trans, struct link_device *dev)
 
static void send_ctc_control (struct transport_tx *trans, struct link_device *dev)
 
void ctc_init (void)
 
bool collective_tracking_vehicle ()
 
bool collective_tracking_waypoint (uint8_t wp)
 
bool collective_tracking_point (float x, float y)
 
void collective_tracking_control ()
 

Variables

ctc_con ctc_control
 
int16_t tableNei [CTC_MAX_AC][6]
 
uint32_t last_info [CTC_MAX_AC]
 
uint32_t last_transmision = 0
 
uint32_t before = 0
 
uint32_t time_init_table
 
float moving_target_px = 0
 
float moving_target_py = 0
 
float moving_target_vx = 0
 
float moving_target_vy = 0
 
bool ctc_gogo = false
 
bool ctc_first_time = true
 
uint32_t starting_time
 

Macro Definition Documentation

◆ CTC_GAIN_ALPHA

#define CTC_GAIN_ALPHA   0.01

Definition at line 62 of file ctc.c.

◆ CTC_GAIN_K1

#define CTC_GAIN_K1   0.001

Default gains for the algorithm

Definition at line 56 of file ctc.c.

◆ CTC_GAIN_K2

#define CTC_GAIN_K2   0.001

Definition at line 59 of file ctc.c.

◆ CTC_MAX_AC

#define CTC_MAX_AC   4

Max expected number of aircraft

Definition at line 36 of file ctc.c.

◆ CTC_OMEGA

#define CTC_OMEGA   0.25

Default angular velocity around target in rad/sec

Definition at line 70 of file ctc.c.

◆ CTC_TIME_BROAD

#define CTC_TIME_BROAD   100

Default time in ms for broadcasting information

Definition at line 74 of file ctc.c.

◆ CTC_TIMEOUT

#define CTC_TIMEOUT   1500

Default timeout in ms for the neighbors' information

Definition at line 66 of file ctc.c.

Function Documentation

◆ collective_tracking_control()

◆ collective_tracking_point()

bool collective_tracking_point ( float  x,
float  y 
)

Definition at line 133 of file ctc.c.

References collective_tracking_control(), ctc_control, ctc_con::target_px, ctc_con::target_py, ctc_con::target_vx, and ctc_con::target_vy.

+ Here is the call graph for this function:

◆ collective_tracking_vehicle()

bool collective_tracking_vehicle ( )

◆ collective_tracking_waypoint()

bool collective_tracking_waypoint ( uint8_t  wp)

Definition at line 121 of file ctc.c.

References collective_tracking_control(), ctc_control, ctc_con::target_px, ctc_con::target_py, ctc_con::target_vx, ctc_con::target_vy, waypoints, point::x, and point::y.

+ Here is the call graph for this function:

◆ ctc_init()

void ctc_init ( void  )

Definition at line 97 of file ctc.c.

References CTC_MAX_AC, DefaultPeriodic, register_periodic_telemetry(), send_ctc(), send_ctc_control(), and tableNei.

+ Here is the call graph for this function:

◆ send_ctc()

static void send_ctc ( struct transport_tx *  trans,
struct link_device *  dev 
)
static

Definition at line 40 of file ctc.c.

References CTC_MAX_AC, dev, and tableNei.

Referenced by ctc_init().

+ Here is the caller graph for this function:

◆ send_ctc_control()

static void send_ctc_control ( struct transport_tx *  trans,
struct link_device *  dev 
)
static

Definition at line 45 of file ctc.c.

References ctc_control, dev, ctc_con::ref_px, ctc_con::ref_py, ctc_con::target_px, ctc_con::target_py, ctc_con::target_vx, ctc_con::target_vy, ctc_con::v_centroid_x, and ctc_con::v_centroid_y.

Referenced by ctc_init().

+ Here is the caller graph for this function:

Variable Documentation

◆ before

uint32_t before = 0

Definition at line 84 of file ctc.c.

Referenced by collective_tracking_control().

◆ ctc_control

◆ ctc_first_time

bool ctc_first_time = true

Definition at line 94 of file ctc.c.

Referenced by collective_tracking_control().

◆ ctc_gogo

bool ctc_gogo = false

Definition at line 93 of file ctc.c.

Referenced by collective_tracking_control().

◆ last_info

uint32_t last_info[CTC_MAX_AC]

Definition at line 82 of file ctc.c.

Referenced by collective_tracking_control().

◆ last_transmision

uint32_t last_transmision = 0

Definition at line 83 of file ctc.c.

Referenced by collective_tracking_control().

◆ moving_target_px

float moving_target_px = 0

Definition at line 88 of file ctc.c.

Referenced by collective_tracking_control(), and collective_tracking_vehicle().

◆ moving_target_py

float moving_target_py = 0

Definition at line 89 of file ctc.c.

Referenced by collective_tracking_control(), and collective_tracking_vehicle().

◆ moving_target_vx

float moving_target_vx = 0

Definition at line 90 of file ctc.c.

Referenced by collective_tracking_control(), and collective_tracking_vehicle().

◆ moving_target_vy

float moving_target_vy = 0

Definition at line 91 of file ctc.c.

Referenced by collective_tracking_control(), and collective_tracking_vehicle().

◆ starting_time

uint32_t starting_time

Definition at line 95 of file ctc.c.

Referenced by collective_tracking_control().

◆ tableNei

int16_t tableNei[CTC_MAX_AC][6]

Definition at line 81 of file ctc.c.

Referenced by collective_tracking_control(), ctc_init(), and send_ctc().

◆ time_init_table

uint32_t time_init_table

Definition at line 86 of file ctc.c.

CTC_OMEGA
#define CTC_OMEGA
Definition: ctc.c:70
CTC_GAIN_K2
#define CTC_GAIN_K2
Definition: ctc.c:59
CTC_GAIN_K1
#define CTC_GAIN_K1
Definition: ctc.c:56
CTC_TIME_BROAD
#define CTC_TIME_BROAD
Definition: ctc.c:74
CTC_TIMEOUT
#define CTC_TIMEOUT
Definition: ctc.c:66
CTC_GAIN_ALPHA
#define CTC_GAIN_ALPHA
Definition: ctc.c:62