Skip to content

Instantly share code, notes, and snippets.

@sandyUni
Created June 1, 2017 03:27
Show Gist options
  • Save sandyUni/c40325075bfd697944ea7067d420cb1e to your computer and use it in GitHub Desktop.
Save sandyUni/c40325075bfd697944ea7067d420cb1e to your computer and use it in GitHub Desktop.
setup communication node
#!/bin/bash
# setup augmavconn and libmavconn environment
# Author Lai Jun, <[email protected]>
# 2017.5.21
LibmavconnGit='https://git.oschina.net/smarteyes-comm/libmavconn.git'
augmavconnGit='https://git.oschina.net/smarteyes-comm/augmavconn.git'
CommunicationGit='https://git.oschina.net/smarteyes-comm/communication.git'
p=$(pwd)
WS_ROOT=$p/catkin_libaugmavconn_ws
echo "Current folder: $p"
echo "Will create workspace in $WS_ROOT"
if [ -e $WS_ROOT ]
then
echo "There already is expected folder, exit"
else
mkdir -p $WS_ROOT/src
cd $WS_ROOT/src
git clone $LibmavconnGit
git clone $augmavconnGit
if [ ! -e $WS_ROOT/src/libmavconn -o ! -e $WS_ROOT/src/augmavconn ]
then
echo "Seems you can't download the repos correctly, check your Internet connection or your permission"
else
cd ../
catkin_make
if [ $? -eq 0 ]
then
source ./devel/setup.bash
echo "enjoy"
echo "Besides, if you can find libmavconn and augmavconn correctly through roscd. You can change your work folder, and try again. Only god kown what happens."
cd $p
WS_ROOT_Com=$p/catkin_communication_ws
if [ -e $WS_ROOT_Com ]
then
echo "There already is expected folder, exit"
else
mkdir -p $WS_ROOT_Com/src
cd $WS_ROOT_Com/src
git clone $CommunicationGit
if [ ! -e $WS_ROOT_Com/src/communication ]
then
echo "Seems you can't download the repos correctly, check your Internet connection or your permission"
else
cd ../
catkin_make
if [ $? -eq 0 ]
then
source ./devel/setup.bash
echo "enjoy your communication, you can just type roslaunch blah blah"
echo "Besides, if you can find libmavconn and augmavconn correctly through roscd. You can change your work folder, and try again. Only god kown what happens."
else
echo "Something is wrong"
fi
fi
fi
else
echo "Something is wrong"
fi
fi
fi
cd $p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment