I have a bag file that contains couple of topics needed for localization, odometry data, kinect data and /tf. What I want is watching robot's movement path in rviz after initializing robot position (even I don't know how to initial it). Any help?

All topics:

  • $\begingroup$ I don't understand the question – perhaps you could add some context and explain a bit more $\endgroup$ Commented Nov 21, 2013 at 16:26
  • $\begingroup$ Well, I have recorded data inside a bag file using a wheeled root, right? I've generated map of the environment using that bag file. Now, I want to use these data to see the path of robot inside rviz. $\endgroup$
    – Maysam
    Commented Nov 22, 2013 at 7:07
  • $\begingroup$ you might have a better chance of getting an answer for this question if you ask it on the the ROS q/a site: answers.ros.org/questions $\endgroup$
    – Robz
    Commented Dec 1, 2013 at 0:17
  • 1
    $\begingroup$ @Robz I did, people there are way too lazy! $\endgroup$
    – Maysam
    Commented Dec 1, 2013 at 12:04
  • $\begingroup$ Not 100% sure where's the problem: what do you mean by "after initializing robot position"? Do you mean that you want to run some localisation algorithm on those data? Or did you record the result of the localisation algorithm and simply want to display it? $\endgroup$
    – Ugo
    Commented Dec 2, 2013 at 11:18

2 Answers 2


Before you run rviz, you need to set use_sim_time to true:

rosparam set use_sim_time true

Now start up rviz, then run rosbag using --clock:

rosbag play bagfile_name.bag --clock

For setting up rviz with the navigation stack, you will want to follow this tutiorial.


For localisation you need map of the environment. For the data you have, you should use SLAM algorithm which give path and map of your environment. Try using gmapping in ROS.

  • $\begingroup$ I have map too, sorry I forgot to write its topic name. $\endgroup$
    – Maysam
    Commented Mar 2, 2014 at 8:57
  • $\begingroup$ use amcl to localise your robot $\endgroup$
    – nayab
    Commented Mar 2, 2014 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.