How do I add custom uORB topics when using "UAV Toolbox Support Package for PX4 Autopilots"?

20 views (last 30 days)
I am working with the PX4 support toolbox in order to design a flight controller for Cube Orange hardware. I successfully compiled a model and flashed it to the Cube Orange.
However, after this, I wanted to include an additional uORB topic to interface with a special sensor unit. For this, I defined a customized uORB topic and added it to the CMake file under Firmware/msg. Back in Simulink, I tried to access this uORB topic with the uORB Read Block, however, I only got an error message. But now, no matter which uORB topic I access, I only get an error message even for topics which clearly are defined as standards in PX4 such as the sensor_combined topic:
Error evaluating 'MaskParameterCallback' callback of PX4 uORB Read block
(mask) 'sacs_mod_pixhawk/Read EKF/PX4 uORB Read1'. Callback string is
'px4.internal.block.SubscribeBlockMask.dispatch('topicEdit', gcb);'
"sensor_combined" is not a valid uORB topic name.
Now I cannot use the uORB Read block anymore, the according busses are not defined, and whenever I open the blocks the aforementioned error message is shown. It seems to me, that MATLAB is searching for the busses but cannot find them. How can I solve this problem?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 14 Jun 2023
This workflow can be supported but with limitations - adding a custom uORB topic will break the "Connected IO" simulation support. If your are okay with that, you can follow the below steps to add a custom uORB message:
1.    Add the message in CMake file under the Firmware/msg folder
2.    Re-run the hardware setup app for the Cube Orange hardware.
3.    Go to Simulink and select the custom uORB message or any other message.
The error message above indicates that the hardware setup screens need to be re-run if you decide to update the custom uORB topic that you added.

More Answers (0)

Tags

No tags entered yet.

Products


Release

R2023a

Community Treasure Hunt

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

Start Hunting!