ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Rviz urdf robot update position

asked 2015-02-16 10:17:27 -0500

gpldecha gravatar image

I have been trying to set the position and orientation of my table in Rviz after launch.

The table is represented by a URDF model (as can be seen in the picture bellow). The reason for choosing a URDF instead of a Marker for example is that I cant take advantage of the macro xml tags. Like this i can easily add multiple tables with different specifications into Rviz and Gazebo.

What I would like to be able to achieve, is to call a service which sets the actual position and orientation of the table after rviz has has been launched and the table's loaded.

The position and rotation of the table will be fetched from a /tf topic given by the OptiTrack system (vision system).

image description

To achieve this I have added dummy joints which I control via a node in which I set the joint values. However I have to keep doing this at high frequency to keep the table in right position. What I would like is to just reset the default position of the table, which is a RobotModel.

An alternative method would be to write a program which takes the urdf specification of the table and converts it to Markers which I can then read set the positions.

Any advice ? I would like to be able to keep the URDF representation.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2015-02-17 04:09:28 -0500

updated 2015-02-17 04:10:51 -0500

To achieve this I have added dummy joints which I control via a node in which I set the joint values. However I have to keep doing this at high frequency to keep the table in right position.

Yes, this is the correct way to do it in ROS (if you really want to use URDF). IMO it would be a bit clearer to omit the joint between /table_dummy_link and /table_link (or whatever it's called), making table_link the root of your URDF, and publishing the TF from /table_dummy_link to /table_link directly instead of publishing the joint_states. But that's just an aesthetic question; whether you publish /tf or /joint_states, you need to keep doing that at a medium to high rate (> 10 Hz), that's just the way ROS works. What's the problem with that?

edit flag offensive delete link more

Comments

Hi thanks for answer. I have solved the problem by writing a "table_broadcaster" node (which duplicates the behavior of static_tf). I have a service which I call to set the transformation after the urdf has been launched. I can achieve the exact wanted behavior. I have removed all dummy links.

gpldecha gravatar image gpldecha  ( 2015-02-17 04:29:12 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-02-16 10:17:27 -0500

Seen: 1,144 times

Last updated: Feb 17 '15