Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ros2_control tag from package (and move it to ur_robot_driver) #114

Merged
merged 3 commits into from Dec 18, 2023

Conversation

fmauch
Copy link
Collaborator

@fmauch fmauch commented Nov 15, 2023

There definitively is a need for using the robot description without the ros2_control tag in general e.g. when simply viewing the robot model (also see #52).

This commit removes the dependency to the ros2_control tag from the macro instantiating a robot and adds new files describing the control mechanisms of the individual joints and sensors.
These files can be included in ros2_control files setting up a specific control structure (e.g. hardware driver, mock hardware, gazebo).

This change would require packages like driver, gazebo startup, etc. to provide their own descriptions with their own ros2_control tags but I personally don't see this that negative. As also raised in #52 (comment) users will have to provide their own ros2_control tag for their own configuration as soon as there is more than only the (or more than one) UR involved.

I think the approach from this PR leaves a simple to use UR macro, a standalone (non-control) description and a couple of helper macros to create your own ros2_control tag.

urdf/ur_macro.xacro Outdated Show resolved Hide resolved
@bmagyar
Copy link

bmagyar commented Nov 15, 2023

I personally see a lot of value in a well-tested, officially supported ros2_control tag that comes with the robot's description files. If I had to deploy a UR-based system, I'd always try using the official tags once I'm past the prototyping stage.

Speaking of which, many tools used for prototyping may want to supply/generate their own ros2_control tag content (or not technically need it at all) which should also be supported somehow. I'm wondering if this could not be achieved with a much simpler new required parameter that turns ros2_control support on-off.

  <xacro:macro name="ur_robot" params="
    name
    tf_prefix
    parent
    *origin
    joint_limits_parameters_file
    kinematics_parameters_file
    physical_parameters_file
    visual_parameters_file
    generate_ros2_control_tag
    ...
  >

Please tell me if this is outlandishly oversimplified :D

@fmauch
Copy link
Collaborator Author

fmauch commented Nov 15, 2023

I personally see a lot of value in a well-tested, officially supported ros2_control tag that comes with the robot's description files. If I had to deploy a UR-based system, I'd always try using the official tags once I'm past the prototyping stage.

Speaking of which, many tools used for prototyping may want to supply/generate their own ros2_control tag content (or not technically need it at all) which should also be supported somehow. I'm wondering if this could not be achieved with a much simpler new required parameter that turns ros2_control support on-off.

One issue I have with keeping this inside here is that the whole hardware interface parametrization is piped through the description. In my point of view that carries mainly two negative implications:

I am not 100% sure about the cleanest solution and I know that this discussion has been done before, never coming to a final solution which I want to change with this PR.

So thank you for joining the discussion I hope that we find a solution that everybody can agree on. I'm not a huge fan of at-mentioning people, but since we had this discussion before, I would love to get input from @ipa-cmh, @destogl, @gavanderhoorn, @RobertWilbrandt on this suggestion.

To not seem like I am ignoring input from previous discussions:

  • I did not create a separate package for the ros2_control tag mainly because of the two points raised above. The biggest part of the existing tag is parametrizing the ur_robot_driver's hardware interface. From my point of view this part should live with the driver. I could also imagine a separate package for this living in the driver's repo, though.
  • I don't think this will drop a "well-tested, officially supported ros2_control tag", it will just not live with the description anymore.
  • Although the title says "remove" more appropriately it should probably say "move to driver", see Add control description and ros2_control tag to driver. Universal_Robots_ROS2_Driver#877
  • I would like to minimize code duplication, hence I've created the helper files here.

@fmauch fmauch changed the title Remove ros2_control tag from package Remove ros2_control tag from package (and move it to ur_robot_driver) Nov 15, 2023
@bmagyar
Copy link

bmagyar commented Nov 15, 2023

Thanks for the great writeup!

What can the user expect to change on their side?

Going from the current

  <xacro:ur_robot
    name
    tf_prefix
    parent
    *origin
    joint_limits_parameters_file
    kinematics_parameters_file
    physical_parameters_file
    visual_parameters_file
    ... (one gazillion potentially irrelevant parameters)
  >

to

  <xacro:ur_robot
    name
    tf_prefix
    parent
    *origin
    joint_limits_parameters_file
    kinematics_parameters_file
    physical_parameters_file
    visual_parameters_file
    ... only description-relevant parameters
  >

  <xacro:ur_ros2_control
    ... relevant parameters for real HW driver or SIM
  >

or if you don't want ros2_control at all, to simply

  <xacro:ur_robot
    name
    tf_prefix
    parent
    *origin
    joint_limits_parameters_file
    kinematics_parameters_file
    physical_parameters_file
    visual_parameters_file
    ... only description-relevant parameters
  >

I quite like this ☝️

@bmagyar
Copy link

bmagyar commented Nov 15, 2023

Here's my next question: could this be made part of Humble in any way?

Perhaps for backward compatibility you could add the new macro to the driver there (same as w rolling) and a define_ros2_control_tag boolean param to the main macro?

@fmauch
Copy link
Collaborator Author

fmauch commented Nov 15, 2023

Here's my next question: could this be made part of Humble in any way?

Perhaps for backward compatibility you could add the new macro to the driver there (same as w rolling) and a define_ros2_control_tag boolean param to the main macro?

Yes, that sounds reasonable. Nobody plans to actively break Humble anyway 8-)

@destogl
Copy link
Contributor

destogl commented Nov 15, 2023

This move sounds reasonable to me also. In few more recent drivers we started to split things in similar way. We are even adding "ros2_control_support" packages with all ros2_control-related things and then this package can load description of a robot needed. Since here you have only ros2_control as driver, moving this to driver is good.

Only things to consider to not get lost. We have to update gazebo and igniton packages add add those two URDF snippets for those there. For now I would be happy with just a draft PR adding this somewhere. Those two packages needed anyway some more attention (at least when I checked them last time - and I feel responsible for that, but...)

Copy link
Collaborator

@VinDp VinDp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked and tested: seems good to me.

There definitively is a need for using the robot description without the ros2_control
tag in general e.g. when simply viewing the robot model.

This commit removes the dependency to the ros2_control tag from the macro
instantiating a robot and adds new files describing the control mechanisms
of the individual joints and sensors.
These files can be included in ros2_control files setting up a specific
control structure (e.g. hardware driver, mock hardware, gazebo).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants