Tools: script: add a script to generate Mission Planner full parameters file

This commit is contained in:
Pierre Kancir 2020-07-29 17:04:37 +02:00 committed by Andrew Tridgell
parent 4930142b6e
commit f2e6a79276
1 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,45 @@
#!/usr/bin/env bash
set -e
set -x
echo "Remove previous param file"
rm -f ParameterMetaDataBackup.xml
rm -f ParameterMetaData.xml
echo "Create first parameter file"
./Tools/autotest/param_metadata/param_parse.py --vehicle ArduCopter --format xml_mp
echo "Remove the last line"
sed -i -e '$d' ParameterMetaData.xml
echo "Copy parameters to the complete file"
cp ParameterMetaData.xml ParameterMetaDataBackup.xml
echo "Create the second parameter file"
./Tools/autotest/param_metadata/param_parse.py --vehicle ArduPlane --format xml_mp
echo "Remove the two first lines and the last one"
sed -i -e '1d' -e '2d' -e '$d' ParameterMetaData.xml
echo "Append parameters to the complete file"
cat ParameterMetaData.xml >> ParameterMetaDataBackup.xml
./Tools/autotest/param_metadata/param_parse.py --vehicle Rover --format xml_mp
echo "Remove the two first lines and the last one"
sed -i -e '1d' -e '2d' -e '$d' ParameterMetaData.xml
echo "Append parameters to the complete file"
cat ParameterMetaData.xml >> ParameterMetaDataBackup.xml
./Tools/autotest/param_metadata/param_parse.py --vehicle ArduSub --format xml_mp
echo "Remove the two first lines and the last one"
sed -i -e '1d' -e '2d' -e '$d' ParameterMetaData.xml
echo "Append parameters to the complete file"
cat ParameterMetaData.xml >> ParameterMetaDataBackup.xml
./Tools/autotest/param_metadata/param_parse.py --vehicle AntennaTracker --format xml_mp
echo "Remove the two first lines"
sed -i -e '1d' -e '2d' ParameterMetaData.xml
echo "Append parameters to the complete file"
cat ParameterMetaData.xml >> ParameterMetaDataBackup.xml
echo "Remove vehile param file"
rm -f ParameterMetaData.xml
echo "Rename complete param file"
mv ParameterMetaDataBackup.xml ParameterMetaData.xml