Skip to content

Pass Down Command Data From An Arbitrary ROS2 Controller To The Hardware Interface #1012

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

Closed

Conversation

swiz23
Copy link

@swiz23 swiz23 commented May 5, 2023

Adds desired feature from ros-controls/ros2_controllers#568

This is a PR to the master branch as opposed to the last one which was a PR to the Humble branch.

Solomon Wiznitzer and others added 2 commits May 9, 2023 17:59
@swiz23 swiz23 force-pushed the swiz/pass_down_command_data_master branch from 0416648 to f04570e Compare May 9, 2023 22:00
Copy link

@sjahr sjahr left a comment

Choose a reason for hiding this comment

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

This could be a useful additional data channel to pass config information from the controller to the HW interface! Just one minor comment

{
return impl_->prepare_command_mode_switch(start_interfaces, stop_interfaces);
if (command_data.empty())
Copy link

Choose a reason for hiding this comment

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

I think this case shouldn't be handled at this level. We don't check here for empty start_/stop_interfaces either. The check should be done within the actual HW interface implementation to keep the code here as simple as possible.

Copy link
Author

Choose a reason for hiding this comment

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

This check is here to ensure backwards compatibility. All implementations of the hardware interface until this point use the 2 argument function signature. If we don't have this check and instead only use the 3 argument function signature, then this will break all implementations of the hardware interface that expect the 2 argument signature.

By checking to see if command_data is empty, that ensures that only those using this new functionality have to modify their hardware interface implementation to use the 3 argument signature.

Copy link
Member

@destogl destogl left a comment

Choose a reason for hiding this comment

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

I don't think this is the right solution for the described problem. If you use some custom control modes, then you should just put them into separate interfaces. If standard controllers don't support your custom control modes, then write your controller – or extend standard ones.

This solution adds additional complexity in the core libraries, and this is not necessary.

@destogl destogl closed this Oct 15, 2023
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.

4 participants