Skip to content

Add new option to MoveGroupInterface to specify move group node's namespace#533

Merged
henningkayser merged 6 commits intomoveit:mainfrom
JafarAbdi:pr-move_group_ns
Oct 7, 2021
Merged

Add new option to MoveGroupInterface to specify move group node's namespace#533
henningkayser merged 6 commits intomoveit:mainfrom
JafarAbdi:pr-move_group_ns

Conversation

@JafarAbdi
Copy link
Copy Markdown
Member

Description

Currently, it's not possible to specify the move group node's namespace in the move group interface, which makes it not possible to have different motion planning displays that connect to different move groups, could be tested with https://github.com/JafarAbdi/moveit2_tutorials/tree/pr-multi_arm

Fix: https://answers.ros.org/question/381276/ros2-rviz-node-two-robots-with-different-namespaces/

Checklist

  • Required by CI: Code is auto formatted using clang-format
  • Extend the tutorials / documentation reference
  • Document API changes relevant to the user in the MIGRATION.md notes
  • Create tests, which fail without this PR reference
  • Include a screenshot if changing a GUI
  • While waiting for someone to review your request, please help review another open pull request to support the maintainers

@codecov
Copy link
Copy Markdown

codecov bot commented Jul 1, 2021

Codecov Report

Merging #533 (055a7d7) into main (792ce15) will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #533      +/-   ##
==========================================
- Coverage   54.23%   54.23%   -0.00%     
==========================================
  Files         192      192              
  Lines       20224    20224              
==========================================
- Hits        10967    10966       -1     
- Misses       9257     9258       +1     
Impacted Files Coverage Δ
...e/collision_detection_fcl/src/collision_common.cpp 74.40% <0.00%> (-0.24%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 792ce15...055a7d7. Read the comment docs.

@davetcoleman
Copy link
Copy Markdown
Member

@JafarAbdi your link to the tutorials implies this is for multi-arm support. But I think we should be clear whether this is for:

  • Two arms on one robot
  • Two robots with one arm each

For the former, users should be using one unified URDF and one MoveGroup, IMHO.

Which use case is this for?

@JafarAbdi
Copy link
Copy Markdown
Member Author

@JafarAbdi your link to the tutorials implies this is for multi-arm support. But I think we should be clear whether this is for:

  • Two arms on one robot
  • Two robots with one arm each

For the former, users should be using one unified URDF and one MoveGroup, IMHO.

Which use case is this for?

@davetcoleman This's for the second case, I agree that having one MoveGroup node is what we should do in the first case

Copy link
Copy Markdown
Member

@davetcoleman davetcoleman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Joe and I reviewed this together and like this change. However we think a unit test should be written to demonstrate that everything loads up correctly with and without the namespace. Could you set this up?

@JafarAbdi
Copy link
Copy Markdown
Member Author

JafarAbdi commented Jul 8, 2021

Reported from discord

Hey, I'm not able to initialize MoveGroupInterface using #533
Calling MoveGroupInterface constructor cause node freeze due to wait_for_servers params equals infinity. With mentioned PR above, move_group action_servers exists within changed path:
/$(namespace)/execute_trajectory
/$(namespace)/move_action
and MoveGroupInterface stuck here https://github.com/ros-planning/moveit2/blob/f601eef5e66e7b6c62e77b55d9f5e9e6706f7335/moveit_ros/planning_interface/move_group_interface/src/move_group_interface.cpp#L153 It is possible to set wait_for_servers for certain time, but then it make impossible to execute robot commands. How to initialize MoveGroupInterface within namespace?

You may reproduce it by using mentioned above PR with corresponding launch file https://github.com/JafarAbdi/moveit2_tutorials/blob/pr-multi_arm/doc/quickstart_in_rviz/launch/demo.launch.py
and the calling move_group interface, e.g. with this launch https://github.com/ros-planning/moveit2_tutorials/blob/main/doc/move_group_interface/launch/move_group_interface_tutorial.launch.py
Adding namespace here or/and modifying yaml params doesn't work.

Sry, now it works, i forgot about slash in constructor
auto mgi_options = moveit::planning_interface::MoveGroupInterface::Options("arm_1_ur_manipulator", "/arm_1/", "arm_1.robot_description");

TODO: Handle slashes for the namespace parameter

@henningkayser henningkayser merged commit e1fff4d into moveit:main Oct 7, 2021
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.

4 participants