-
Notifications
You must be signed in to change notification settings - Fork 3
/
run.sh
28 lines (22 loc) · 1.05 KB
/
run.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
#!/bin/bash
# change to current ee4308 workspace
export EE4308WS=`echo "$( cd "$( dirname "$0" )" && pwd )"`
cd `echo $EE4308WS`
# get world and task
source params.sh
# source the project
source devel/setup.bash
# get the world specific parameters as environment variables
source `rospack find ee4308_bringup`/worlds/`echo $WORLD`.sh
# reset the gazebo
echo "Resetting Gazebo. Wait 1s for Gazebo to complete reset."
rosservice call /gazebo/reset_simulation
sleep 1s # allow gazebo to reset so as not to mess with the time.
# roslaunch code for reset sim. Put here for reference
# <node pkg="rosservice" type="rosservice" name="reset_simulation" args="call --wait /gazebo/reset_simulation {}" />
# bring up gazebo and build all models
echo "Begin..."
roslaunch ee4308_bringup run_`echo $EE4308_TASK`.launch
# try to stop. This will show an error if ./bringup.launch is not running
echo "Stopping Turtlebot3 by publishing to /turtle/cmd_vel"
rostopic pub -1 /turtle/cmd_vel geometry_msgs/Twist '{linear: {x: 0.0, y: 0.0, z: 0.0}, angular: {x: 0.0,y: 0.0,z: 0.0}}'