0
$\begingroup$

Rosanswers logo

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.


Originally posted by gpldecha on ROS Answers with karma: 285 on 2015-02-16

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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?


Originally posted by Martin Günther with karma: 11816 on 2015-02-17

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by gpldecha on 2015-02-17:
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.

$\endgroup$

Your Answer

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