Error in PX4 SITL with UAV Toolbox Support Package for PX4 Autopilots

9 次查看(过去 30 天)
I'm performing SITL on Windows 11 with jmavsim using UAV Toolbox Support Package for PX4 Autopilots but I got an error:
On the diagnostic view I got:
Top model targets built: Model Action Rebuild Reason ==================================================================================
openloop_2022b Code generated. Global variable px4_Bus_actuator_armed changed. 1 of 1 models built (0 models already up to date) Build duration: 0h 2m 11.97s
action: EXT_INIT Creating Target Handler (XCP on TCP/IP)... Build directory: D:\model validation\matlab2022b\openloop_2022b_ert_rtw Target name: 127.0.0.1 Target port: 17725 action: EXT_CONNECT Connecting to the target...
External Mode Open Protocol Connect command failed
Caused by:
  • Could not connect to target application: XCP TCP/IP error: Connect failed
Component:Simulink | Category:Block diagram error
Unable to connect to the 'PX4 Host Target' target for 'openloop_2022b'.
On the cmd, I got:

采纳的回答

Thiago Felippe
Thiago Felippe 2023-9-20
I had the same problem. I found the following workaround:
  • Click in "Monitor & Tune"
  • Wait for the Simulink error. Wait a little more.
  • Don't close the command window nor the jMAVSim
  • Go in the down arrow in "Monitor & Tune" and change it to "Connect" (under "Step by Step Commands"). See image below:
  • Wait until the connection is made
  • Click in "Start" (it shows in place of "Monitor & Tune"). See image below:
  • And it is done!
I think the Simulink doesn't wait to PX4 Host Target to fully boot up before trying to communicate with it.

更多回答(0 个)

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by