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

PlanningSceneInterface not supported in MoveIt2 (script file: pickplace.py) #647

Open
DeruiZhao opened this issue Jan 27, 2025 · 7 comments

Comments

@DeruiZhao
Copy link

Description

In the MoveIt MTC example pickplace.py, the line from moveit_commander import PlanningSceneInterface is used. However, moveit_commander is not supported in MoveIt 2. This causes the example to fail when running in a MoveIt 2 environment.

Expected Behavior

The example should use MoveIt 2 compatible APIs to interact with the planning scene.

Actual Behavior

The example fails because moveit_commander is not available in MoveIt 2.

Steps to Reproduce

  1. Run the pickplace.py example.
  2. Observe the error related to moveit_commander.

System Information

  • ROS 2 Distro: jazzy
  • MoveIt Version: MoveIt 2
@rhaschke
Copy link
Contributor

The example should use MoveIt 2 compatible APIs to interact with the planning scene.

AFAIK, there is no Python API available to interact with the PlanningSceneInterface, is it?
@moveit/maintainers

@adamanov
Copy link

adamanov commented Jan 28, 2025

The example should use MoveIt 2 compatible APIs to interact with the planning scene.

AFAIK, there is no Python API available to interact with the PlanningSceneInterface, is it? @moveit/maintainers

Hello,

they ported it recently moveit.core.planning_scene

example from tutorial
motion_planning_python_api_planning_scene.py

@rhaschke
Copy link
Contributor

The provided link refers to MoveItPy's planning scene, which is just a wrapper of a PlanningScene object. All of MoveItPy doesn't interact with the move_group node, but instead wraps a new instance of MoveItCpp.

MGI and PSI are not yet wrapped in Python by the official maintainer team.
There was an attempt made for MGI: moveit/moveit2#2574, but rejected in favor of pymoveit2. However, this is not yet released.

Maybe a MoveIt2 maintainer can comment on the desired approach. To increase its visibility, I think the pymoveit2 package should be moved into the moveit organization and released. @AndrejOrsula, what do you think about that idea?

@AndrejOrsula
Copy link

Maybe a MoveIt2 maintainer can comment on the desired approach. To increase its visibility, I think the pymoveit2 package should be moved into the moveit organization and released. @AndrejOrsula, what do you think about that idea?

Thanks for tagging me! Yes, that sounds like a good idea if you think there’s interest in using pymoveit2.

@adamanov
Copy link

adamanov commented Jan 29, 2025

The provided link refers to MoveItPy's planning scene, which is just a wrapper of a PlanningScene object. All of MoveItPy doesn't interact with the move_group node, but instead wraps a new instance of MoveItCpp.

MGI and PSI are not yet wrapped in Python by the official maintainer team. There was an attempt made for MGI: moveit/moveit2#2574, but rejected in favor of pymoveit2. However, this is not yet released.

Maybe a MoveIt2 maintainer can comment on the desired approach. To increase its visibility, I think the pymoveit2 package should be moved into the moveit organization and released. @AndrejOrsula, what do you think about that idea?

I see sorry,

We are currently transitioning our manipulator applications from ROS1 to ROS2 using Python and are still getting familiar with the developments in MoveIt2. Since the MoveIt2 Python bindings no longer directly support pick and place operations, I started exploring the MoveIt Task Constructor (MTC) Python bindings as an alternative.

Given that pymoveit2 is not officially released and MoveIt2 Python binding currently lacks support for PlanningSceneInterface, is it possible to implement a simple pick-and-place application solely using MTC without relying on pymoveit2?

I noticed the modify_planning_scene.py and constrained.py example where MTC interacts with the Planning Scene and adds objects to the scene. Would such an approach be suitable for pick-and-place applications by modifying the current pickplace.py example and basically combining it with modify_planning_scene.py?

I would appreciate your answer as well @AndrejOrsula , thanks in advance

PS: using MoveIt 2 main

@rhaschke
Copy link
Contributor

  1. MoveIt2 will probably no longer support the old pick and place actions. The modern way to realize complex tasks is using MTC.
  2. There are two options to run MTC-based Pick+Place:
    1. Using MoveItPy, which runs independently from the external move_group node.
    2. Using pymoveit2 to communicate with the move_group node. This also provides the GetPlanningScene and ApplyPlanningScene services. On that basis, a new PSI can be easily realized using the ROS1 code. @AndrejOrsula, would you be interested (and available) to attempt this?
  3. The ModifyPlanningScene stage just operates on a PlanningScene local to the MTC process. The question is how to initialize that scene from a local or external PS monitor via the above methods.

@AndrejOrsula
Copy link

  1. There are two options to run MTC-based Pick+Place:

    1. ...
    2. Using pymoveit2 to communicate with the move_group node. This also provides the GetPlanningScene and ApplyPlanningScene services. On that basis, a new PSI can be easily realized using the ROS1 code. @AndrejOrsula, would you be interested (and available) to attempt this?

Unfortunately, I won’t be able to take this on as I have other ongoing commitments. Most of pymoveit2 was originally developed ~4 years ago (in a rush) to simplify training & evaluation of RL manipulation policies (which influenced some of the design decisions), but I haven’t added many new features since then. For instance, relevant parts of the robot description are hardcoded for each robot instead of being parsed — a feature that should probably be prioritized.

If someone wants to get started on it, I would be happy to answer any questions. The phantomx_pincher repo also contains equivalent ROS 1 (moveit_commander) and ROS 2 (pymoveit2) examples, including a pick&place demo, that could perhaps serve as a reference.

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

No branches or pull requests

4 participants