0
$\begingroup$

Rosanswers logo

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.


Originally posted by Travis Deyle on ROS Answers with karma: 91 on 2011-05-02

Post score: 4

$\endgroup$

3 Answers 3

0
$\begingroup$

Rosanswers logo

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


Originally posted by raphael favier with karma: 1382 on 2011-05-02

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Martin Günther on 2011-05-02:
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.

$\endgroup$
0
$\begingroup$

Rosanswers logo

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.


Originally posted by Martin Günther with karma: 11816 on 2011-05-02

This answer was NOT ACCEPTED on the original site

Post score: 2

$\endgroup$
0
$\begingroup$

Rosanswers logo

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.


Originally posted by Travis Deyle with karma: 91 on 2011-05-21

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by Martin Günther on 2011-05-21:
You can simplify this even further:

$\endgroup$

Your Answer

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