Unable to run example PX4 in Hardware-in-the-Loop (HITL) Simulation with jMAVSim Simulator
조회 수: 5 (최근 30일)
이전 댓글 표시
Hello, when I run the example PX4 in Hardware-in-the-Loop (HITL) Simulation with jMAVSim Simulator - MATLAB & Simulink - MathWorks Italia I get the following error:
Top model targets built: Model Action Rebuild Reason ================================================================================== px4demo_QGCWaypointFollower_hitl Code generated. Incremental checksum changed. 1 of 1 models built (0 models already up to date) Build duration: 0h 3m 27.816s
action: EXT_INIT Creating Target Handler (XCP on Serial)... Build directory: C:\Users\paolo\OneDrive\Documenti\Tesi_magistrale\px4demo_QGCWaypointFollower_hitl_ert_rtw Serial Port Name: COM4 Baud Rate: 1152000 action: EXT_CONNECT Connecting to the target...
External Mode Open Protocol Connect command failed
Caused by:
- Could not connect to target application: XCP internal error: timeout expired, in response to XCP CONNECT command
Component:Simulink | Category:Block diagram error
And JMAVSim doesn't open.
The build is ok, but seems somthing is wrong with the connection. My setup is:
- Pixracer R15
- Serial-to-USB FTDI converter
- Micro USB type-B cable
The port setup is show in photo, I have serial port COM3 e COM4. ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1152553/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1152553/image.jpeg)
And this is my hardware settings:
- Build options > Automatically determine serial port for firmwareupload √
- Enable HITL Mode > Simulator: JMAVSim √
- External mode > Hardware board serial port: /dev/tty/S1
- External mode > Host serial port: COM4
- MAVLink > Enable MAVLink on /dev/ttyACM0 √
- /dev/ttyS1 > Baud rate : 1152000
댓글 수: 0
채택된 답변
Arun Mathamkode
2022년 10월 12일
MAVLink is enabled by default over TELEM1 (I am assuming /dev/tty/S1 is TELEM1 in your case) for QGC connectivity. This can cause conflict when we are trying to write data to same serial port from Simulink as well. Ensure MAV_0_CONFIG is set to 0 for disabling MAVLink over TELEM1 or consider using TELEM2 or any other free serial port.
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!