ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I finally got it to work. I guess the issue was that I was setting the use_sim_time
parameter after the launch command, because of which the nodes (already launched) did not get the information that they are supposed to use the simulated clock.
One thing I would like to point out is that the tutorial indeed indeed asks you to set use_sim_time
before the roslaunch command. When I initially tried to do this, I got the following error
ERROR: Unable to communicate with master!
because, obviously, the master was not running. I feel quite dumb now, but this is kind of what happens when you blindly follow the sequence mentioned in the tutorial, and not use common sense. The tutorial skips the instruction to first run roscore
(to get the Master running). The roslaunch
command itself starts the Master, if one is not running; but without setting the use_sim_time
parameter to true.
In case someone falls into this silly pit in future, the following are the correct sequence of commands to get around this issue:
roscore
rosparam set /use_sim_time true
roslaunch openni_launch openni.launch load_driver:=false
rosrun rviz rviz
(to launch rviz for visualization, or any other method to see the messages being played back)
rosbag play --clock --pause kinectbag.bag