Rosanswers logo

We currently have many robots of the same model that all have the same basic components but differ according to certain attachments and/or features. For example, a chassis and arm would be standard to all the robots but different claw types or end effector attachments could be changed by the user.

What we would like to have happen is that as the user changes certain attachments or smaller components on the actual, physical robot that the robot URDF would be updated accordingly during runtime. We have a GUI setup for the robot that allows the user to select different attachments but it does not do anything right now. The idea is that the user's selection in the user interface would then publish a ROS message and somehow the robot would dynamically reconfigure its joints and links accordingly. The updated URDF is then used to update the robot avatar in the GUI and for path planning calculations.

We have divided the various components and attachments that the robot can take into separate .xacro files (ex/ claw.xacro, long_claw.xacro, short_claw.xacro, etc..). What we originally were thinking is that we would just create a ROS node to do this. Currently, our startup script runs:

rosrun xacro xacro -o robot1.urdf robot1.xacro

with the robot1.xacro specifying all of the hardware (other .xacro files) to include and that are standard specifically to robot1. But right now this is only done at startup and cannot be changed at runtime.

Should we just create a ROS node that calls a bash script that calls the above command when it receives a message from the user to update the URDF? Is changing the robot URDF during runtime something is normally done?

We are running ROS Melodic on Ubuntu 18.04.

Originally posted by grejj on ROS Answers with karma: 13 on 2019-12-09

Post score: 0


1 Answer 1


Rosanswers logo

Is changing the robot URDF during runtime something is normally done?

the straight answer would be: no, it's not done, as it's not supported.

See #q197320 for an earlier Q&A about this. Even thought it's from 2014, the situation has essentially not changed.

See ROS 2 robot_state_publisher improvements for a recent, related discussion.

There are many more, both here on ROS Answers and on ROS Discourse.

Originally posted by gvdhoorn with karma: 86574 on 2019-12-09

This answer was ACCEPTED on the original site

Post score: 1


Your Answer

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