SITL: add support for Plane SITL-on-hw

This commit is contained in:
Peter Barker 2022-05-23 14:06:18 +10:00 committed by Andrew Tridgell
parent 16883565e2
commit 488509353a
4 changed files with 129 additions and 3 deletions

View File

@ -9,6 +9,13 @@ Run the sitl-on-hw.sh script to compile and flash for MatekH743. Adjust for you
cd $HOME/ardupilot cd $HOME/ardupilot
./libraries/SITL/examples/on-hardware/sitl-on-hw.sh ./libraries/SITL/examples/on-hardware/sitl-on-hw.sh
Plane can also be simulated:
::
cd $HOME/ardupilot
./libraries/SITL/examples/on-hardware/sitl-on-hw.sh -v plane
## Configuring ## Configuring
Wipe the parameters on the board; this can be done with a mavlink command, or by setting the FORMAT_VERSION parameter to 0. Wipe the parameters on the board; this can be done with a mavlink command, or by setting the FORMAT_VERSION parameter to 0.

View File

@ -0,0 +1,51 @@
AHRS_EKF_TYPE 10
BATT_MONITOR 0
COMPASS_OFS_X 5
COMPASS_OFS_Y 13
COMPASS_OFS_Z -18
COMPASS_OFS2_X 5
COMPASS_OFS2_Y 13
COMPASS_OFS2_Z -18
THR_FAILSAFE 1
THR_FS_VALUE 950
RC7_OPTION 7
FLTMODE1 7
FLTMODE2 9
FLTMODE3 6
FLTMODE4 3
FLTMODE5 5
FLTMODE6 0
GPS_TYPE 100
INS_ACCOFFS_X 0.001
INS_ACCOFFS_Y 0.001
INS_ACCOFFS_Z 0.001
INS_ACCSCAL_X 1.001
INS_ACCSCAL_Y 1.001
INS_ACCSCAL_Z 1.001
INS_ACC2OFFS_X 0.001
INS_ACC2OFFS_Y 0.001
INS_ACC2OFFS_Z 0.001
INS_ACC2SCAL_X 1.001
INS_ACC2SCAL_Y 1.001
INS_ACC2SCAL_Z 1.001
SCHED_DEBUG 0
SIM_MAG1_DEVID 97539
SIM_BARO_RND 0
SIM_RATE_HZ 400
SCHED_LOOP_RATE 400
BRD_RTC_TYPES 2
SERVO3_MIN 1000
SERVO3_TRIM 1000
SERVO3_MAX 2000

View File

@ -0,0 +1,30 @@
env SIM_ENABLED 1
define INS_MAX_INSTANCES 2
define HAL_COMPASS_MAX_SENSORS 2
define HAL_NAVEKF2_AVAILABLE 0
define EK3_FEATURE_BODY_ODOM 0
define EK3_FEATURE_EXTERNAL_NAV 0
define EK3_FEATURE_DRAG_FUSION 0
define HAL_ADSB_ENABLED 0
define HAL_MOUNT_ENABLED 0
define HAL_PROXIMITY_ENABLED 0
define HAL_VISUALODOM_ENABLED 0
define HAL_GENERATOR_ENABLED 0
# define HAL_LOGGING_ENABLED 0
define HAL_CRSF_TELEM_ENABLED 0
#define OSD_ENABLED 0
define FRAME_HEXA 0
define FRAME_OCTA 0
define FRAME_DODECAHEXA 0
define FRAME_Y6 0
define FRAME_OCTAQUAD 0
define LANDING_GEAR_ENABLED 0
define HAL_MSP_OPTICALFLOW_ENABLED 0
define HAL_SUPPORT_RCOUT_SERIAL 0
define HAL_HOTT_TELEM_ENABLED 0
# define HAL_WITH_DSP 0
define HAL_HIGH_LATENCY2 0

View File

@ -9,9 +9,47 @@ BOARD=MatekH743
THISDIR=$(dirname $0) THISDIR=$(dirname $0)
VEHICLE="copter"
DEFAULTS_PATH=""
EXTRA_HWDEF=""
usage() {
echo "Usage: $0 [-v <plane|copter>] [-d DEFAULT_FILEPATH] [-b BOARDNAME]" >&2;
exit 1;
}
while getopts ":v:d:b:" o; do
case "${o}" in
v)
VEHICLE=${OPTARG}
[ "$VEHICLE" == "plane" ] || [ "$VEHICLE" == "copter" ] || usage
;;
d)
DEFAULTS_PATH=${OPTARG}
;;
b)
BOARD=${OPTARG}
;;
*)
usage
;;
esac
done
shift $((OPTIND-1))
if [ -z "${DEFAULTS_PATH}" ]; then
if [ "$VEHICLE" == "plane" ]; then
DEFAULTS_PATH="$THISDIR/plane-default.param"
EXTRA_HWDEF="$THISDIR/plane-extra-hwdef-sitl-on-hw.dat"
elif ["$VEHICLE" == "copter" ]; then
DEFAULTS_PATH="$THISDIR/default.param"
EXTRA_HWDEF="$THISDIR/extra-hwdef-sitl-on-hw.dat"
fi
fi
./waf configure \ ./waf configure \
--board=$BOARD \ --board=$BOARD \
--extra-hwdef="$THISDIR/extra-hwdef-sitl-on-hw.dat" \ --extra-hwdef="$EXTRA_HWDEF" \
--default-param="$THISDIR/default.param" --default-param="$DEFAULTS_PATH"
./waf copter --upload ./waf ${VEHICLE} --upload