Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
ctc.c File Reference
#include <math.h>
#include <std.h>
#include <stdio.h>
#include "modules/multi/ctc/ctc.h"
#include "modules/datalink/telemetry.h"
#include "modules/nav/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 61 of file ctc.c.

◆ CTC_GAIN_K1

#define CTC_GAIN_K1   0.001

Default gains for the algorithm

Definition at line 55 of file ctc.c.

◆ CTC_GAIN_K2

#define CTC_GAIN_K2   0.001

Definition at line 58 of file ctc.c.

◆ CTC_MAX_AC

#define CTC_MAX_AC   4

◆ CTC_OMEGA

#define CTC_OMEGA   0.25

Default angular velocity around target in rad/sec

Definition at line 69 of file ctc.c.

◆ CTC_TIME_BROAD

#define CTC_TIME_BROAD   100

Default time in ms for broadcasting information

Definition at line 73 of file ctc.c.

◆ CTC_TIMEOUT

#define CTC_TIMEOUT   1500

Default timeout in ms for the neighbors' information

Definition at line 65 of file ctc.c.

Function Documentation

◆ collective_tracking_control()

◆ collective_tracking_point()

bool collective_tracking_point ( float x,
float y )

Definition at line 132 of file ctc.c.

References collective_tracking_control(), and ctc_control.

Here is the call graph for this function:

◆ collective_tracking_vehicle()

bool collective_tracking_vehicle ( void )

Definition at line 108 of file ctc.c.

References collective_tracking_control(), ctc_control, moving_target_px, moving_target_py, moving_target_vx, and moving_target_vy.

Here is the call graph for this function:

◆ collective_tracking_waypoint()

bool collective_tracking_waypoint ( uint8_t wp)

Definition at line 120 of file ctc.c.

References collective_tracking_control(), ctc_control, and waypoints.

Here is the call graph for this function:

◆ ctc_init()

void ctc_init ( void )

Definition at line 96 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()

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

Definition at line 39 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()

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

Definition at line 44 of file ctc.c.

References ctc_control, and dev.

Referenced by ctc_init().

Here is the caller graph for this function:

Variable Documentation

◆ before

uint32_t before = 0

Definition at line 83 of file ctc.c.

Referenced by collective_tracking_control().

◆ ctc_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_TIME_BROAD
Definition ctc.c:73
#define CTC_GAIN_ALPHA
Definition ctc.c:61
#define CTC_OMEGA
Definition ctc.c:69
#define CTC_GAIN_K1
Definition ctc.c:55
#define CTC_TIMEOUT
Definition ctc.c:65
#define CTC_GAIN_K2
Definition ctc.c:58

Definition at line 76 of file ctc.c.

Referenced by collective_tracking_control(), collective_tracking_point(), collective_tracking_vehicle(), collective_tracking_waypoint(), and send_ctc_control().

◆ ctc_first_time

bool ctc_first_time = true

Definition at line 93 of file ctc.c.

Referenced by collective_tracking_control().

◆ ctc_gogo

bool ctc_gogo = false

Definition at line 92 of file ctc.c.

Referenced by collective_tracking_control().

◆ last_info

uint32_t last_info[CTC_MAX_AC]

Definition at line 81 of file ctc.c.

Referenced by collective_tracking_control().

◆ last_transmision

uint32_t last_transmision = 0

Definition at line 82 of file ctc.c.

Referenced by collective_tracking_control(), and distributed_circular().

◆ moving_target_px

float moving_target_px = 0

Definition at line 87 of file ctc.c.

Referenced by collective_tracking_control(), and collective_tracking_vehicle().

◆ moving_target_py

float moving_target_py = 0

Definition at line 88 of file ctc.c.

Referenced by collective_tracking_control(), and collective_tracking_vehicle().

◆ moving_target_vx

float moving_target_vx = 0

Definition at line 89 of file ctc.c.

Referenced by collective_tracking_control(), and collective_tracking_vehicle().

◆ moving_target_vy

float moving_target_vy = 0

Definition at line 90 of file ctc.c.

Referenced by collective_tracking_control(), and collective_tracking_vehicle().

◆ starting_time

uint32_t starting_time

Definition at line 94 of file ctc.c.

Referenced by collective_tracking_control().

◆ tableNei

◆ time_init_table

uint32_t time_init_table

Definition at line 85 of file ctc.c.