mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2025-12-07 01:37:07 +08:00
sitl: add generic way to override params via ENV variables
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user