UniversalRobots / Universal_Robots_ROS2_Description

ROS2 URDF description for Universal Robots
BSD 3-Clause "New" or "Revised" License
133 stars 111 forks source link

Simplification of xacro code for URDF generation #17

Closed Tirine closed 2 years ago

Tirine commented 2 years ago

I was trying to understand how XACRO and URDFs worked, so I deep dived into how they work for UR with ROS2, as I was trying to understand it I made some changes to improve my understanding of how to develop such scripts myself!

If ya want it, take it and change it :)

Tirine commented 2 years ago

Just another note, I saw there is a lot of similar simplifications that can be done across the board, with the joint 'revolute' creations (added a TODO there, though maybe that should be removed if none would like to do anything), but also with the limits, kinematics, inertia params etc etc. 100s of lines that could be simplified down to 10s.

Tirine commented 2 years ago

However, I would prefer, if we could not rename the links in this PR (or at all), as renaming links will produce problems at other places.

Oh, that was a quick answer! :) Oh well, I think I wasn't able to think of any other way. I assume you're talking about the renaming of for example "base_link" to "base_link_fixed" and "base_link_inertia" to "base_link". As the old "base_link_inertia" is to the base as the other links are "${name}_link", renaming it was the only way I could see doing it properly clean..

Another way would be to only merge the changes to the other links, but not to the base link creation, aka leave that link creation in the old style. Would that be good enough? If so I can go ahead and push that.

fmauch commented 2 years ago

Yes, I think this would be preferable.

Tirine commented 2 years ago

There, got it working only with the ur_common macro