-
Notifications
You must be signed in to change notification settings - Fork 346
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
Pass Down Command Data From An Arbitrary ROS2 Controller To The Hardware Interface #1012
Conversation
…er to the hardware interface
…nything Co-authored-by: Abrar Rahman Protyasha <[email protected]>
0416648
to
f04570e
Compare
There was a problem hiding this 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()) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
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.