-
Notifications
You must be signed in to change notification settings - Fork 0
/
ros_config_account.sh
executable file
·44 lines (38 loc) · 1.5 KB
/
ros_config_account.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# --------------------------------------------------------------
# Update the .bashrc file so that newly opened terminals will be
# configured correctly to work with a kinect-based turtlebot.
# --------------------------------------------------------------
if grep --quiet kinetic ~/.bashrc; then
printf ".bashrc already configured.\n"
else
printf "Configuring .bashrc\n"
printf "\n" >> ~/.bashrc
echo "export TURTLEBOT_3D_SENSOR=kinect" >> ~/.bashrc
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
printf "\n" >> ~/.bashrc
echo "if [ -e $HOME/catkin_ws/devel/setup.bash ]" >> ~/.bashrc
echo "then" >> ~/.bashrc
echo " source $HOME/catkin_ws/devel/setup.bash" >> ~/.bashrc
echo "fi" >> ~/.bashrc
fi
# --------------------------------------------------------------
# Source .bashrc so that *this* shell will be configured.
# --------------------------------------------------------------
source ~/.bashrc
# --------------------------------------------------------------
# Create and configure a catkin workspace, if necessary.
# --------------------------------------------------------------
WORKSPACE_SRC=$HOME"/catkin_ws/src/"
if [ ! -d $WORKSPACE_SRC ]; then
printf "\nCreating catkin workspace.\n"
mkdir -p $WORKSPACE_SRC
else
printf "\nCatkin workspace already created.\n"
fi
if [ ! -f $WORKSPACE_SRC"CMakeLists.txt" ]; then
printf "\nInitializing catkin workspace.\n"
cd $WORKSPACE_SRC
catkin_init_workspace
else
printf "\nCatkin workspace already configured.\n"
fi