-
Notifications
You must be signed in to change notification settings - Fork 544
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
Update controller_manager_plugin.cpp #3179
base: main
Are you sure you want to change the base?
Conversation
Fixing the bug where the namespace is not properly applied when using Ros2ControlMultiManager
@wizard-coder - I reviewed the ticket as well - can you post the contents of |
As a note - this logic has been touched quite a bit in the past:
|
The contents of the config file are as follows: ros2_contollers.left.yaml/**/controller_manager:
ros__parameters:
update_rate: 100 # Hz
arm_controller:
type: joint_trajectory_controller/JointTrajectoryController
joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster
/**/arm_controller:
ros__parameters:
joints:
- left_joint0
- left_joint1
- left_joint2
- left_joint3
- left_joint4
- left_joint5
- left_joint6
command_interfaces:
- position
state_interfaces:
- position
allow_nonzero_velocity_at_trajectory_end: true
/**/joint_state_broadcaster:
ros__parameters:
joints:
- left_joint0
- left_joint1
- left_joint2
- left_joint3
- left_joint4
- left_joint5
- left_joint6
interfaces:
- position ros2_controllers.right.yaml/**/controller_manager:
ros__parameters:
update_rate: 100 # Hz
arm_controller:
type: joint_trajectory_controller/JointTrajectoryController
joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster
/**/arm_controller:
ros__parameters:
joints:
- right_joint0
- right_joint1
- right_joint2
- right_joint3
- right_joint4
- right_joint5
- right_joint6
command_interfaces:
- position
state_interfaces:
- position
allow_nonzero_velocity_at_trajectory_end: true
/**/joint_state_broadcaster:
ros__parameters:
joints:
- right_joint0
- right_joint1
- right_joint2
- right_joint3
- right_joint4
- right_joint5
- right_joint6
interfaces:
- position |
In the case of Ros2ControlManager, since ns_ is initialized as an empty string, I believe it should be initialized from the ros_control_namespace parameter. However, in the case of Ros2ControlMultiManager, it first finds the namespaces and then initializes ns_ through the Ros2ControlManager(const std::string& ns) initialization function. Therefore, since ns_ is already set at this point, I believe the initialization via ros_control_namespace should be ignored. |
There we go - that's the part I was missing as to how you were getting the ns_ set initially - thanks. |
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #3179 +/- ##
==========================================
+ Coverage 44.45% 44.45% +0.01%
==========================================
Files 698 698
Lines 61561 61558 -3
Branches 7461 7459 -2
==========================================
+ Hits 27360 27361 +1
+ Misses 34033 34028 -5
- Partials 168 169 +1 ☔ View full report in Codecov by Sentry. |
Fixing the bug where the namespace is not properly applied when using Ros2ControlMultiManager
Description
When using two ROS2 controls, the namespace is automatically detected, but the namespace is not properly applied when registering the action client.
For more details, please refer to #3150