CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Ardupilot

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: Ardupilot/ardupilot
Path: blob/master/Tools/scripts/build_parameters.sh
Views: 1798
1
#!/usr/bin/env bash
2
3
set -e
4
set -x
5
6
if [ "x$BUILDLOGS" = "x" ]; then
7
BUILDLOGS="../buildlogs"
8
fi
9
PARAMS_DIR="$BUILDLOGS/Parameters"
10
11
# work from either APM directory or above
12
[ -d ArduPlane ] || cd APM
13
14
/bin/mkdir -p "$PARAMS_DIR"
15
16
generate_parameters() {
17
VEHICLE="$1"
18
19
# generate Parameters.html, Parameters.rst etc etc:
20
./Tools/autotest/param_metadata/param_parse.py --vehicle $VEHICLE
21
22
# stash some of the results away:
23
VEHICLE_PARAMS_DIR="$PARAMS_DIR/$VEHICLE"
24
mkdir -p "$VEHICLE_PARAMS_DIR"
25
/bin/cp Parameters.html *.pdef.xml "$VEHICLE_PARAMS_DIR/"
26
gzip -9 <"$VEHICLE_PARAMS_DIR"/apm.pdef.xml >"$VEHICLE_PARAMS_DIR"/apm.pdef.xml.gz.new && mv "$VEHICLE_PARAMS_DIR"/apm.pdef.xml.gz.new "$VEHICLE_PARAMS_DIR"/apm.pdef.xml.gz
27
xz -e <"$VEHICLE_PARAMS_DIR"/apm.pdef.xml >"$VEHICLE_PARAMS_DIR"/apm.pdef.xml.xz.new && mv "$VEHICLE_PARAMS_DIR"/apm.pdef.xml.xz.new "$VEHICLE_PARAMS_DIR"/apm.pdef.xml.xz
28
if [ -e "Parameters.rst" ]; then
29
/bin/cp Parameters.rst "$VEHICLE_PARAMS_DIR/"
30
fi
31
if [ -e "ParametersLatex.rst" ]; then
32
/bin/cp ParametersLatex.rst "$VEHICLE_PARAMS_DIR/"
33
fi
34
F="apm.pdef.json"
35
if [ -e "$F" ]; then
36
/bin/cp "$F" "$VEHICLE_PARAMS_DIR/"
37
pushd "$VEHICLE_PARAMS_DIR"
38
xz -e <"$F" >"$F.xz.new" && mv "$F.xz.new" "$F.xz"
39
popd
40
fi
41
}
42
43
generate_parameters ArduPlane
44
45
generate_parameters ArduCopter
46
47
generate_parameters Rover
48
49
generate_parameters ArduSub
50
51
generate_parameters AntennaTracker
52
53
generate_parameters AP_Periph
54
55
generate_parameters Blimp
56
57