PX4 CAN Receive block can't read the servo status via DroneCan

4 views (last 30 days)
Hello,
I refered to the below instruction to read a servo status via dronecan
For now, I just want to receive raw data to make sure the connection between the host pc and the pixhawk is correct. But I kept getting status of 4, which means connection is good but can't read the massage from the device.
Here is my setup
Hardware: pixhawk 6x
Data input: CAN Massage
sample time: 0.05 is default (I have tried 0.1. since the publish rate is 10hz in the servo setting)
ID type: 29 bit (for dronecan)
CAN Massage ID: 1011 to read status (DLDS from their website: https://legacy.uavcan.org/Specification/7._List_of_standard_data_types/ )
Length: 4 bytes
CAN Port: Can1
Baud rate: 500000
Node ID: 103
Acuator ID: 3
Anyone has idea on how to recieve can massage via PX4 Can recieve block ?

Answers (1)

Isha
Isha on 3 Sep 2025
Hello,
To receive CAN messages from the Pixhawk using the PX4 CAN Receive block in Simulink, first set the PX4 parameter “UAVCAN_ENABLE = 1” and reboot the Pixhawk.
Ensure your CAN wiring (CAN_H, CAN_L, GND) is correct.
In the Simulink CAN Receive block, Use the full message ID calculated as “(Subject_ID << 8) | Node_ID” (for actuator/servo status: 1011 << 8 | 3 = 259075), with a length of 4 bytes and a sample time matching your publish rate.
Verify that your actuator node is powered and publishing messages, and if needed, use a CAN analyzer to confirm bus activity.
If you still cannot receive messages, try configuring the block to receive any message to check general CAN communication, and double-check all parameters and connections.
Hope this helps.

Products


Release

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!