part.4b: Didi Udacity Challenge 2017 — Car and pedestrian Detection using Lidar and RGB

Updated: It also turns out the code can work with ros kinetic/ubuntu 16.04. So you do not need to use docker if you don’t want to.

In part.4.a, we learned about using RViz in docker to view Didi data. Here we see how we can use a subscriber node to output data from rosbag playback node. We want to run the code from in docker environment.

Before we run the github code above, it would be good to learn about the basics of ros. We are going to implement a “hello world” python example from, which has a publisher and a subscriber node. Here it goes!

  1. Modify the startup script from part.4.a to include the environment varables for ROS network.
nvidia-docker run -it \
-e ROS_HOSTNAME=localhost \
-e ROS_MASTER_URI=http://localhost:11311/ \
-e QT_X11_NO_MITSHM=1\

2. We need multiple terminals. Hence I install tmux inside d

apt-get install tmux  

To enable mouse support for tmux, create ~/.tmux.conf file.

touch /root/.tmux.conf

Add the following lines in .tmux.conf. The settings are different for various versions of tmux! To check the tmux version, use the command “tmux -V”.

## set mouse for tmux 1.8 as shipped with Ubuntu 14.04
set -g mode-mouse on
set -g mouse-resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on

I use a tmux startup script to create 4 windowed terminals.

echo 'start tmux'
#set session name
export SESSION=xxx
tmux -2 new-session -d -s $SESSION 
tmux split-window -v -t $SESSION
tmux split-window -v -t $SESSION
tmux split-window -h -t $SESSION

tmux attach -t $SESSION

You should setup your ros enirovnment before you start tmux. For example,

export CATKIN_WS=/root/share/project/didi/data/catkin_ws/indigo/my_test
source /opt/ros/indigo/setup.bash
source $CATKIN_WS/devel/setup.bash

And this is what you get in the docker container

3. Follow instructions from. For running ros without lanuch file, use the commands:

  • terminal1 : # start the master
  • terminal2: # start the publisher node
  • terminal3: # start the subscriber node

(Note that I modify the subscriber print message from the example in the tutorial website), you have basically setup the following ystem in ros.

If everything works well, we can proceed to to run the code from Likewise, we use:

export CATKIN_WS=/root/share/project/didi/data/catkin_ws/indigo/mjshiggins
source /opt/ros/indigo/setup.bash
source $CATKIN_WS/devel/setup.bash
ln /dev/null /dev/raw1394


And the results!

Other resources for extracting data from rosbag are:

[3] (see ROS and ROS bags part1,2,3)