Ask Your Question
4

rosbag topics for robot model visualization

asked 2011-05-02 07:30:46 -0600

I'm trying to determine which topics are required for robot model visualization in rviz during a rosbag playback. Any helpful hints about topics and/or nodes that need to be run would be greatly appreciated.

edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted
0

answered 2011-05-02 11:08:39 -0600

raphael favier gravatar image

updated 2011-05-02 11:09:57 -0600

Hello,

I am also wondering the same. I just began with URDF today. I did not fully explore the urdf documentation, but it did not seem so clear about the minimal configuration you would need to run a simple model without a joint_state_publisher nor a robot_state_publisher. Also, I stay curious about how to deal with partial tf trees, and tf updates from multiple sources when dealing with joint and robot publisher.

Then, I would guess only tf... provided that all the frames of your model are broadcasted by some entity(ies), it should be ok.

It seems from rviz documentation that you only need to load your urdf model as a parameter.

Robot Description: The parameter to retrieve the urdf from. Uses searchParam() to search up the parameter tree for the value specified.

For example, in a launch file:

<param name="robot_description" textfile="PATH_TO_URDF_FILE" />

Should just do it. I can tell you more tomorrow when I will be integrating my brand new urdf model.

Raph

edit flag offensive delete link more

Comments

Hi Raphael, you are correct, you only need the `tf` messages and the `robot_description` parameter. However, the easiest way to get `tf` published is to use `joint_state_publisher` (or something else that publishes JointStates) and `robot_state_publisher`.
Martin Günther gravatar imageMartin Günther ( 2011-05-02 21:08:10 -0600 )edit
2

answered 2011-05-02 21:06:31 -0600

The minimal configuration to show a URDF model in RViz, independent of whether you run a rosbag playback or not, are:

  • the robot_description parameter must be set (as Raphael said)
  • the tf messages for all the frames corresponding to the URDF links

Assuming that your rosbag contains the tf messages, all you need to do is set the robot_description parameter before starting RViz.

edit flag offensive delete link more
1

answered 2011-05-21 07:06:20 -0600

I finally revisited this issue when building some nice visualizations. The guys' description above is spot-on. If you're using the PR2, just run this:

rosrun xacro xacro.py `rospack find pr2_description`/robots/pr2.urdf.xacro -o pr2_urdf.xml

Then in a launch file (that also plays your bag file with tf messages):

<launch>
  <param name="robot_description" command="cat $(find mypackage)/pr2_urdf.xml" />
  <node pkg="rosbag" type="play" name="rosbagplay"
    args="--clock -q -r 1.0 $(find mypackage)/tmp.bag" />
</launch>

Works great. Thanks for the feedback y'all.

edit flag offensive delete link more

Comments

1
You can simplify this even further: <param name="robot_description" command="$(find xacro)/xacro.py '$(find pr2_description)/robots/pr2.urdf.xacro'" />
Martin Günther gravatar imageMartin Günther ( 2011-05-21 21:20:42 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-05-02 07:30:46 -0600

Seen: 1,538 times

Last updated: May 21 '11