Implement simple HITL simulation PX4

조회 수: 2 (최근 30일)
Paolo
Paolo 2022년 10월 10일
Hello, I'm trying to understand how to implement a simple HITL simulation using PX4 and UAV Toolbox Support Package for PX4 Autopilots. In particular I want to run the example Position Tracking for X-Configuration Quadcopter - MATLAB & Simulink Example - MathWorks Italia but instead of having a PX4 Host Target as hardware board I have a Pixracer R15. Is this possible?
If this isn't possible how can I implement a HITL simulation by specify with Simulink the reference trajectories for my quadcopter instead of usign QGroundControl and specify a simple trajectory to follow?
Thanks in advance.

답변 (1개)

Arun Mathamkode
Arun Mathamkode 2022년 10월 11일
Specifying simple setpoints from Simulink is implemented in HITL with Simulink plant example. In the model 'Quadcopter_ControllerWithNavigation' open the Navigation subsystem. Different navigation logics are implemented here including the one with specifying setpoints from Simulink using variant subsystem.
Enable the 'Manual Waypoints from Simulink Dashboard' subsystem by assigning guidanceType = 2. Now the controller will read setpoints from Simulink instead of QGC.
  댓글 수: 2
Paolo
Paolo 2022년 10월 11일
Hi @Arun Mathamkode, thanks for the reply. I saw the example, I wanted to know if there is a way to do this with JMAVSim. I changed the Simulator parameter to JMAVSim in HardwareSettings > Hardware Implementation > Target Hardware Resources > HITL but if I run the command Build, Deploy & Start JMAVSim doesn't start but I don't have any error. Is possible to run JMAVSim with HITL only in Monitor & Tune mode?
MathWorks Embedded Coder Team
MathWorks Embedded Coder Team 2022년 12월 1일
Is HITL selected in HardwareSettings > Hardware Implementation > Target Hardware Resources > HITL? Are you using Model references?

댓글을 달려면 로그인하십시오.

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by