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

How to dynamically modify robot URDF?

asked 2019-12-09 09:16:53 -0500

grejj gravatar image

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-12-09 12:42:46 -0500

gvdhoorn gravatar image

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.

edit flag offensive delete link more

Question Tools


Asked: 2019-12-09 09:16:53 -0500

Seen: 1,452 times

Last updated: Dec 09 '19