Custom Matlab System Objects for use with PX4 Architecture (PX4 Serial Receive)
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Custom Matlab System that is modified copy of the PX4 Serial Receive Block wont build.
In an effort to change the way that the base PX4 serial receive block handles my incoming serial messages, I have found myself editing the very source code that makes this Matlab system object exist. Namely the px4.internal.block.SCIRead internal module. I have actually had great success in making a custom matlab system object that handles my messages the way that is needed for variable length data packets. However, this system object only runs in Connected I/O. I have made the neccesary edits to my code such that each component is compatible with simulink however I keep running into an issue with building the firmware. It will get through the entire process only to fail at the end and give me the error below which I have followed but to no avail.
Is there a way that a custom matlab system object for use in the PX4 simulink model can be used and built? I have a feeling it has something to do with some interdependencies somewhere else in the firmware. If the ability to create custom MATLAB System did exist it would give users an incredible level of power and customizability for custom flight code. I have attached my custom Matlab system, perhaps even the placement of this file in a special directory is all that is needed.The code I provided uses many of the same modules as the original PX4SCIRead and may be the reason I am running into this issue.
The location of the original matlab system reference for the PX4 Serial Receive block is located in:
C:\ProgramData\MATLAB\SupportPackages\R2023b\toolbox\target\supportpackages\px4\+px4\+internal\+block
ERROR:
Top model targets built:
Model Action Rebuild Reason
============================================================================
TEST_BED Failed Code generation information file does not exist.
0 of 1 models built (0 models already up to date)
Build duration: 0h 1m 16.031s
Error:Error copying generated code into Pixhawk firmware directory. Delete the files in the folder C:\PX4\home\Firmware\src\modules\px4_simulink_app manually and try building again.
0 commentaires
Réponses (1)
Ankur Bose
le 20 Fév 2025
Can you tell us why you needed to modify the source code for Serial block? If it was to read variable length buffer, I just posted a response to another question that you asked
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!