moveit / moveit2

:robot: MoveIt for ROS 2
https://moveit.ai/
BSD 3-Clause "New" or "Revised" License
982 stars 492 forks source link

publish_scene_from_text does not work without --scene #2104

Open christian-rauch opened 1 year ago

christian-rauch commented 1 year ago

Description

The tool moveit_publish_scene_from_text does not work without providing --scene and hence cannot publish on topic /planning_scene_world.

Origin of the Problem

The --scene flag changes the topic of where the scene is published on. This is controlled by full_scene in the code: https://github.com/ros-planning/moveit2/blob/c686bb8dc312029430d6c353799ef462d05bb3e7/moveit_ros/planning/planning_components_tools/src/publish_scene_from_text.cpp#L62-L67 and then sets the topic: https://github.com/ros-planning/moveit2/blob/c686bb8dc312029430d6c353799ef462d05bb3e7/moveit_ros/planning/planning_components_tools/src/publish_scene_from_text.cpp#L77-L86

The topic is either /planning_scene (with --scene) or /planning_scene_world (without --scene).

However, when the node waits here: https://github.com/ros-planning/moveit2/blob/c686bb8dc312029430d6c353799ef462d05bb3e7/moveit_ros/planning/planning_components_tools/src/publish_scene_from_text.cpp#L103-L105 it only considers the option for the pub_scene topic which is only defined when --scene is set.

Removing the last "waiting" part fixes the issue and successfully publishes the "world" on /planning_scene_world.

Steps to reproduce

Terminal 1 (publish scene):

ros2 run moveit_ros_planning moveit_publish_scene_from_text ${scene_file} --ros-args -p robot_description:="${urdf}" -p robot_description_semantic:="${srdf}"

Terminal 2 (monitor scene):

ros2 topic echo /planning_scene_world

Expected behaviour

The scene message should be published on topic /planning_scene_world.

Actual behaviour

No messages arrive.

github-actions[bot] commented 1 year ago

This issue is being labeled as stale because it has been open 45 days with no activity. It will be automatically closed after another 45 days without follow-ups.

github-actions[bot] commented 11 months ago

This issue was closed because it has been stalled for 45 days with no activity.

henningkayser commented 7 months ago

@christian-rauch what's the current status on this issue? Have you found a suitable solution like defaulting to "--scene" input? We are currently not using these tools and would long-term consider rewriting convenience features like this in Python. If you provide a PR, we are happy to assist.