You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When executed this way, the following ros_control_interface log is displayed
However, when checking the /moveit_simple_controller_manager node, only the /controller_manager namespace exists, and the /left/controller_manager and /right/controller_manager namespaces are missing.
analysis
From the log, it can be seen that the namespace is correctly found based on the service name, and the Ros2ControlManager is properly initialized. controller_manager_plugin.cpp#L555-L581
voiddiscover()
{
// Skip if last discovery is too new for discovery rateif ((node_->now() - controller_managers_stamp_) < CONTROLLER_INFORMATION_VALIDITY_AGE)
return;
controller_managers_stamp_ = node_->now();
const std::map<std::string, std::vector<std::string>> services = node_->get_service_names_and_types();
for (constauto& service : services)
{
constauto& service_name = service.first;
std::size_t found = service_name.find("controller_manager/list_controllers");
if (found != std::string::npos)
{
std::string ns = service_name.substr(0, found);
if (controller_managers_.find(ns) == controller_managers_.end())
{ // create Ros2ControlManager if it does not existRCLCPP_INFO_STREAM(getLogger(), "Adding controller_manager interface for node at namespace " << ns);
auto controller_manager = std::make_shared<moveit_ros_control_interface::Ros2ControlManager>(ns);
controller_manager->initialize(node_);
controller_managers_.insert(std::make_pair(ns, controller_manager));
}
}
}
}
The issue seems to be within the initialize function of the Ros2ControlManager.
Since ns_ is not empty, if ros_control_namespace is not defined, it will be decided as the / namespace; if it is defined, it will be determined by the defined namespace.
I think if ns_ is not empty, it should be skipped.
I confirmed that it works correctly after modifying it as below. However, I haven't thoroughly tested it in various cases.
if (ns_.empty())
{
if (!node_->has_parameter("ros_control_namespace"))
{
ns_ = node_->declare_parameter<std::string>("ros_control_namespace", "/");
}
else
{
node_->get_parameter<std::string>("ros_control_namespace", ns_);
}
}
ROS Distro
Jazzy
OS and version
Ubuntu24.04
Source or binary build?
Binary
If binary, which release version?
2.10.0-1noble.20241118.194622
If source, which branch?
No response
Which RMW are you using?
CycloneDDS
Steps to Reproduce
.
Expected behavior
There should be two, /left/controller_manager and /right/controller_manager, in the /moveit_simple_controller_manager node.
Actual behavior
when checking the /moveit_simple_controller_manager node, only the /controller_manager namespace exists, and the /left/controller_manager and /right/controller_manager namespaces are missing.
Backtrace or Console output
No response
The text was updated successfully, but these errors were encountered:
Description
Problem
When using two ROS2 controls, the namespace is automatically detected, but the namespace is not properly applied when registering the action client.
The execution of the two ROS controls is as follows:
When executed this way, the following ros_control_interface log is displayed
However, when checking the /moveit_simple_controller_manager node, only the /controller_manager namespace exists, and the /left/controller_manager and /right/controller_manager namespaces are missing.
analysis
From the log, it can be seen that the namespace is correctly found based on the service name, and the Ros2ControlManager is properly initialized.
controller_manager_plugin.cpp#L555-L581
controller_manager_plugin.cpp#L258-L262
The issue seems to be within the initialize function of the Ros2ControlManager.
Since ns_ is not empty, if ros_control_namespace is not defined, it will be decided as the / namespace; if it is defined, it will be determined by the defined namespace.
I think if ns_ is not empty, it should be skipped.
controller_manager_plugin.cpp#L264-L291
I confirmed that it works correctly after modifying it as below. However, I haven't thoroughly tested it in various cases.
ROS Distro
Jazzy
OS and version
Ubuntu24.04
Source or binary build?
Binary
If binary, which release version?
2.10.0-1noble.20241118.194622
If source, which branch?
No response
Which RMW are you using?
CycloneDDS
Steps to Reproduce
.
Expected behavior
There should be two, /left/controller_manager and /right/controller_manager, in the /moveit_simple_controller_manager node.
Actual behavior
when checking the /moveit_simple_controller_manager node, only the /controller_manager namespace exists, and the /left/controller_manager and /right/controller_manager namespaces are missing.
Backtrace or Console output
No response
The text was updated successfully, but these errors were encountered: