Skip to content
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

Fix namespacing for multiple instances of gazebo_ros2_control plugin (backport #181) #398

Merged
merged 2 commits into from
Jan 7, 2025

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Dec 23, 2024

Fixes the issue described in #127
It appears that when adding __ns tags to ros args on nodes that have already been namespaced, something odd happens.
I'm not too sure what happens on the rclcpp node side of things but removing the additional namespace tags on the args seems to fix the issue for me at least.
I'm running Humble on 22.04 so I've only tested against the humble branch.
I also removed the additional RCL_ROS_ARGS_FLAG in the arguments because I don't think it was doing anything.
Cheers Ben


This is an automatic backport of pull request #181 done by Mergify.

…181)

Co-authored-by: ben.holden <[email protected]>
Co-authored-by: Christoph Froehlich <[email protected]>
(cherry picked from commit 828b5f2)
@IslamTagi
Copy link

IslamTagi commented Dec 24, 2024

How soon can this be merged in as I am currently having namespacing problems when I run 2 instances of a position_controller.
my /agent_0/controller_manager and /agent_1/controller_manager are correctly configured and I can start 2 instances of the joint_state_broadcaster but when trying to do the same for the position_controller, the latter one is always set to "unconfigured". Does this PR solve this? If so, how soon will it be merged, or is there a way I can use the same changes on my local workspace?

For reference, this is my current setup
I am running Humble on WSL 22.04
image

I should also say the namespacing works fine when it is one robot, but when I add a second agent it stops working

@christophfroehlich
Copy link
Contributor

you always can compile the branch of this PR from source. even if it is merged now, it will take a couple of weeks to be released as a binary

@IslamTagi
Copy link

@christophfroehlich do you mind running me through how i can compile this so that my workspace uses this customized version of the package? When I cloned and tried building it I ran into errors and I am fairly new to this so am not sure if I am making a mistake

@christophfroehlich
Copy link
Contributor

Checkout the mergify/bp/humble/pr-181 branch of this repository in your workspace and compile it with colcon. maybe you have to uninstall the installed binary (sudo apt-get remove ros-humbe-gazebo-ros2-control)

@IslamTagi
Copy link

Checkout the mergify/bp/humble/pr-181 branch of this repository in your workspace and compile it with colcon. maybe you have to uninstall the installed binary (sudo apt-get remove ros-humbe-gazebo-ros2-control)

Worked a charm, thank you for your support!

@christophfroehlich
Copy link
Contributor

Checkout the mergify/bp/humble/pr-181 branch of this repository in your workspace and compile it with colcon. maybe you have to uninstall the installed binary (sudo apt-get remove ros-humbe-gazebo-ros2-control)

Worked a charm, thank you for your support!

@IslamTagi Could you please leave your approval here? (Files Changed Tab -> Review Changes Button)

@ros-gy
Copy link

ros-gy commented Jan 6, 2025

Hello @christophfroehlich, I too am looking for this to be backported to Humble. I am testing this using the humble-desktop docker image, and while it shows namespacing correctly for diff_drive_namespaced.launch.py, I am seeing this error when trying to run "diff_drive_pair_namespace.launch.py":

[ERROR] [spawn_entity.py-6]: process has died [pid 3699, exit code 1, cmd '/opt/ros/humble/lib/gazebo_ros/spawn_entity.py -topic /r2/robot_description -robot_namespace r2 -entity diffbot1 --ros-args'].

I'm guessing the topic for robot description should not include "/r2" if a namespace is specified? Or I could be missing something else.

The error above is followed with the below warning, repeated.

[ros2-9] [WARN] [1736193642.914013199] [_ros2cli_3981]: Could not contact service /r1/controller_manager/load_controller
[ros2-9] [INFO] [1736193642.914430196] [_ros2cli_3981]: waiting for service /r1/controller_manager/load_controller to become available...

@christophfroehlich
Copy link
Contributor

@ros-gy have you tried using the plugin from this PR? or the released one without this fix?

@ros-gy
Copy link

ros-gy commented Jan 6, 2025

@ros-gy have you tried using the plugin from this PR? or the released one without this fix?

I built this branch mergify/bp/humble/pr-181, and then tried that demo launch file.

I'm looking to test this fix, and then give you the approval so we can get it into the binaries soon.

@ahcorde ahcorde merged commit 01be3f3 into humble Jan 7, 2025
5 checks passed
@ahcorde ahcorde deleted the mergify/bp/humble/pr-181 branch January 7, 2025 11:09
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.

5 participants