![]() |
Paparazzi UAS
v6.2.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
UAVCan actuators using RAWCOMMAND message and ESC_STATUS telemetry. More...
#include "actuators_uavcan.h"
#include "modules/energy/electrical.h"
#include "math/pprz_random.h"
#include "modules/datalink/telemetry.h"
Go to the source code of this file.
Data Structures | |
struct | actuators_uavcan_telem_t |
Macros | |
#define | UAVCAN_ACTUATORS_USE_CURRENT TRUE |
#define | UAVCAN_EQUIPMENT_ESC_STATUS_ID 1034 |
#define | UAVCAN_EQUIPMENT_ESC_STATUS_SIGNATURE (0xA9AF28AEA2FBB254ULL) |
#define | UAVCAN_EQUIPMENT_ESC_STATUS_MAX_SIZE ((110 + 7)/8) |
#define | UAVCAN_EQUIPMENT_ESC_RAWCOMMAND_ID 1030 |
#define | UAVCAN_EQUIPMENT_ESC_RAWCOMMAND_SIGNATURE (0x217F5C87D7EC951DULL) |
#define | UAVCAN_EQUIPMENT_ESC_RAWCOMMAND_MAX_SIZE ((285 + 7)/8) |
Functions | |
static void | actuators_uavcan_send_esc (struct transport_tx *trans, struct link_device *dev) |
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. More... | |
void | actuators_uavcan_init (struct uavcan_iface_t *iface) |
Initialize an uavcan interface. More... | |
void | actuators_uavcan_commit (struct uavcan_iface_t *iface, int16_t *values, uint8_t nb) |
Commit actuator values to the uavcan interface. More... | |
Variables | |
static bool | actuators_uavcan_initialized = false |
static uavcan_event | esc_status_ev |
UAVCan actuators using RAWCOMMAND message and ESC_STATUS telemetry.
Definition in file actuators_uavcan.c.
struct actuators_uavcan_telem_t |
Definition at line 37 of file actuators_uavcan.c.
Data Fields | ||
---|---|---|
float | current | |
uint32_t | energy | |
int32_t | rpm | |
float | temperature | |
float | voltage |
#define UAVCAN_ACTUATORS_USE_CURRENT TRUE |
Definition at line 33 of file actuators_uavcan.c.
#define UAVCAN_EQUIPMENT_ESC_RAWCOMMAND_ID 1030 |
Definition at line 60 of file actuators_uavcan.c.
#define UAVCAN_EQUIPMENT_ESC_RAWCOMMAND_MAX_SIZE ((285 + 7)/8) |
Definition at line 62 of file actuators_uavcan.c.
#define UAVCAN_EQUIPMENT_ESC_RAWCOMMAND_SIGNATURE (0x217F5C87D7EC951DULL) |
Definition at line 61 of file actuators_uavcan.c.
#define UAVCAN_EQUIPMENT_ESC_STATUS_ID 1034 |
Definition at line 55 of file actuators_uavcan.c.
#define UAVCAN_EQUIPMENT_ESC_STATUS_MAX_SIZE ((110 + 7)/8) |
Definition at line 57 of file actuators_uavcan.c.
#define UAVCAN_EQUIPMENT_ESC_STATUS_SIGNATURE (0xA9AF28AEA2FBB254ULL) |
Definition at line 56 of file actuators_uavcan.c.
void actuators_uavcan_commit | ( | struct uavcan_iface_t * | iface, |
int16_t * | values, | ||
uint8_t | nb | ||
) |
Commit actuator values to the uavcan interface.
Definition at line 198 of file actuators_uavcan.c.
References offset, uavcan_broadcast(), UAVCAN_EQUIPMENT_ESC_RAWCOMMAND_ID, UAVCAN_EQUIPMENT_ESC_RAWCOMMAND_MAX_SIZE, and UAVCAN_EQUIPMENT_ESC_RAWCOMMAND_SIGNATURE.
|
static |
Whevener an ESC_STATUS message from the EQUIPMENT group is received.
Definition at line 121 of file actuators_uavcan.c.
References actuators_uavcan_telem_t::current, Electrical::current, electrical, actuators_uavcan_telem_t::energy, rpm, actuators_uavcan_telem_t::temperature, transfer(), and actuators_uavcan_telem_t::voltage.
Referenced by actuators_uavcan_init().
void actuators_uavcan_init | ( | struct uavcan_iface_t * | iface | ) |
Initialize an uavcan interface.
Definition at line 174 of file actuators_uavcan.c.
References actuators_uavcan_esc_status_cb(), actuators_uavcan_initialized, actuators_uavcan_send_esc(), DefaultPeriodic, esc_status_ev, init_random(), register_periodic_telemetry(), uavcan_bind(), UAVCAN_EQUIPMENT_ESC_STATUS_ID, and UAVCAN_EQUIPMENT_ESC_STATUS_SIGNATURE.
|
static |
Definition at line 71 of file actuators_uavcan.c.
References actuators_uavcan_telem_t::current, dev, electrical, actuators_uavcan_telem_t::energy, offset, rand_uniform(), actuators_uavcan_telem_t::rpm, rpm, actuators_uavcan_telem_t::voltage, and Electrical::vsupply.
Referenced by actuators_uavcan_init().
|
static |
Definition at line 65 of file actuators_uavcan.c.
Referenced by actuators_uavcan_init().
|
static |
Definition at line 66 of file actuators_uavcan.c.
Referenced by actuators_uavcan_init().