This repository has been archived by the owner on May 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
control_robot.sh
47 lines (44 loc) · 1.5 KB
/
control_robot.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
45
46
47
#!/usr/bin/env bash
print_help()
{
echo "Usage: $0 <action>"
echo ""
echo " Available actions:"
echo " - enable_core"
echo " - enable_zed"
echo " - enable_kinect"
echo " - enable_turtlebot"
echo " - enable_turtlebot_keyboard"
echo " - enable_stereo_slam"
echo " - enable_rgbd_slam"
}
if [ "$#" -lt "1" ]; then
print_help
exit
fi
if [ "$1" = "enable_core" ]; then
ps -e | grep roscore -q
if [ "$?" -ne "0" ]; then
roscore
fi
elif [ "$1" = "enable_zed" ]; then
source ./devel/setup.bash
roslaunch zed_wrapper zed_camera.launch
elif [ "$1" = "enable_kinect" ]; then
roslaunch openni_launch openni.launch
elif [ "$1" = "enable_turtlebot" ]; then
source ./devel/setup.bash
roslaunch turtlebot_bringup minimal.launch
elif [ "$1" = "enable_turtlebot_keyboard" ]; then
source ./devel/setup.bash
roslaunch turtlebot_teleop keyboard_teleop.launch
elif [ "$1" = "enable_stereo_slam" ]; then
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:`pwd`/src/ORB_SLAM2/Examples/ROS
# Use correspondent zed_xxx.yaml according to src/zed-ros-wrapper/zed_wrapper/launch/zed_camera.launch
rosrun ORB_SLAM2 Stereo ./src/ORB_SLAM2/Vocabulary/ORBvoc.txt ./src/ORB_SLAM2/Examples/ROS/ORB_SLAM2/ZED_VGA.yaml false
elif [ "$1" = "enable_rgbd_slam" ]; then
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:`pwd`/src/ORB_SLAM2/Examples/ROS
rosrun ORB_SLAM2 RGBD ./src/ORB_SLAM2/Vocabulary/ORBvoc.txt src/ORB_SLAM2/Examples/RGB-D/TUM1.yaml
else
echo "Unsupported action: $1"
fi