Skip to content

Fixes eager interface claiming bug in franka_hardware #124

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

Open
wants to merge 1 commit into
base: humble
Choose a base branch
from

Conversation

jcarpinelli-bdai
Copy link

Closes #123

This PR matches joint name and interface name when preparing command mode switching. This allows multiple hardware interfaces (non-Franka) to be loaded alongside Franka hardware in a single ros2_control_node.

if (after_slash == interface_type) {
if (interface_type != "position" && interface_type != "velocity" &&
interface_type != "effort" && interface_type != "acceleration") {
return true;
Copy link
Member

Choose a reason for hiding this comment

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

This is very hardcoded.

What do you actually want to achieve?

Copy link
Author

Choose a reason for hiding this comment

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

On humble today, the hardware interface assumes every hardware plugin loaded by the controller manager is a FrankaHardwareInterface owned resource. This is often not true; for example, if a custom hardware (gripper, extra joints etc.) is loaded in the same controller manager. As a result, if you try to launch two separate hardware interfaces in the same controller manager, the FrankaHardwareInterface crashes.

The FrankaHardwareInterface allows for a subset of the standard interfaces: position, velocity, acceleration, and effort. The FrankaHardwareInterface also includes non-standard interface names, e.g. 1/cartesian_pose.

This PR first checks if the hardware interface is not one of the standard interfaces supported by the class. If not, it assumes (as it does on main) that the interface is owned by the class. If the interface is a standard interface, then it checks that the "joint" part of the interface name is a joint owned by the class.

Copy link
Author

Choose a reason for hiding this comment

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

@AndreasKuhner do you have any thoughts on allowing for this functionality? Regardless of the hard-coding of the interface names, I think this is critical functionality for users. Should I replace "position" with hardware_interface::HW_IF_POSITION?

Copy link
Member

Choose a reason for hiding this comment

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

I think for a custom solution it works. But for our 'bigger' picture, it would need to resolve a few more issues... But I didn't have much time so far to investigate and see what that exactly means 😓

Copy link
Author

Choose a reason for hiding this comment

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

Would it be possible to merge this, or a similar PR? The behavior change is very important for users running multiple hardware types in one controller manager (which I understand to be a common use case in ros2_control).

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.

Eager Hardware Interface Claiming in prepare_command_mode_switch
2 participants