|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
39 #if PERIODIC_TELEMETRY
40 static void send_ctc(
struct transport_tx *trans,
struct link_device *
dev)
51 #endif // PERIODIC TELEMETRY
56 #define CTC_GAIN_K1 0.001
59 #define CTC_GAIN_K2 0.001
61 #ifndef CTC_GAIN_ALPHA
62 #define CTC_GAIN_ALPHA 0.01
66 #define CTC_TIMEOUT 1500
70 #define CTC_OMEGA 0.25
73 #ifndef CTC_TIME_BROAD
74 #define CTC_TIME_BROAD 100
78 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
CTC_OMEGA,
CTC_TIME_BROAD
103 #if PERIODIC_TELEMETRY
175 float dt = (now -
before) / 1000.0;
178 int num_neighbors = 0;
180 int num_neighbors = 0;
190 float vx_nei =
tableNei[i][1] / 100.0;
191 float vy_nei =
tableNei[i][2] / 100.0;
192 float px_nei =
tableNei[i][3] / 100.0;
193 float py_nei =
tableNei[i][4] / 100.0;
204 int num_neighbors = 0;
214 float vx_nei =
tableNei[i][1] / 100.0;
215 float vy_nei =
tableNei[i][2] / 100.0;
216 float px_nei =
tableNei[i][3] / 100.0;
217 float py_nei =
tableNei[i][4] / 100.0;
228 if (num_neighbors != 0) {
239 if(num_neighbors != 0){
250 float distance_target_ref = sqrtf(error_target_ref_x*error_target_ref_x + error_target_ref_y*error_target_ref_y);
251 if(distance_target_ref < 0.1)
252 distance_target_ref = 0.1;
253 float aux = (1-expf(-
ctc_control.
alpha*distance_target_ref)) / distance_target_ref;
270 float u = u_vel + u_spa;
274 -atanf(u * (sqrtf(vx * vx + vy * vy)) / 9.8 / cosf(att->
theta));
288 struct pprzlink_msg
msg;
294 msg.sender_id = AC_ID;
296 msg.component_id = 0;
304 if (
ac_id == AC_ID) {
305 uint8_t nei_id = DL_CTC_REG_TABLE_nei_id(buf);
uint32_t last_info[CTC_MAX_AC]
bool collective_tracking_waypoint(uint8_t wp)
uint32_t last_transmision
#define LATERAL_MODE_ROLL
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
static struct FloatEulers * stateGetNedToBodyEulers_f(void)
Get vehicle body attitude euler angles (float).
float h_ctl_roll_max_setpoint
struct point waypoints[NB_WAYPOINT]
size == nb_waypoint, waypoint 0 is a dummy waypoint
static void send_ctc_control(struct transport_tx *trans, struct link_device *dev)
bool collective_tracking_vehicle()
float h_ctl_roll_setpoint
bool collective_tracking_point(float x, float y)
uint8_t msg[10]
Buffer used for general comunication over SPI (out buffer)
void parse_ctc_CleanTable(uint8_t *buf)
int16_t tableNei[CTC_MAX_AC][6]
void ctc_send_info_to_nei(void)
static const struct usb_device_descriptor dev
static void send_ctc(struct transport_tx *trans, struct link_device *dev)
uint32_t get_sys_time_msec(void)
Get the time in milliseconds since startup.
void collective_tracking_control()
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
vector in East North Up coordinates Units: meters
void parse_ctc_RegTable(uint8_t *buf)
static struct EnuCoor_f * stateGetSpeedEnu_f(void)
Get ground speed in local ENU coordinates (float).
void parse_ctc_NeiInfoTable(uint8_t *buf)
uint8_t autopilot_get_mode(void)
get autopilot mode
void parse_ctc_TargetInfo(uint8_t *buf)
#define DefaultPeriodic
Set default periodic telemetry.