Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Ardupilot
GitHub Repository: Ardupilot/ardupilot
Path: blob/master/libraries/APM_Control/examples/AP_FW_Controller_test/TestMatrix.sh
4277 views
1
#!/usr/bin/env bash
2
# Fixedwing controller test and run over a range of inputs
3
# Output results to files for comparison
4
5
cd "$(dirname "$0")"
6
cd ../../../..
7
8
mkdir -p FW_Controller_matrix
9
10
./waf configure --board sitl
11
./waf build --target examples/AP_FW_Controller_test
12
echo
13
14
Axis="roll pitch"
15
RollAngle="-170 -160 -150 -140 -130 -120 -110 -100 -90 -80 -70 -60 -50 -40 -30 -20 10 0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180"
16
PitchAngle="-80 -70 -60 -50 -40 -30 -20 10 0 10 20 30 40 50 60 70 80"
17
Airspeed="5 10 15 20 25"
18
19
COUNTER=0
20
# Range of roll angles
21
for roll in $RollAngle; do
22
# Range of pitch angles
23
for pitch in $PitchAngle; do
24
# Both roll and piith
25
for ax in $Axis; do
26
# Range of airspeeds
27
for speed in $Airspeed; do
28
./build/sitl/examples/AP_FW_Controller_test axis=$ax roll=$roll pitch=$pitch airspeed=$speed > FW_Controller_matrix/$COUNTER.csv
29
let COUNTER++
30
done
31
32
# Airspeed failure
33
./build/sitl/examples/AP_FW_Controller_test axis=$ax roll=$roll pitch=$pitch airspeed_fail=1 > FW_Controller_matrix/$COUNTER.csv
34
let COUNTER++
35
36
# Ground mode and intergrator diable flags, only test at defualt airspeed
37
./build/sitl/examples/AP_FW_Controller_test axis=$ax roll=$roll pitch=$pitch ground_mode=1 > FW_Controller_matrix/$COUNTER.csv
38
let COUNTER++
39
40
./build/sitl/examples/AP_FW_Controller_test axis=$ax roll=$roll pitch=$pitch disable_integrator=1 > FW_Controller_matrix/$COUNTER.csv
41
let COUNTER++
42
43
./build/sitl/examples/AP_FW_Controller_test axis=$ax roll=$roll pitch=$pitch ground_mode=1 disable_integrator=1 > FW_Controller_matrix/$COUNTER.csv
44
let COUNTER++
45
done
46
done
47
done
48
49
50