UniversalRobots / Universal_Robots_ROS2_Description

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

Should ur.urdf.xacro be split into a macro or use properties? #31

Closed rcywongaa closed 2 years ago

rcywongaa commented 2 years ago

Splitting https://github.com/UniversalRobots/Universal_Robots_ROS2_Description/blob/ros2/urdf/ur.urdf.xacro into a macro or at least by using properties instead of arguments would make it much easier to reuse the useful (some even critical) components, e.g. reading joint limits from ur_type, sim settings, etc. This would reduce code duplication when building a bigger robot that includes a UR arm.

Non-macro xacro files don't include very well unfortunately (https://github.com/ros/xacro/issues/204)

If the maintainers are agreeable to this, I can submit a PR for that.

Thanks for the work btw!

fmauch commented 2 years ago

The idea is that you copy and adapt this file when setting up your own env (See the README. It only creates a world link, calls the ur_robot macro and sets up gazebo and ignition.

If at all it would make sense to move the ignition and gazebo entries to the ur_robot macro. However, I see this already as a more specific use-case that goes beyond the scope of the description only.

The reason we use arguments is that this file is meant to be run using an xacro command directly with which we can pass arguments to the description to parametrize it.