Skip to content

Conversation

@saumanraaj
Copy link

@saumanraaj saumanraaj commented Oct 21, 2025

Description

This PR fixes incorrect parsing of claimed interfaces in moveit_ros_control_interface::Ros2ControlManager.

Problem:
Planar (and other multi-DOF) joints expose variable names with an extra segment (e.g., base_joint/x/position, base_joint/y/position, base_joint/theta/position). The current helper:

std::string parseJointNameFromResource(const std::string& claimed_interface)
{
  const auto index = claimed_interface.find('/');
  if (index == std::string::npos)
    return claimed_interface;
  return claimed_interface.substr(0, index);
}

splits at the first /, turning base_joint/x/position into base_joint, which drops the /x (or /y, /theta) component. As a result, Ros2ControlManager fails to find the appropriate controller, even when it exists.

Fix:
Change the parsing to strip only the final interface segment (e.g., /position, /velocity, /effort) and preserve intermediate suffixes for multi-DOF joints:

// Strip only the final interface segment (e.g., /position) to preserve
// multi-DOF suffixes such as /x, /y, /theta for planar and floating joints.
const auto last = claimed_interface.rfind('/');
if (last == std::string::npos)
  return claimed_interface;
return claimed_interface.substr(0, last);

This makes:

  • joint1/positionjoint1 (unchanged behavior for single-DOF)
  • base_joint/x/positionbase_joint/x
  • base_joint/theta/velocitybase_joint/theta

Related issue: Fixes #3594.

Why safe:
The change is localized, backward-compatible for single-DOF joints, and aligns with MoveIt’s planar joint variable naming (name/x, name/y, name/theta).

Manual check (optional):
Using the Mobile Base + Arm tutorial (with moveit_ros_control_interface/Ros2ControlManager), controllers advertising base_joint/{x,y,theta}/position are now correctly matched.


Checklist


Notes for reviewers

  • If there are other code paths parsing claimed interfaces, I can unify them on the same “strip-last-segment” helper for consistency.

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.

Ros2ControlManager strips off suffix that is extended by planar joint model

1 participant