How do I connect and read data from pixhawk 6x when using simulink/ UAVToolbox?
16 views (last 30 days)
Show older comments
I am trying to have a play around with simulink and the UAVToolbox but am having issues in simply connecting to the pixhawk.
During the hardware setup for PX4 in simulink, (building firmware, uploading, testing connection etc), I am unable to read accelerometer data, however the odd thing is that I AM able to build and upload the firmware. I am very confused as to why it can connect when uploading, but not when trying to read data. Additionally I dont have this problem when using things such as QGC.
As far as I am aware, the port for uploading is the same as reading (/dev/ttyACM0), regardless of this I have tried various ports and still no connection.
What do I need to do for this to connect and read from my pixhawk?
Note: I am trying to do this with pixhawk 6x as the target to be deployed in to a physical aircraft, NOT SITL or HITL, alot of the examples and tutorials cover only simulated scenarios and they are not helpful in my current situation, so please do not refer me to any of them unless it specifically refers to a connection issue like this, thank you.
System - Ubuntu 20.04
any help would be great,
thanks
4 Comments
Walter Roberson
on 6 Jan 2025
According to the information on that Question, Pixhawk 6x is fully supported as of R2023a. And if not then there are instructions at https://www.mathworks.com/matlabcentral/answers/1809440-pixhawk-6x-5x-6c-support-by-simulink#answer_1059220 for adding support.
Accepted Answer
More Answers (1)
Ankur Bose
on 15 Jan 2025
I believe you are running into a known issue where a newer version of the Pixhawk 6x board is only supported by the PX4 Firmware version 1.14.3. To workaround the issue. this is what I suggest
- Launch Windows subsystem for Linux (WSL) and in that navigate to your cloned directory of PX4.
- Run the below command in WSL
- git checkout v1.14.3 -f
- git submodule update --init --recursive
Once the above commands are completed, launch hardware setup screen from MATLAB again. In the "Validate PX4" screen, you might get a warning that the PX4 firmware version is not tested but you can ignore it for now and go ahead and finish the setup screen. After this you should be able to run and upload Simulink models
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!