Skip to content

Ros2ControlManager strips off suffix that is extended by planar joint model #3594

@jsupratman13

Description

@jsupratman13

Description

/**
* \brief Get joint name from resource name reported by ros2_control, since claimed_interfaces return by ros2_control
* will have the interface name as suffix joint_name/INTERFACE_TYPE
* @param[in] claimed_interface claimed interface as joint_name/INTERFACE_TYPE
* @return joint_name part of the /p claimed_interface
*/
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);
}

In moveit_ros_control_interface::Ros2ControlManager, the function above is used to parse joint names from claimed interfaces so that the plugin will know which controller can be used for a given planned trajectory.

However, when working with planar joints, the joint names are extended with components. For example, base_joint would be extended to

  • base_joint/x
  • base_joint/y
  • base_joint/theta

as written here I think

local_variable_names_.push_back("x");
local_variable_names_.push_back("y");
local_variable_names_.push_back("theta");
for (int i = 0; i < 3; ++i)
{
variable_names_.push_back(getName() + "/" + local_variable_names_[i]);

The parseJointNameFromResource function strips everything so that if base_joint/x/position is given, base_joint will return, losing the component x, y, theta.

Is this stripping behavior intentional? Should the parsing be updated to strip only the final interfaces part (e.g. /position), while preserving the planar joint suffix (e.g. /x)?

ROS Distro

Jazzy

OS and version

Ubuntu 24.04

Source or binary build?

Binary

If binary, which release version?

2.12.3

If source, which branch?

No response

Which RMW are you using?

CycloneDDS

Steps to Reproduce

Try out this tutorial

https://moveit.picknik.ai/main/doc/examples/mobile_base_arm/mobile_base_arm_tutorial.html

but replace moveit_simple_controller_manager/MoveItSimpleControllerManager with moveit_ros_control_interface/Ros2ControlManager

Expected behavior

moveit_ros_control_interface/Ros2ControlManager should find the controller with OOO/x, OOO/y, OOO/theta interface and pass the trajectory to it.

Actual behavior

moveit_ros_control_interface/Ros2ControlManager couldn't find the controller even though it's there

Backtrace or Console output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions