Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
actuators_uavcan.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2021 Freek van Tienen <freek.v.tienen@gmail.com>
3 *
4 * This file is part of paparazzi.
5 *
6 * paparazzi is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * paparazzi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with paparazzi; see the file COPYING. If not, write to
18 * the Free Software Foundation, 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
20 */
26
27#include "actuators_uavcan.h"
29#include "math/pprz_random.h"
30#include "modules/core/abi.h"
32#include <math.h>
33
34
35#include "uavcan.equipment.esc.Status.h"
36#include "uavcan.equipment.esc.RawCommand.h"
37#include "uavcan.equipment.actuator.Status.h"
38#include "uavcan.equipment.actuator.ArrayCommand.h"
39#include "uavcan.equipment.device.Temperature.h"
40
41/* By default enable the usage of the current sensing in the ESC telemetry */
42#ifndef UAVCAN_ACTUATORS_USE_CURRENT
43#define UAVCAN_ACTUATORS_USE_CURRENT TRUE
44#endif
45
46#define UNITLESS UAVCAN_EQUIPMENT_ACTUATOR_COMMAND_COMMAND_TYPE_UNITLESS
47#define POSITION UAVCAN_EQUIPMENT_ACTUATOR_COMMAND_COMMAND_TYPE_POSITION
48#define FORCE UAVCAN_EQUIPMENT_ACTUATOR_COMMAND_COMMAND_TYPE_FORCE
49#define SPEED UAVCAN_EQUIPMENT_ACTUATOR_COMMAND_COMMAND_TYPE_SPEED
50#define PWM UAVCAN_EQUIPMENT_ACTUATOR_COMMAND_COMMAND_TYPE_PWM
51
52/* uavcan ESC status telemetry structure */
65
66/* The transmitted actuator values */
67#ifdef SERVOS_UAVCAN1_NB
68int16_t actuators_uavcan1_values[SERVOS_UAVCAN1_NB];
69
71{
73}
74#endif
75#ifdef SERVOS_UAVCAN2_NB
76int16_t actuators_uavcan2_values[SERVOS_UAVCAN2_NB];
77
79{
81}
82#endif
83
84#ifdef SERVOS_UAVCAN1CMD_NB
85
86#ifndef ACTUATOR_UAVCAN1_CMD_TYPES
87#define ACTUATOR_UAVCAN1_CMD_TYPES {[0 ... SERVOS_UAVCAN1CMD_NB - 1] = UNITLESS}
88#endif
89
90#ifndef ACTUATOR_UAVCAN1_CMD_FACTORS
91#define ACTUATOR_UAVCAN1_CMD_FACTORS {[0 ... SERVOS_UAVCAN1CMD_NB - 1] = (float)MAX_PPRZ}
92#endif
93
94static const uint8_t uavcan1_cmd_types[SERVOS_UAVCAN1CMD_NB] = ACTUATOR_UAVCAN1_CMD_TYPES;
95static const float uavcan1_cmd_factors[SERVOS_UAVCAN1CMD_NB] = ACTUATOR_UAVCAN1_CMD_FACTORS;
96
97int16_t actuators_uavcan1cmd_values[SERVOS_UAVCAN1CMD_NB];
98
100{
102}
103
104#endif
105
106#ifdef SERVOS_UAVCAN2CMD_NB
107#ifndef ACTUATOR_UAVCAN2_CMD_TYPES
108#define ACTUATOR_UAVCAN2_CMD_TYPES {[0 ... SERVOS_UAVCAN2CMD_NB - 1] = UNITLESS}
109#endif
110
111#ifndef ACTUATOR_UAVCAN2_CMD_FACTORS
112#define ACTUATOR_UAVCAN2_CMD_FACTORS {[0 ... SERVOS_UAVCAN2CMD_NB - 1] = (float)MAX_PPRZ}
113#endif
114
115static const uint8_t uavcan2_cmd_types[SERVOS_UAVCAN2CMD_NB] = ACTUATOR_UAVCAN2_CMD_TYPES;
116static const float uavcan2_cmd_factors[SERVOS_UAVCAN2CMD_NB] = ACTUATOR_UAVCAN2_CMD_FACTORS;
117
118int16_t actuators_uavcan2cmd_values[SERVOS_UAVCAN2CMD_NB];
119
121{
123}
124#endif
125
126/* Set the actual telemetry length (ID's from actuators can't collide with the command version) */
127#if SERVOS_UAVCAN1CMD_NB > SERVOS_UAVCAN1_NB
128#define UAVCAN1_TELEM_NB SERVOS_UAVCAN1CMD_NB
129static struct actuators_uavcan_telem_t uavcan1_telem[SERVOS_UAVCAN1CMD_NB] = {0};
130#elif defined(SERVOS_UAVCAN1_NB)
131#define UAVCAN1_TELEM_NB SERVOS_UAVCAN1_NB
132static struct actuators_uavcan_telem_t uavcan1_telem[SERVOS_UAVCAN1_NB] = {0};
133#endif
134
135#if SERVOS_UAVCAN2CMD_NB > SERVOS_UAVCAN2_NB
136#define UAVCAN2_TELEM_NB SERVOS_UAVCAN2CMD_NB
137static struct actuators_uavcan_telem_t uavcan2_telem[SERVOS_UAVCAN2CMD_NB] = {0};
138#elif defined(SERVOS_UAVCAN2_NB)
139#define UAVCAN2_TELEM_NB SERVOS_UAVCAN2_NB
140static struct actuators_uavcan_telem_t uavcan2_telem[SERVOS_UAVCAN2_NB] = {0};
141#endif
142
143/* UNUSED value for CMD */
144#define UAVCAN_CMD_UNUSED (MIN_PPRZ-1)
145
146/* private variables */
151
152#if PERIODIC_TELEMETRY
154
155static uint8_t old_idx = 0;
156static uint8_t esc_idx = 0;
158#ifdef UAVCAN_ACTUATORS_TELEM_IDX
159 // Only report the ESCs listed in UAVCAN_ACTUATORS_TELEM_IDX (index counted over UAVCAN1, then UAVCAN2)
160 static const uint8_t telem_idx[] = UAVCAN_ACTUATORS_TELEM_IDX;
161 static uint8_t idx_cur = 0;
162
163 // Randomness added for multiple transport devices
164 if (rand_uniform() > 0.02f) {
165 idx_cur++;
166 }
167 if (idx_cur >= (sizeof(telem_idx) / sizeof(telem_idx[0]))) {
168 idx_cur = 0;
169 }
170
171 uint8_t idx = telem_idx[idx_cur];
172 uint8_t offset = 0;
173 old_idx = idx;
174 esc_idx = idx;
175
176 // Skip the ESC if no telemetry was received from it (same as the default mode)
177#ifdef UAVCAN1_TELEM_NB
178 if (idx < UAVCAN1_TELEM_NB) {
179 return uavcan1_telem[idx].set ? &uavcan1_telem[idx] : NULL;
180 }
181 offset += UAVCAN1_TELEM_NB;
182#endif
183#ifdef UAVCAN2_TELEM_NB
184 if (idx < offset + UAVCAN2_TELEM_NB) {
185 return uavcan2_telem[idx - offset].set ? &uavcan2_telem[idx - offset] : NULL;
186 }
187#endif
188 esc_idx = 0;
189 return NULL;
190
191#else
192 // Randomness added for multiple transport devices
193 uint8_t add_idx = 0;
194 if (rand_uniform() > 0.02) {
195 add_idx = 1;
196 }
197
198 // Find the next set telemetry
199 uint8_t offset = 0;
200#ifdef UAVCAN1_TELEM_NB
201 for(uint8_t i = esc_idx - offset; i < UAVCAN1_TELEM_NB; i++) {
202 if(uavcan1_telem[i].set) {
203 old_idx = i + offset;
204 esc_idx = i + offset + add_idx;
205 return &uavcan1_telem[i];
206 } else {
207 esc_idx = i + offset + 1;
208 }
209 }
210 offset += UAVCAN1_TELEM_NB;
211#endif
212#ifdef UAVCAN2_TELEM_NB
213 for(uint8_t i = esc_idx - offset; i < UAVCAN2_TELEM_NB; i++) {
214 if(uavcan2_telem[i].set) {
215 old_idx = i + offset;
216 esc_idx = i + offset + add_idx;
217 return &uavcan2_telem[i];
218 } else {
219 esc_idx = i + offset + 1;
220 }
221 }
222 offset += UAVCAN2_TELEM_NB;
223#endif
224
225 // Going round or no telemetry found
226 esc_idx = 0;
227 return NULL;
228#endif
229}
230
231static void actuators_uavcan_send_esc(struct transport_tx *trans, struct link_device *dev)
232{
233 // Find the correct telemetry (Try twice if going round)
235 if(telem == NULL) {
237 }
238
239 // Safety check (no telemetry received 2 times)
240 if (telem == NULL) {
241 return;
242 }
243
244 float power = telem->current * telem->voltage;
245 float rpm = telem->rpm;
246 float energy = telem->energy;
247 pprz_msg_send_ESC(trans, dev, AC_ID, &telem->current, &electrical.vsupply, &power,
248 &rpm, &telem->voltage, &energy, &telem->temperature, &telem->temperature_dev, &telem->node_id, &old_idx);
249}
250#endif
251
253 struct actuators_uavcan_telem_t *telem = NULL;
254
255#ifdef UAVCAN1_TELEM_NB
256 if (iface == &uavcan1 && idx < UAVCAN1_TELEM_NB) {
257 telem = &uavcan1_telem[idx];
258 }
259#endif
260#ifdef UAVCAN2_TELEM_NB
261 if (iface == &uavcan2 && idx < UAVCAN2_TELEM_NB) {
262 telem = &uavcan2_telem[idx];
263 }
264#endif
265
266 return telem;
267}
268
270 uint8_t actuator_idx = 255;
271
272#ifdef UAVCAN1_TELEM_NB
273 if(iface == &uavcan1) {
274#ifdef SERVOS_UAVCAN1_NB
275 // First try as RAW COMMAND
276 actuator_idx = get_servo_idx_UAVCAN1(idx);
277#endif
278#ifdef SERVOS_UAVCAN1CMD_NB
279 // Then try as ACTUATOR COMMAND (also before the first command is sent)
280 if(idx < SERVOS_UAVCAN1CMD_NB) {
281 uint8_t cmd_idx = get_servo_idx_UAVCAN1CMD(idx);
282 if(actuators[cmd_idx].set == actuators_uavcan1cmd_set && actuators[cmd_idx].config.servo_idx == idx) {
283 actuator_idx = cmd_idx;
284 }
285 }
286#endif
287 }
288#endif
289#ifdef UAVCAN2_TELEM_NB
290 if(iface == &uavcan2) {
291#ifdef SERVOS_UAVCAN2_NB
292 // First try as RAW COMMAND
293 actuator_idx = get_servo_idx_UAVCAN2(idx);
294#endif
295#ifdef SERVOS_UAVCAN2CMD_NB
296 // Then try as ACTUATOR COMMAND (also before the first command is sent)
297 if(idx < SERVOS_UAVCAN2CMD_NB) {
298 uint8_t cmd_idx = get_servo_idx_UAVCAN2CMD(idx);
299 if(actuators[cmd_idx].set == actuators_uavcan2cmd_set && actuators[cmd_idx].config.servo_idx == idx) {
300 actuator_idx = cmd_idx;
301 }
302 }
303#endif
304 }
305#endif
306
307 return actuator_idx;
308}
309
313static void actuators_uavcan_esc_status_cb(struct uavcan_iface_t *iface, CanardRxTransfer *transfer)
314{
315 // Decode the message
316 struct uavcan_equipment_esc_Status msg;
317 if(uavcan_equipment_esc_Status_decode(transfer, &msg)) {
318 return; // Decoding error
319 }
320
321 // Get the correct telemetry
322 struct actuators_uavcan_telem_t *telem = get_actuator_telem(iface, msg.esc_index);
323 if(telem == NULL) {
324 return;
325 }
326
327 // Set the telemetry (FIXME: copy over fully)
328 telem->set = true;
329 telem->node_id = transfer->source_node_id;
330 telem->timestamp = get_sys_time_float();
331 telem->energy = msg.error_count;
332 telem->voltage = msg.voltage;
333 telem->current = msg.current;
334 telem->temperature = msg.temperature;
335 telem->rpm = msg.rpm;
336
337 /* Specification says Kelvin, but some are transmitting in Celsius */
338 if (telem->temperature > 230.f) {
339 telem->temperature -= 273.15;
340 }
341
342 // Feedback ABI RPM messages
343 struct act_feedback_t feedback = {0};
344 feedback.idx = get_actuator_idx(iface, msg.esc_index);
345 feedback.rpm = telem->rpm;
346 feedback.set.rpm = true;
347
348 // Send ABI message
349 AbiSendMsgACT_FEEDBACK(ACT_FEEDBACK_UAVCAN_ID, &feedback, 1);
350
351#if UAVCAN_ACTUATORS_USE_CURRENT
352 // Update total current based on ESC telemetry
353 electrical.current = 0;
354#ifdef UAVCAN1_TELEM_NB
355 for (uint8_t i = 0; i < UAVCAN1_TELEM_NB; ++i) {
356 electrical.current += uavcan1_telem[i].current;
357 }
358#endif
359#ifdef UAVCAN2_TELEM_NB
360 for (uint8_t i = 0; i < UAVCAN2_TELEM_NB; ++i) {
361 electrical.current += uavcan2_telem[i].current;
362 }
363#endif
364#endif
365}
366
370static void actuators_uavcan_actuator_status_cb(struct uavcan_iface_t *iface, CanardRxTransfer *transfer)
371{
372 // Decode the message
373 struct uavcan_equipment_actuator_Status msg;
374 if(uavcan_equipment_actuator_Status_decode(transfer, &msg)) {
375 return; // Decoding error
376 }
377
378 // Get the correct telemetry
379 struct actuators_uavcan_telem_t *telem = get_actuator_telem(iface, msg.actuator_id);
380 if(telem == NULL) {
381 return;
382 }
383
384 //telem[msg.actuator_id].set = true;
385 telem->position = msg.position;
386
387 // Feedback ABI position messages
388 struct act_feedback_t feedback = {0};
389 feedback.idx = get_actuator_idx(iface, msg.actuator_id);
390 // Unknown fields are NAN, unknown power rating is 127
391 feedback.position = telem->position;
392 feedback.set.position = !isnan(msg.position);
393 feedback.force = msg.force;
394 feedback.set.force = !isnan(msg.force);
395 feedback.speed = msg.speed;
396 feedback.set.speed = !isnan(msg.speed);
397 if (msg.power_rating_pct <= 100) {
398 feedback.power_pct = msg.power_rating_pct;
399 feedback.set.power = true;
400 }
401
402 // Send ABI message
403 AbiSendMsgACT_FEEDBACK(ACT_FEEDBACK_UAVCAN_ID, &feedback, 1);
404}
405
409static void actuators_uavcan_device_temperature_cb(struct uavcan_iface_t *iface, CanardRxTransfer *transfer)
410{
411 // Decode the message
412 struct uavcan_equipment_device_Temperature msg;
413 if(uavcan_equipment_device_Temperature_decode(transfer, &msg)) {
414 return; // Decoding error
415 }
416
417 // Get the correct telemetry
418 struct actuators_uavcan_telem_t *telem = get_actuator_telem(iface, msg.device_id);
419 if(telem == NULL) {
420 return;
421 }
422
423 telem->set = true;
424 telem->temperature_dev = msg.temperature - 273.15;
425}
426
427
431void actuators_uavcan_init(struct uavcan_iface_t *iface __attribute__((unused)))
432{
433 // Check if not already initialized (for multiple interfaces, needs only 1)
434 if (actuators_uavcan_initialized) { return; }
435
436 // Bind uavcan ESC_STATUS message from EQUIPMENT
437 uavcan_bind(UAVCAN_EQUIPMENT_ESC_STATUS_ID, UAVCAN_EQUIPMENT_ESC_STATUS_SIGNATURE, &esc_status_ev,
439 // Bind uavcan ACTUATOR_STATUS message from EQUIPMENT
440 uavcan_bind(UAVCAN_EQUIPMENT_ACTUATOR_STATUS_ID, UAVCAN_EQUIPMENT_ACTUATOR_STATUS_SIGNATURE, &actuator_status_ev,
442 // Bind uavcan DEVICE_TEMPERATURE message from EQUIPMENT
443 uavcan_bind(UAVCAN_EQUIPMENT_DEVICE_TEMPERATURE_ID, UAVCAN_EQUIPMENT_DEVICE_TEMPERATURE_SIGNATURE, &device_temperature_ev,
445
446 // Configure telemetry
447#if PERIODIC_TELEMETRY
449#endif
450
451 // Set default to not used
452#ifdef SERVOS_UAVCAN1CMD_NB
453 for(uint8_t i = 0; i < SERVOS_UAVCAN1CMD_NB; i++)
455#endif
456#ifdef SERVOS_UAVCAN2CMD_NB
457 for(uint8_t i = 0; i < SERVOS_UAVCAN2CMD_NB; i++)
459#endif
460
461 // Set initialization
463
464 // Initialize Random (for telemetry)
465 init_random();
466}
467
472{
473 // Generate the message
474 struct uavcan_equipment_esc_RawCommand msg = {0};
475 msg.cmd.len = nb;
476 for (uint8_t i = 0; i < nb; i++) {
477 msg.cmd.data[i] = values[i];
478 }
479
480 // Encode the mssage
481 uint8_t buffer[UAVCAN_EQUIPMENT_ESC_RAWCOMMAND_MAX_SIZE];
482 uint32_t total_size = uavcan_equipment_esc_RawCommand_encode(&msg, buffer);
483
484 // Broadcast the raw command message on the interface
485 uavcan_broadcast(iface, UAVCAN_EQUIPMENT_ESC_RAWCOMMAND_SIGNATURE, UAVCAN_EQUIPMENT_ESC_RAWCOMMAND_ID,
486 CANARD_TRANSFER_PRIORITY_HIGH, buffer, total_size);
487}
488
493{
494
495 const uint8_t *cmd_types = NULL;
496 const float *cmd_factors = NULL;
497
498#ifdef SERVOS_UAVCAN1CMD_NB
499 if(iface == &uavcan1) {
500 cmd_types = uavcan1_cmd_types;
501 cmd_factors = uavcan1_cmd_factors;
502 }
503#endif
504#ifdef SERVOS_UAVCAN2CMD_NB
505 if(iface == &uavcan2) {
506 cmd_types = uavcan2_cmd_types;
507 cmd_factors = uavcan2_cmd_factors;
508 }
509#endif
510
511 if (cmd_types == NULL || cmd_factors == NULL) {
512 return;
513 }
514
515 struct uavcan_equipment_actuator_ArrayCommand msg = {0};
516 msg.commands.len = 0;
517
518 // Encode the values for each command
519 for (uint8_t i = 0; i < nb; i++) {
520 // Skip unused commands
521 if(values[i] == UAVCAN_CMD_UNUSED || values[i] < MIN_PPRZ || values[i] > MAX_PPRZ)
522 continue;
523
524 msg.commands.data[msg.commands.len].actuator_id = i;
525 msg.commands.data[msg.commands.len].command_type = cmd_types[i];
526 msg.commands.data[msg.commands.len].command_value = (float)values[i] / cmd_factors[i];
527 msg.commands.len++;
528 }
529
530 // Nothing to send (e.g. actuators not commanded yet)
531 if (msg.commands.len == 0) {
532 return;
533 }
534
535 // Encode the message
536 uint8_t buffer[UAVCAN_EQUIPMENT_ACTUATOR_ARRAYCOMMAND_MAX_SIZE];
537 uint32_t total_size = uavcan_equipment_actuator_ArrayCommand_encode(&msg, buffer);
538
539 // Broadcast the raw command message on the interface
540 uavcan_broadcast(iface, UAVCAN_EQUIPMENT_ACTUATOR_ARRAYCOMMAND_SIGNATURE, UAVCAN_EQUIPMENT_ACTUATOR_ARRAYCOMMAND_ID,
541 CANARD_TRANSFER_PRIORITY_HIGH, buffer, total_size);
542}
Main include for ABI (AirBorneInterface).
#define ACT_FEEDBACK_UAVCAN_ID
void actuators_uavcan1_set(uint8_t idx, int16_t value)
int16_t actuators_uavcan1_values[SERVOS_UAVCAN1_NB]
Stub file needed per uavcan interface because of generator.
int16_t actuators_uavcan1cmd_values[SERVOS_UAVCAN1CMD_NB]
Stub file needed per uavcan interface because of generator.
void actuators_uavcan1cmd_set(uint8_t idx, int16_t value)
void actuators_uavcan2_set(uint8_t idx, int16_t value)
int16_t actuators_uavcan2_values[SERVOS_UAVCAN2_NB]
Stub file needed per interface because of generator.
void actuators_uavcan2cmd_set(uint8_t idx, int16_t value)
int16_t actuators_uavcan2cmd_values[SERVOS_UAVCAN2CMD_NB]
Stub file needed per uavcan interface because of generator.
static void actuators_uavcan_send_esc(struct transport_tx *trans, struct link_device *dev)
void actuators_uavcan_init(struct uavcan_iface_t *iface)
Initialize an uavcan interface.
static void actuators_uavcan_device_temperature_cb(struct uavcan_iface_t *iface, CanardRxTransfer *transfer)
Whevener an DEVICE_TEMPERATURE message from the EQUIPMENT group is received.
static uavcan_event actuator_status_ev
static struct actuators_uavcan_telem_t * actuators_uavcan_next_telem(void)
void actuators_uavcan_commit(struct uavcan_iface_t *iface, int16_t *values, uint8_t nb)
Commit actuator values to the uavcan interface (EQUIPMENT_ESC_RAWCOMMAND).
static void actuators_uavcan_esc_status_cb(struct uavcan_iface_t *iface, CanardRxTransfer *transfer)
Whevener an ESC_STATUS message from the EQUIPMENT group is received.
static uavcan_event device_temperature_ev
static void actuators_uavcan_actuator_status_cb(struct uavcan_iface_t *iface, CanardRxTransfer *transfer)
Whevener an ACTUATOR_STATUS message from the EQUIPMENT group is received.
static bool actuators_uavcan_initialized
static uint8_t old_idx
static uint8_t esc_idx
void actuators_uavcan_cmd_commit(struct uavcan_iface_t *iface, int16_t *values, uint8_t nb)
Commit actuator values to the uavcan interface (EQUIPMENT_ACTUATOR_ARRAYCOMMAND).
static struct actuators_uavcan_telem_t * get_actuator_telem(struct uavcan_iface_t *iface, uint8_t idx)
#define UAVCAN_CMD_UNUSED
static uint8_t get_actuator_idx(struct uavcan_iface_t *iface, uint8_t idx)
static uavcan_event esc_status_ev
static struct uart_periph * dev
struct Electrical electrical
Definition electrical.c:92
Interface for electrical status: supply voltage, current, battery status, etc.
Hardware independent API for actuators (servos, motor controllers).
int32_t rpm
RPM.
Definition actuators.h:54
bool position
Position is set.
Definition actuators.h:48
struct act_feedback_t::act_feedback_set_t set
Bitset registering what is set as feedback.
uint8_t power_pct
Power rating in percent.
Definition actuators.h:58
uint8_t idx
General index of the actuators (generated in airframe.h).
Definition actuators.h:45
float speed
In meter per second or radian per second.
Definition actuators.h:57
float force
In Newton or Newton metre.
Definition actuators.h:56
float position
In radians.
Definition actuators.h:55
bool power
Power rating is set.
Definition actuators.h:51
static uint32_t idx
#define MAX_PPRZ
Definition paparazzi.h:8
#define MIN_PPRZ
Definition paparazzi.h:9
void init_random(void)
Definition pprz_random.c:35
double rand_uniform(void)
Definition pprz_random.c:45
uint16_t rpm
Definition rpm_sensor.c:33
static float get_sys_time_float(void)
Get the time in seconds since startup.
Definition sys_time.h:241
int16_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint16_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Definition telemetry.c:51
Periodic telemetry system header (includes downlink utility and generated code).
#define DefaultPeriodic
Set default periodic telemetry.
Definition telemetry.h:66
void uavcan_broadcast(struct uavcan_iface_t *iface, uint64_t data_type_signature, uint16_t data_type_id, uint8_t priority, const void *payload, uint16_t payload_len)
Legacy function Broadcast an uavcan message to a specific interface.
Definition uavcan.c:345
void uavcan_bind(uint16_t data_type_id, uint64_t data_type_signature, uavcan_event *ev, uavcan_callback cb)
Bind to a receiving message from uavcan.
Definition uavcan.c:272
struct uavcan_event_t uavcan_event
Definition uavcan.h:98
static const float offset[]
int int32_t
Typedef defining 32 bit int type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
short int16_t
Typedef defining 16 bit short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
int transfer(const Mat *from, const image_t *to)