This package provides helper scripts to download and use datasets for the Introduction to Robotics class.
The datasets were captured on a Turtlebot 3 Waffle Pi.
This guide assumes that you have followed the previous tutorials.
A map and rosbag are provided, along with some helper scripts.
The initial bag is still provided, but had a synchronization issue. This has been fixed using fix_stamps.py.
The fixed bag includes:
rosbag info fixed_slam_easy.bag
topics: /imu 14805 msgs : sensor_msgs/Imu
/odom 3252 msgs : nav_msgs/Odometry
/raspicam_node/camera_info 1814 msgs : sensor_msgs/CameraInfo
/raspicam_node/image/compressed 1811 msgs : sensor_msgs/CompressedImage
/scan 626 msgs : sensor_msgs/LaserScan
/tf 21329 msgs : tf/tfMessage
/tf_static 1 msg : tf/tfMessageThe setup includes ground-truth data. This was obtained from a motion capture system at 60Hz. 5 markers were placed on the top layer of the robot, such that the center of the tracked object matched the laser scanner of the robot.
The ground-truth data is provided in the /tf topic, as a transform mocap -> mocap_laser_link. To conform to REP 105 in ROS, the initial transform was obtained at the robot's base footprint frame. The homogeneous transformation matrix at the beginning of the dataset is given by:
The initial transform can be used to connect mocap to odom, map or other fixed frames. This can be done by executing publish_initial_tf.sh.
Images docs/unconnected_tree.svg and docs/connected_tree.svg show the setup in terms of frames, and what happens when we add the mocap -> odom transform. These images have been obtained with the following bash command: rosrun tf2_tools view_frames.py.
The map was obtained using turtlebot3_slam gmapping using the default parameters.
First, some things to know:
-
Use simulation time when reading data from rosbags. If not, then things like
rospy.Time.now()will not output the time at which the dataset was recorded. To use simulation time:rosparam set use_sim_time trueafterroscore. If you were runningrvizalready, it needs to be restarted. Otherwise, TFs might not be picked up. -
Always play back the rosbag with the
--clockoption (related to simulation time).--pauseand--r RATEcan also help.
-
Install pip
sudo apt-get install python3-pipsudo pip install --upgrade pip -
Install gdown
sudo pip install gdown -
git clone https://github.com/IRS-group/turtlebot3-datasets.gitinto your ROS workspace -
Build with catkin:
cd ~/catkin_ws && catkin_make && source ~/catkin_ws/devel/setup.bash -
Download the dataset (the map is already in the
datadirectory, this downloads the rosbag):roscd turtlebot3_datasets/scripts && bash download_dataset.sh -
Start ROS
roscore -
Run a static transform publisher to connect the ground-truth and map frames (you can also add as a node to your launch file):
source ~/catkin_ws/devel/setup.bash && rosrun turtlebot3_datasets publish_initial_tf.sh map -
Launch the description launch file:
source ~/catkin_ws/devel/setup.bash && roslaunch turtlebot3_datasets turtlebot3_description.launch -
Launch map server
rosrun map_server map_server ~/catkin_ws/src/turtlebot3-datasets/data/map.yaml -
Launch amcl
roslaunch turtlebot3_navigation amcl.launch -
Play the bag
cd ~/catkin_ws/src/turtlebot3-datasets/data && rosbag play --clock fixed_slam_easy.bag