forked from PX4/PX4-Autopilot
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for hitl testing for vtol and fw
On branch adding_hitl_testing_for_vtol_and_fw Changes to be committed: new file: ROMFS/px4fmu_common/init.d/airframes/1404_ssrc_standard_vtol.hil new file: ROMFS/px4fmu_common/init.d/airframes/1440_ssrc_skywalker_x8.hil modified: ROMFS/px4fmu_common/init.d/airframes/CMakeLists.txt modified: ROMFS/px4fmu_common/init.d/rc.hitl_testing modified: Tools/simulation/gz/hitl_run.sh new file: Tools/simulation/gz/models/ssrc_skywalker_x8/model_hitl.sdf modified: Tools/simulation/gz/plugins/px4-gzsim-plugins modified: boards/ssrc/saluki-v2 modified: src/modules/simulation/simulator_mavlink/sitl_targets_gz-sim.cmake modified: test/mavsdk_tests/CMakeLists.txt modified: test/mavsdk_tests/configs/hitl_gz_harm.json new file: test/mavsdk_tests/fw_mission.plan modified: test/mavsdk_tests/mavsdk_test_runner.py new file: test/mavsdk_tests/test_fw_mission.cpp Updated sitl config Changes to be committed: modified: ROMFS/px4fmu_common/init.d/airframes/1440_ssrc_skywalker_x8.hil modified: Tools/simulation/gz/hitl_run.sh modified: test/mavsdk_tests/configs/sitl_gz_harm.json
- Loading branch information
1 parent
0496537
commit e9a9626
Showing
14 changed files
with
394 additions
and
11 deletions.
There are no files selected for viewing
97 changes: 97 additions & 0 deletions
97
ROMFS/px4fmu_common/init.d/airframes/1404_ssrc_standard_vtol.hil
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
#!/bin/sh | ||
# | ||
# @name Standard VTOL | ||
# | ||
# @type Standard VTOL | ||
# | ||
# @class VTOL | ||
|
||
. ${R}etc/init.d/rc.vtol_defaults | ||
. ${R}etc/init.d/rc.hitl_testing | ||
|
||
# Default rates | ||
param set-default CA_AIRFRAME 2 | ||
|
||
param set-default CA_ROTOR_COUNT 5 | ||
param set-default CA_ROTOR0_PX 0.1515 | ||
param set-default CA_ROTOR0_PY 0.245 | ||
param set-default CA_ROTOR0_KM 0.05 | ||
param set-default CA_ROTOR1_PX -0.1515 | ||
param set-default CA_ROTOR1_PY -0.1875 | ||
param set-default CA_ROTOR1_KM 0.05 | ||
param set-default CA_ROTOR2_PX 0.1515 | ||
param set-default CA_ROTOR2_PY -0.245 | ||
param set-default CA_ROTOR2_KM -0.05 | ||
param set-default CA_ROTOR3_PX -0.1515 | ||
param set-default CA_ROTOR3_PY 0.1875 | ||
param set-default CA_ROTOR3_KM -0.05 | ||
param set-default CA_ROTOR4_AX 1.0 | ||
param set-default CA_ROTOR4_AZ 0.0 | ||
param set-default CA_ROTOR4_PX 0.2 | ||
|
||
# HITL PWM functions | ||
param set-default HIL_ACT_FUNC1 101 | ||
param set-default HIL_ACT_MIN1 10 | ||
param set-default HIL_ACT_MAX1 1500 | ||
param set-default HIL_ACT_FUNC2 102 | ||
param set-default HIL_ACT_MIN2 10 | ||
param set-default HIL_ACT_MAX2 1500 | ||
param set-default HIL_ACT_FUNC3 103 | ||
param set-default HIL_ACT_MIN3 10 | ||
param set-default HIL_ACT_MAX3 1500 | ||
param set-default HIL_ACT_FUNC4 104 | ||
param set-default HIL_ACT_MIN4 10 | ||
param set-default HIL_ACT_MAX4 1500 | ||
param set-default HIL_ACT_FUNC5 105 | ||
param set-default HIL_ACT_MIN5 0 | ||
param set-default HIL_ACT_MAX5 3500 | ||
param set-default HIL_ACT_FUNC6 201 | ||
param set-default HIL_ACT_DIS6 500 | ||
param set-default HIL_ACT_FUNC7 202 | ||
param set-default HIL_ACT_DIS7 500 | ||
param set-default HIL_ACT_FUNC8 203 | ||
param set-default HIL_ACT_DIS8 500 | ||
|
||
|
||
param set-default ASPD_PRIMARY 1 | ||
|
||
param set-default CA_SV_CS_COUNT 3 | ||
param set-default CA_SV_CS0_TYPE 1 | ||
param set-default CA_SV_CS0_TRQ_R -0.5 | ||
param set-default CA_SV_CS1_TYPE 2 | ||
param set-default CA_SV_CS1_TRQ_R 0.5 | ||
param set-default CA_SV_CS2_TYPE 3 | ||
param set-default CA_SV_CS2_TRQ_P 1.0 | ||
param set-default CA_SV_CS3_TRQ_Y 0.0 | ||
param set-default CA_SV_CS3_TYPE 0 | ||
|
||
param set-default FW_PR_FF 0.2 | ||
param set-default FW_PR_P 0.9 | ||
param set-default FW_PSP_OFF 2 | ||
param set-default FW_P_LIM_MIN -15 | ||
param set-default FW_RR_FF 0.1 | ||
param set-default FW_RR_P 0.3 | ||
param set-default FW_THR_TRIM 0.25 | ||
param set-default FW_THR_MAX 0.6 | ||
param set-default FW_THR_MIN 0.05 | ||
param set-default FW_T_CLMB_MAX 8 | ||
param set-default FW_T_SINK_MAX 2.7 | ||
param set-default FW_T_SINK_MIN 2.2 | ||
|
||
param set-default MC_AIRMODE 1 | ||
param set-default MC_ROLLRATE_P 0.3 | ||
param set-default MC_YAW_P 1.6 | ||
|
||
param set-default MIS_TAKEOFF_ALT 10 | ||
|
||
param set-default MPC_XY_P 0.8 | ||
param set-default MPC_XY_VEL_P_ACC 3 | ||
param set-default MPC_XY_VEL_I_ACC 4 | ||
param set-default MPC_XY_VEL_D_ACC 0.1 | ||
|
||
param set-default NAV_ACC_RAD 5 | ||
|
||
param set-default VT_FWD_THRUST_EN 4 | ||
param set-default VT_F_TRANS_THR 0.75 | ||
param set-default VT_TYPE 2 | ||
param set-default FD_ESCS_EN 0 |
83 changes: 83 additions & 0 deletions
83
ROMFS/px4fmu_common/init.d/airframes/1440_ssrc_skywalker_x8.hil
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
#!/bin/sh | ||
# | ||
# @name SSRC Skywalker X8 | ||
# | ||
# @type Flying Wing | ||
# @class Plane | ||
# | ||
|
||
. ${R}etc/init.d/rc.fw_defaults | ||
. ${R}etc/init.d/rc.hitl_testing | ||
|
||
# Control allocator parameters | ||
param set-default CA_AIRFRAME 1 | ||
param set-default CA_ROTOR_COUNT 1 | ||
param set-default CA_SV_CS_COUNT 2 | ||
param set-default CA_SV_CS0_TYPE 5 | ||
param set-default CA_SV_CS0_TRQ_P 0.5 | ||
param set-default CA_SV_CS0_TRQ_R -0.5 | ||
param set-default CA_SV_CS1_TYPE 6 | ||
param set-default CA_SV_CS1_TRQ_P 0.5 | ||
param set-default CA_SV_CS1_TRQ_R 0.5 | ||
|
||
# HITL PWM functions | ||
param set-default HIL_ACT_FUNC1 201 | ||
param set-default HIL_ACT_DIS1 500 | ||
param set-default HIL_ACT_FUNC2 202 | ||
param set-default HIL_ACT_DIS2 500 | ||
param set-default HIL_ACT_FUNC4 101 | ||
param set-default HIL_ACT_MIN4 150 | ||
param set-default HIL_ACT_MAX4 1000 | ||
|
||
# Airspeed parameters | ||
param set-default ASPD_PRIMARY 1 | ||
param set-default FW_AIRSPD_MAX 22.0 | ||
param set-default FW_AIRSPD_MIN 14.0 | ||
param set-default FW_AIRSPD_STALL 12.0 | ||
param set-default FW_AIRSPD_TRIM 18.0 | ||
|
||
# Maximum landing slope angle in deg | ||
param set-default FW_LND_ANG 8 | ||
|
||
# RC loss failsafe to HOLD mode | ||
param set-default COM_RC_IN_MODE 1 | ||
|
||
# Maximum manual roll angle | ||
param set-default FW_MAN_R_MAX 60.0 | ||
|
||
# Fixed wing control | ||
# Pitch rate | ||
param set-default FW_PR_P 0.9 | ||
param set-default FW_PR_FF 0.5 | ||
param set-default FW_PR_I 0.5 | ||
param set-default TRIM_PITCH -0.15 | ||
# Pitch angle in deg | ||
param set-default FW_PSP_OFF 0 | ||
param set-default FW_P_LIM_MIN -15 | ||
# Roll rate | ||
param set-default FW_RR_FF 0.5 | ||
param set-default FW_RR_P 0.3 | ||
param set-default FW_RR_I 0.5 | ||
# Yaw rate | ||
param set-default FW_YR_FF 0.5 | ||
param set-default FW_YR_P 0.6 | ||
param set-default FW_YR_I 0.5 | ||
#Throttle limit | ||
param set-default FW_THR_MAX 0.6 | ||
param set-default FW_THR_MIN 0.05 | ||
param set-default FW_THR_TRIM 0.25 | ||
# Climb and sink rate | ||
param set-default FW_T_CLMB_MAX 8 | ||
param set-default FW_T_SINK_MAX 2.7 | ||
param set-default FW_T_SINK_MIN 2.2 | ||
|
||
# Navigation | ||
param set-default NAV_ACC_RAD 15 | ||
param set-default NAV_DLL_ACT 2 | ||
|
||
# Misc | ||
param set-default RTL_RETURN_ALT 30.0 | ||
param set-default RTL_DESCEND_ALT 30.0 | ||
param set-default FW_LND_USETER 0 | ||
param set-default RWTO_TKOFF 1 | ||
param set-default FD_ESCS_EN 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
Tools/simulation/gz/models/ssrc_skywalker_x8/model_hitl.sdf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<sdf version='1.9'> | ||
<model name='ssrc_skywalker_x8_hitl'> | ||
<include merge='true'> | ||
<uri>model://ssrc_skywalker_x8</uri> | ||
</include> | ||
<plugin filename="libmavlink_hitl_gazebosim.so" name="mavlink_interface::GazeboMavlinkInterface"> | ||
<robotNamespace/> | ||
<imuSubTopic>/link/base_link/sensor/imu_sensor/imu</imuSubTopic> | ||
<poseSubTopic>/pose/info</poseSubTopic> | ||
<mavlink_addr>192.168.200.101</mavlink_addr> | ||
<mavlink_udp_local_port>14542</mavlink_udp_local_port> | ||
<mavlink_udp_remote_port>14543</mavlink_udp_remote_port> | ||
<mavlink_tcp_port>4560</mavlink_tcp_port> | ||
<use_tcp>0</use_tcp> | ||
</plugin> | ||
</model> | ||
</sdf> |
Submodule px4-gzsim-plugins
updated
5 files
+3 −3 | include/common.h | |
+18 −7 | include/gazebo_mavlink_interface.h | |
+2 −1 | include/mavlink_interface.h | |
+150 −44 | src/gazebo_mavlink_interface.cpp | |
+10 −8 | src/mavlink_interface.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.