UAVCAN: Read servo telemetry over CAN bus and publish to uorb

This commit is contained in:
TedObrien
2026-01-27 11:26:37 +01:00
committed by Alexander Lerach
parent 0676647d8a
commit 2c0f0f1693
8 changed files with 279 additions and 2 deletions
+2
View File
@@ -212,6 +212,8 @@ set(msg_files
SensorTemp.msg
SensorUwb.msg
SensorAirflow.msg
ServoReport.msg
ServoStatus.msg
SystemPower.msg
TakeoffStatus.msg
TaskStackInfo.msg
+25
View File
@@ -0,0 +1,25 @@
uint64 timestamp # time since system start (microseconds)
uint8 servo_actuator_id # actuator id of current servo (in most cases 1-8)
uint8 servo_node_id # Node ID of device on CAN bus
float32 servo_position # meter or radian
float32 servo_force # Newton or Newton metre
float32 servo_speed # meter per second or radian per second
uint8 servo_power_rating_pct # 0 - unloaded, 100 - full load
uint8 servo_function # servo output function
float32 servo_temperature # in kelvin
uint8 servo_temperature_error_flags
uint8 ERROR_FLAG_OVERHEATING = 1
uint8 ERROR_FLAG_OVERCOOLING = 2
float32 servo_voltage # Volts
float32 servo_current # Amps
uint8 servo_power_error_flags
uint8 ERROR_FLAG_OVERVOLTAGE = 1
uint8 ERROR_FLAG_UNDERVOLTAGE = 2
uint8 ERROR_FLAG_OVERCURRENT = 4
uint8 ERROR_FLAG_UNDERCURRENT = 8
+28
View File
@@ -0,0 +1,28 @@
uint64 timestamp # time since system start (microseconds)
uint8 CONNECTED_SERVO_MAX = 8 # The number of SERVOs supported via UAVCAN
uint8 SERVO_CONNECTION_TYPE_PPM = 0 # Traditional PPM SERVO
uint8 SERVO_CONNECTION_TYPE_SERIAL = 1 # Serial Bus connected SERVO
uint8 SERVO_CONNECTION_TYPE_ONESHOT = 2 # One Shot PPM
uint8 SERVO_CONNECTION_TYPE_I2C = 3 # I2C
uint8 SERVO_CONNECTION_TYPE_CAN = 4 # CAN-Bus
uint8 SERVO_CONNECTION_TYPE_DSHOT = 5 # DShot
uint16 counter # incremented by the writing thread everytime new data is stored
uint16 temperature_counter # Incremented when new temperature data is stored
uint16 power_counter # Incremented when new power data is stored
uint8 servo_count # number of connected servo's
uint8 servo_connectiontype # how SERVOs connected to the system. Currently only CAN supports servo telemtry
uint8 servo_online_flags # Bitmask indicating which SERVO is online/offline
# servo_online_flags bit 0 : Set to 1 if SERVO0 is online
# servo_online_flags bit 1 : Set to 1 if SERVO1 is online
# servo_online_flags bit 2 : Set to 1 if SERVO2 is online
# servo_online_flags bit 3 : Set to 1 if SERVO3 is online
# servo_online_flags bit 4 : Set to 1 if SERVO4 is online
# servo_online_flags bit 5 : Set to 1 if SERVO5 is online
# servo_online_flags bit 6 : Set to 1 if SERVO6 is online
# servo_online_flags bit 7 : Set to 1 if SERVO7 is online
ServoReport[8] servo