sitl: add generic way to override params via ENV variables

This commit is contained in:
Beat Küng
2023-09-04 13:44:31 +02:00
parent 3bde706cb3
commit bbcd153e94
2 changed files with 14 additions and 1 deletions

View File

@@ -126,6 +126,15 @@ then
set AUTOCNF yes
fi
# Allow overriding parameters via env variables: export PX4_PARAM_{name}={value}
env | while IFS='=' read -r line; do
value=${line#*=}
name=${line%%=*}
case $name in
"PX4_PARAM_"*) param set "${name#PX4_PARAM_}" "$value" ;;
esac
done
# multi-instance setup
# shellcheck disable=SC2154
param set MAV_SYS_ID $((px4_instance+1))

View File

@@ -14,7 +14,11 @@
"model": "iris",
"vehicle": "iris",
"test_filter": "[offboard_attitude]",
"timeout_min": 10
"timeout_min": 10,
"env": {
"PX4_PARAM_EKF2_EN": 0,
"PX4_PARAM_ATT_EN": 1
}
},
{
"model": "standard_vtol",