Skip to content

Commit

Permalink
add px4maneuvers as submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
Stifael committed Oct 31, 2018
1 parent 52fc56a commit d1b857e
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,6 @@
path = cmake/configs/uavcan_board_ident
url = https://github.com/PX4/uavcan_board_ident.git
branch = master
[submodule "Tools/Maneuvers"]
path = Tools/Maneuvers
url = https://github.com/Stifael/px4maneuvers.git
1 change: 1 addition & 0 deletions Tools/Maneuvers
Submodule Maneuvers added at 00aebc
51 changes: 51 additions & 0 deletions Tools/maneuver.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash

script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo $script_dir
if [[ $1 == "-h" ]]; then
echo "Usage: maneuver [maneuver-name]"
exit 1
fi

build_dir=$script_dir/Maneuvers/build

# check if build folder exists
if [[ ! -d $build_dir ]]; then
echo "No build folder present"
echo "Do you want build Maneuvers?"
read -p "Continue (y/n)?" answer

if [[ $answer == [Yy] ]]; then
mkdir $build_dir
cd $build_dir
cmake ../src && make
cd $SCRIPT_DIR
else
exit
fi
fi

files=$build_dir/maneuvers/*
input=$build_dir/maneuvers/$1
# check if requeste maneuver exists
for f in $files
do
if [[ -x $f && ! -d $f && $f == $input ]]; then
maneuver=$1
fi
done

if [[ -z $maneuver ]]; then
echo "This maneuver does not exist."
echo "The available maneuvers are:"
for f in $files
do
if [[ -x $f && ! -d $f ]]; then
echo $(basename $f)
fi
done
exit
fi

# start requested maneuver
cd $build_dir && ./maneuvers/$maneuver udp://:14540

0 comments on commit d1b857e

Please sign in to comment.