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

Change URDF link position

asked 2019-01-02 05:29:07 -0600

balint.tahi gravatar image

Hi,

I have a lab setup in urdf, which I am using in RViz / MoveIt!. Based on the real world calibration, I would like to move some objects a bit (a table with an offset). The link is connected to the world with a fixed joint currently.

Is there a way to do this dinamicaly, during runtime?

Thanks in advance Balint Tahi PPM Robotics AS

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2019-01-02 06:16:07 -0600

gvdhoorn gravatar image

updated 2019-01-02 06:24:45 -0600

While it's certainly possible to update link lengths in parsed URDFs (it's just an in-memory representation of the xml based file format after all) there are two problems with doing that:

  1. even though robot_description is (typically) a "global" parameter, changes to the in-memory representation local to one consumer will not be forwarded (or persisted) to the parameter automatically. But even if they did, then ..
  2. none of the (officially supported) consumers of URDF expect robot_description to change at runtime, so they don't typically check the parameter for changes nor parse it again to update their internal model, not even if those consumers are found inside the same process (ie: node)

So I believe the answer to your question would be "yes, it is supported, but probably not in a way that would fit your use-case".

What is typically done is to write a custom, purpose-built calibration node that as its input takes a URDF / xacro, performs a calibration and then outputs an updated URDF. An example would be the robot_calibration package fi -- although that focuses on robots specifically (ie: kinematic chains).

What could be an alternative to updating URDFs themselves -- which is very limiting as you would not be able to (easily) output xacro fi -- could be to use xacro's yaml support: place offsets and distances / link lengths in the .yaml file and have the calibration tool update/output that.

That would still need a restart / reload of any URDF consumers, but .yamls are much easier to read/write by both humans and machines than a potentially unlimited nested xacro hierarchy.


This connects to a much wider discussion about the (perceived) immutability of URDF that has taken place at venues such as ROSCon and the robot description formats category on ROS Discourse.

Note that comments typically focus on URDF and how this is a serious problem with it, but I don't necessarily agree with that: keeping state consistent across multiple, asynchronously participating entities in a distributed system is just not a solved problem. The same issues would arise when using SDF for instance (although that format would solve a few others).

There are certainly avenues to explore (I'd still like to take a closer look at usd fi), that will take time and someone (or someones) will need to spend that time to investigate a replacement

edit flag offensive delete link more

Comments

Thanks for the quick answer. Then I will try the "alternative way", updating a yaml and using xacro first. I am using only rviz and moveit as a consumer, that shouldn't be a problem to restart.

balint.tahi gravatar image balint.tahi  ( 2019-01-02 06:52:23 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2019-01-02 05:29:07 -0600

Seen: 1,992 times

Last updated: Jan 02 '19