Reusable Components in URDF

I am working on a MATLAB toolbox to build URDF files for robots in an object-oriented fashion. One of the features I am planning to add to the toolbox is to create a reusable component that can be added to a robot definition multiple times as instances with their own set of parameter values.

Here is the link to the toolbox: GitHub - artineering/robotBuilder_matlab: A MATLAB toolkit for programmatically creating, modifying, and managing URDF (Unified Robot Description Format) files

I would appreciate feedback on this idea. Also, I would like to start a conversation on how we can introduce the idea of reusable components in a typical URDF file.

For example:
robot.urdf file: foo.urdf

<robot name="foo">
         <component name="bar" src="bar.urdf">
         ...
        <component_instance name="bar" instanceName="tango">
              <param name="prop1" value="42>
             ....
       </component_instance>
</robot>

component urdf file: bar.urdf

<component name="foo">
       <link name="link1">
         ....
       </link>
      <link name="link2">
         ....
       </link>
       <joint name="joint1">
         <parent name="link1">
         <child name="link2">
         ....
       </joint>
      <parameter name="prop1" path="foo.link1.someProperty" defaultValue=0>
       ...
</component>

thoughts?

For some of the complex urdf definitions I am trying out, components would reduce the size of the urdf file by an order of magnitude and make it much more readable as well.

This is a great initiative.

The current best practice is to provide Xacro macros that generate the “component”. See e.g. depthai-ros/depthai_descriptions/urdf at noetic · luxonis/depthai-ros · GitHub .

However, the problem with this approach is that the structural information provided in Xacro is lost after the conversion to URDF is performed. And personally, I haven’t seen any tools that would allow editing the robot model directly as Xacro. All robot model editors assume URDF. So if you generate the model from Xacro and do some edits, there is no automated way of getting these edits back to the source Xacro.

If there were some similar structural elements in URDF itself, it would be much easier to do this kind of composition. But as discussed elsewhere recently, the probability of some radical changes to the URDF format is quite low at this moment…

1 Like

Thank you for your insight, @peci1!

Yes, I have been looking at Xacro and have always felt its syntax is non-intuitive and has a difficult ramp-up for new users. That was the main reason for trying to build a toolkit that takes away some of that pain in having to understand xacro along with the urdf structure.

My end goal is to make a graphical editor that avoids having to edit the urdf file manually and treat urdf files as a final output which can be directly without having to go through an additional step of xacro compilation.

I am also planning to use the in-memory robot counterpart of the loaded urdf as the basis for developing further analytical tools.

If your only goal is to have a GUI for building URDF models, search this forum. There have been multiple such projects already announced.

The GUI is one of the options I am considering. The main goal is to build analytical tools for studying the kinematic structure of the robot.

Hi,

Is not ROBOTCad what you want?

PĂ©ter

1 Like

Indeed :slight_smile:

I will take a look at it and see how it fits into my requirements.

why do all open-source tools have to be so difficult to install and run! So, I have failed to install RobotCad or even run it on the provided docker image.

This is one of the biggest bottlenecks I have faced as a student and researcher when it comes to using open-source software. There is just so much gap between what is documented and the reality that it almost feels not worth investing any time on it.

Hello, there is one line command to install and run RobotCAD on Ubuntu. https://github.com/drfenixion/freecad.robotcad?tab=readme-ov-file#fast-install-and-run

If you have faced to “Segmentation fault” use that command for fix.
https://github.com/drfenixion/freecad.robotcad?tab=readme-ov-file#fix-segmentation-fault-if-faced

You also can install RobotCAD by Addon Manager of FreeCAD.
https://github.com/drfenixion/freecad.robotcad#Installation

If you faced with any other problem please add issue to repository.

perhaps because those tools / projects are labours of love and/or rely on volunteers instead of having a multi-million/billion dollar company behind them that has the resources to exhaustively test on N different systems / OS / software versions – so your system is likely to be unique among the deployed base of that tool and problems unique to your situation are likely to only be discovered by you.

(in other words: what gets tested & documented is whatever the author and his/her collaborators have access to & are using themselves)

Comparing this aspect of tools like the one created by @fenixionsoul to non-open-source tools is not really realistic, exactly because of this.

(although having written that: the number of times commercial tools like SolidWorks, Catia or even Microsoft Word have unexplainably crashed or done strange things is also decidedly non-zero for me and my colleagues)

1 Like