Paparazzi UAS  v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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

#define CTC_GAIN_ALPHA   0.01

Definition at line 62 of file ctc.c.

#define CTC_GAIN_K1   0.001

Default gains for the algorithm

Definition at line 56 of file ctc.c.

#define CTC_GAIN_K2   0.001

Definition at line 59 of file ctc.c.

#define CTC_MAX_AC   4

Max expected number of aircraft

Definition at line 36 of file ctc.c.

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

#define CTC_OMEGA   0.25

Default angular velocity around target in rad/sec

Definition at line 70 of file ctc.c.

#define CTC_TIME_BROAD   100

Default time in ms for broadcasting information

Definition at line 74 of file ctc.c.

#define CTC_TIMEOUT   1500

Default timeout in ms for the neighbors' information

Definition at line 66 of file ctc.c.

Function Documentation

bool collective_tracking_point ( float  x,
float  y 
)

Definition at line 133 of file ctc.c.

References collective_tracking_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:

bool collective_tracking_vehicle ( void  )
bool collective_tracking_waypoint ( uint8_t  wp)

Definition at line 121 of file ctc.c.

References collective_tracking_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:

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:

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, and tableNei.

Referenced by ctc_init().

+ Here is the caller graph for this function:

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, 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

uint32_t before = 0

Definition at line 84 of file ctc.c.

Referenced by collective_tracking_control().

ctc_con ctc_control
Initial value:
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CTC_OMEGA, CTC_TIME_BROAD
}
#define CTC_TIMEOUT
Definition: ctc.c:66
#define CTC_GAIN_ALPHA
Definition: ctc.c:62
#define CTC_GAIN_K2
Definition: ctc.c:59
#define CTC_GAIN_K1
Definition: ctc.c:56
#define CTC_TIME_BROAD
Definition: ctc.c:74
#define CTC_OMEGA
Definition: ctc.c:70

Definition at line 77 of file ctc.c.

Referenced by send_ctc_control().

bool ctc_first_time = true

Definition at line 94 of file ctc.c.

Referenced by collective_tracking_control().

bool ctc_gogo = false

Definition at line 93 of file ctc.c.

Referenced by collective_tracking_control().

uint32_t last_info[CTC_MAX_AC]

Definition at line 82 of file ctc.c.

Referenced by collective_tracking_control().

uint32_t last_transmision = 0

Definition at line 83 of file ctc.c.

Referenced by collective_tracking_control().

float moving_target_px = 0

Definition at line 88 of file ctc.c.

Referenced by collective_tracking_control(), and collective_tracking_vehicle().

float moving_target_py = 0

Definition at line 89 of file ctc.c.

Referenced by collective_tracking_control(), and collective_tracking_vehicle().

float moving_target_vx = 0

Definition at line 90 of file ctc.c.

Referenced by collective_tracking_control(), and collective_tracking_vehicle().

float moving_target_vy = 0

Definition at line 91 of file ctc.c.

Referenced by collective_tracking_control(), and collective_tracking_vehicle().

uint32_t starting_time

Definition at line 95 of file ctc.c.

Referenced by collective_tracking_control().

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

uint32_t time_init_table

Definition at line 86 of file ctc.c.