How to use UAVCAN?


I have a question about UAVCAN, so I leave a question.

Parameters related to UAVCAN include UAVCAN_ENABLE and UAVCAN_SUB_BAT parameters.

If I set both parameters to work and only get UAVCAN data through the CAN port, can I read the battery data from the px4 without any extra programming work?

Thank you.

1 Like

Yes, you can. If you enable both parameters and if you use a device that provides battery status messages over UAVCAN you will be able to see battery status in PX4.

p.s. Maybe you will also need to set BAT1_SOURCE to external (meaning is not using the board’s ADC but data from an external device).

1 Like

FYI DroneCAN (which is old UAVCAN0) setup is here: DroneCAN | PX4 User Guide

It doesn’t cover battery specifically, but does note the need for the UAVCAN_SUB_BAT parameter to be set.