-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmapfuse_online_merge.sh
executable file
·78 lines (70 loc) · 2.12 KB
/
mapfuse_online_merge.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
echo
echo "###################################################"
echo
echo " ## ## # #### ##### # # #### #####"
echo " # # # # # # # # # # # # #"
echo " # # # ##### #### ### # # #### ### "
echo " # # # # # # # # # #"
echo " # # # # # # #### #### ##### "
echo
echo "###################################################"
echo "[email protected]"
echo
echo
echo "##### ONLINE MERGING #####"
echo
echo
echo "You can change RGB-D SLAM parameters in the mapfuse_online.launch file"
echo
echo "When merging is done, save the map by running: "
echo "rosrun octomap_server octomap_saver -f <name>.ot"
echo
echo
echo "##########################################"
echo
read -e -p "Enter initial model:" initial_model
echo "Initial model: $initial_model"
echo
read -e -p "Enter bagfile location: " bagfile
echo "Rosbag: $bagfile"
echo
read -p "Bagfile playback speed: " bagspeed
read -p "Align x y z r p yaw? (Default is 0 0 0 0 0 0) (y/n) " yn
case $yn in
[Yy]* ) read -p "x:" x
read -p "y:" y
read -p "z:" z
read -p "r:" r
read -p "p:" p
read -p "yaw:" yaw
echo "Alignment set to: $x $y $z $r $p $yaw";;
[Nn]* ) x=0
y=0
z=0
r=0
p=0
yaw=0
echo "Alignment set to: $x $y $z $r $p $yaw";;
* ) echo "Please answer yes or no.";;
esac
echo
echo
read -p "Enter Octomap resolution [m] (default 0.10):" octomap_resolution
echo
echo
trap 'kill $BGPID; exit' SIGINT
roslaunch mapfuse mapfuse_online.launch initial:=$initial_model bag:=$bagfile speed:=$bagspeed x:=$x y:=$y z:=$z r:=$r p:=$p yaw:=$yaw resolution:=octomap_resolution&
$BGPID=$!
echo "####################"
echo
read -p "Save OctoMap? (Press y or n when merging is done)" yn
case $yn in
[Yy]* ) read -p "Insert OctoMap name: " name
name=${name}.ot
rosrun octomap_server octomap_saver -f $name
echo "OctoMap saved to $name";;
[Nn]* ) echo "Not saving OctoMap.";;
* ) echo "Please answer yes or no.";;
esac
wait