Roslaunch to visualize a rosbag file from Udacity (DiDi Challenge)
Here you can find more info about the challenge. In this repository you will find a simple launch file to play a rosbag file and visualize the result in RViz.
Follow instructions you find in this page.
Point 1.2 : choose instructions for your version of Ubuntu.
Point 1.4 : Desktop-Full Install: (Recommended).
When you configure the ROS Environment, choose catkin.
Complete the tutorial page. It is mandatory to follow the tutorial number 1 "Installing and Configuring Your ROS Environment".
Now we have installed ROS and we have created our workspace.
Open the file bashrc:
gedit ~/.bashrc
if you want to avoid to type the following command every time, add in the end of the file :
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:/path_to_catkin_ws/catkin_ws/src
source /opt/ros/indigo/setup.bash
source /path_to_catkin_ws/catkin_ws/devel/setup.bash
Remember to change /path_to_catkin_ws
with your path and change indigo
if you are using another version of ROS.
Close the terminal an open a new one.
I used Ubuntu 14.04 and ROS Indigo.
$ git clone https://github.com/jokla/didi_challenge_ros.git
catkin_ws
and do catkin_make
:$ cd ~/catkin_ws
$ catkin_make
$ source ~/catkin_ws/devel/setup.bash
$ roscd didi_challenge_ros
Launch display_rosbag_rviz.launch
setting the path to the rosbag file you want to use:
$ roslaunch didi_challenge_ros display_rosbag_rviz.launch rosbag_file:=CHANGE_WITH_PATH/approach_1.bag
The launch file display_rosbag_rviz.launch
is doing the following:
<arg name="rosbag_file" default="my_file_1" />
<node pkg="rosbag" type="play" name="player" output="screen" args="-l $(arg rosbag_file) "/>
<node pkg="tf2_ros" type="static_transform_publisher" name="link1_broadcaster" args="1.9 0 1.6 0 0 0 1 base_link velodyne" />
<node name="rviz" pkg="rviz" type="rviz" args="-d $(find didi_challenge_ros)/launch/display.rviz" />