# Revision history [back]

Is there any proper way to overwrite links in ROS without the need of editing the original URDF from, for example, the gripper?

First, a nuance: this is not something "in ROS", as URDF is not necessarily tied to ROS, but has uses outside of it.

Having written that: no, there is no support for "overriding" or "replacing" links (or any part of a URDF actually) from other URDFs (or .xacros) right now.

That would be great functionality to have, as it would indeed avoid duplicating files.

One work-around I could think of is placing replacement links in the "same location" as the links you're looking to replace. I haven't tested it, and it would only work if the replacements you've printed are larger than the ones present in the default model.

In essence, you'd add your replacement link(s) to your .xacro and then place them in the correct location using an additional joint, making sure to set the parent of your new joint to the link you're looking to replace. By configuring the correct values for the origin element, you should be able to maneuver everything into place.

Your new link (or really: geometry) would overlap the old ones, which should make algorithms like collision checkers consider the replacements only, as they are larger.

But again, this would only work in case you're replacing geometry smaller than what is already there.

Is there any proper way to overwrite links in ROS without the need of editing the original URDF from, for example, the gripper?

First, a nuance: this is not something "in ROS", as URDF is not necessarily tied to ROS, but has uses outside of it.

Having written that: no, there is no support for "overriding" or "replacing" links (or any part of a URDF actually) from other URDFs (or .xacros) right now.now. Unless the .xacro your looking to update has special support for this.

That would be great functionality to have, as it would indeed avoid duplicating files.

One work-around I could think of is placing replacement links in the "same location" as the links you're looking to replace. I haven't tested it, and it would only work if the replacements you've printed are larger than the ones present in the default model.

In essence, you'd add your replacement link(s) to your .xacro and then place them in the correct location using an additional joint, making sure to set the parent of your new joint to the link you're looking to replace. By configuring the correct values for the origin element, you should be able to maneuver everything into place.

Your new link (or really: geometry) would overlap the old ones, which should make algorithms like collision checkers consider the replacements only, as they are larger.

But again, this would only work in case you're replacing geometry smaller than what is already there.