px4-jsbsim-bridge
px4-jsbsim-bridge copied to clipboard
Add support for HIL
Describe problem solved by this pull request
With reference to PR # 28 for enabling HITL with JSBSim bridge, this uses the modifications from that PR and further builds on it to successfully run HITL for Rascal with JSBSim Bridge. Using that PR directly resulted in takeoff issues which have now been resolved.
Steps for HITL
- Change the mixer file referenced in
1000_rc_fw_easystar.hil
toplane_sitl.main.mix
required by rascal. - Build and upload the code on hardware. Select the HILStar airframe from QGC.
- Build the jsbsim bridge with
make px4_sitl jsbsim
. - Change the directory to the location of build of jsbsim bridge. It is usually
PX4-Autopilot/build/px4_sitl_default/build_jsbsim_bridge
. - From the above directory, run the following command:
HEADLESS=1 ./jsbsim_bridge rascal -d /dev/ttyACM0 -s ~/13.2/PX4-Autopilot/Tools/jsbsim_bridge/scene/LSZH.xml
Where:
- rascal is the name of config file.
- -d specifies the port of connected hardware.
- -s specifies the path of the scene file.
- From QGC, upload the vehicle specific and HIL parameters provided here. rascal_hitl.zip
- Now simply command the vehicle through QGC as required.
Testing
The method has been successfully tested on Pixhawk 4 with PX4 v1.13.2. A screenshot of the vehicle in mission mode is shown below:
The log file is here.