UAV Toolbox Support Package for PX4 Autopilots - px4_simulink_app module
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Jae Won Han
el 1 de Feb. de 2023
Comentada: Jae Won Han
el 10 de Feb. de 2023
I have successfully built and deployed the px4 controller on pixhawk4 via simulink. Also added rc.txt to SD Card's etc folder.
When I tried to connect Pixhawk4 to QGroundControl without any additional work, it was disconnected and unable to connect.
For reference, I added the following two lines to the end of rc.txt, so I was able to connect Pixhawk4 to QGroundControl.
mavlink start -d /dev/ttyACM0 -m config –x
mavlink boot_complete
At this point, I had my doubts. I know that if the rc.txt file is added to the SD card and the Simulink controller is built and deployed, the px4_simulink_app module, not the mc_attitude_control and mc_position_control modules, is executed without any additional work. But how can I make sure that it activates px4_simulink_app when linked to QGroundControl?
0 comentarios
Respuesta aceptada
Ankur Bose
el 3 de Feb. de 2023
Editada: Ankur Bose
el 3 de Feb. de 2023
Before I answer your question, let me clarify that the "PX4 default startup script rcS" is the recommended option for booting up modules compared to custom startup script rc.txt option from R2020b release. The custom startup script option is difficult to scale for functionalities with other modules.
Now coming to your question, I guess your question is how to ensure Pixhawk connects to QGC after deploying to Simulink. You dont need to add any mavlink specific line in rc.txt like you did. You can follow the below documentation to enable MAVLink communication before deploying the controller.
Basically, the selection "Enable MAVLink over USB" ensures that px4_simulink_app is generated with MAVLink communication enabled and hence it will connect to QGC after deployment.
Note that this option will not work with External Mode simulation as both are trying to connect over "/dev/tyACM0". If you need External Mode option, you need to disable this checkbox
0 comentarios
Más respuestas (2)
Arun Mathamkode
el 3 de Feb. de 2023
The modules you are adding to the rc.txt will be started after the board bootup, irrespective of whether you have connected QGroundControl or not. So if you have the px4_simulink_app start command added in the rc.txt, px4_simulink_app will be started after the bootup. It is not very clear to me what you meant by 'activates', if you are referring to making sure the module is running you can verify it through the System Console or MAVLink NSH Console in QgroundControl. Use the px4_simulink_app status command for this.
0 comentarios
Jae Won Han
el 6 de Feb. de 2023
2 comentarios
Arun Mathamkode
el 7 de Feb. de 2023
The 'px4_simulink_app' will be added in '<px4_firmware_root>\Firmware\boards\px4\fmu-v4\init\rc.board_extras' file. You can open this file and check. The rcS file will be referring to rc.board_extras. The rcS file is located at '<px4_firmware_root>\ROMFS\px4fmu_common\init.d\rcS'. To make sure the px4_simulink_app module is running in the board, you can use System Console or MAVLink NSH Console in QgroundControl. Use the px4_simulink_app status command for this.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!