moveit / moveit2_tutorials

A sphinx-based centralized documentation repo for MoveIt 2
https://moveit.picknik.ai
BSD 3-Clause "New" or "Revised" License
162 stars 196 forks source link

Error in Moveit2 tutorials -- Motion Planning Python API: with planning_scene_monitor.read_write() as scene: [motion_planning_python_api_planning_scene.py-1] TypeError: Unable to convert function return value to a Python type! #987

Open Pittmann-XIE opened 1 week ago

Pittmann-XIE commented 1 week ago

Hey, I am following this tutorial "https://moveit.picknik.ai/main/doc/examples/motion_planning_python_api/motion_planning_python_api_tutorial.html#getting-started" and encountered the following error.

Problem

I ran the first part of this tutorial successfully: ros2 launch moveit2_tutorials motion_planning_python_api_tutorial.launch.py

Then I killed this process and tried to do the second part. As I ran the command: ros2 launch moveit2_tutorials motion_planning_python_api_tutorial.launch.py example_file:=motion_planning_python_api_planning_scene.py. I received this error:

[moveit_515746186.moveit.ros.trajectory_execution_manager]: Trajectory execution is managing controllers [motion_planning_python_api_planning_scene.py-1] [INFO] [1731509289.965633545] [moveit_py_planning_scene]: MoveItPy instance created [motion_planning_python_api_planning_scene.py-1] TypeError: Unregistered type : planning_scene::PlanningScene [motion_planning_python_api_planning_scene.py-1] [motion_planning_python_api_planning_scene.py-1] The above exception was the direct cause of the following exception: [motion_planning_python_api_planning_scene.py-1] [motion_planning_python_api_planning_scene.py-1] Traceback (most recent call last): [motion_planning_python_api_planning_scene.py-1] File "/home/ibrahim-hhi/ws_2/ws_ros_jazzy/ws_moveit/install/moveit2_tutorials/lib/moveit2_tutorials/motion_planning_python_api_planning_scene.py", line 144, in [motion_planning_python_api_planning_scene.py-1] main() [motion_planning_python_api_planning_scene.py-1] File "/home/ibrahim-hhi/ws_2/ws_ros_jazzy/ws_moveit/install/moveit2_tutorials/lib/moveit2_tutorials/motion_planning_python_api_planning_scene.py", line 94, in main [motion_planning_python_api_planning_scene.py-1] add_collision_objects(planning_scene_monitor) [motion_planning_python_api_planning_scene.py-1] File "/home/ibrahim-hhi/ws_2/ws_ros_jazzy/ws_moveit/install/moveit2_tutorials/lib/moveit2_tutorials/motion_planning_python_api_planning_scene.py", line 54, in add_collision_objects [motion_planning_python_api_planning_scene.py-1] with planning_scene_monitor.read_write() as scene: [motion_planning_python_api_planning_scene.py-1] TypeError: Unable to convert function return value to a Python type! The signature was [motion_planning_python_api_planning_scene.py-1] (self: moveit.planning.LockedPlanningSceneContextManagerRW) -> planning_scene::PlanningScene [INFO] [ros2 run controller_manager spawner panda_hand_controller-7]: process has finished cleanly [pid 514448] [motion_planning_python_api_planning_scene.py-1] [INFO] [1731509289.977328094] [moveit_515746186.moveit.ros.moveit_cpp]: Deleting MoveItCpp [INFO] [ros2 run controller_manager spawner joint_state_broadcaster-8]: process has finished cleanly [pid 514449] [motion_planning_python_api_planning_scene.py-1] [INFO] [1731509289.992207564] [moveit_515746186.moveit.ros.planning_scene_monitor]: Stopped publishing maintained planning scene. [motion_planning_python_api_planning_scene.py-1] [INFO] [1731509289.994468726] [moveit_515746186.moveit.ros.planning_scene_monitor]: Stopping world geometry monitor [motion_planning_python_api_planning_scene.py-1] [INFO] [1731509289.994921745] [moveit_515746186.moveit.ros.planning_scene_monitor]: Stopping planning scene monitor [INFO] [ros2 run controller_manager spawner panda_arm_controller-6]: process has finished cleanly [pid 514447] [ERROR] [motion_planning_python_api_planning_scene.py-1]: process has died [pid 514442, exit code 1, cmd '/home/ibrahim-hhi/ws_2/ws_ros_jazzy/ws_moveit/install/moveit2_tutorials/lib/moveit2_tutorials/motion_planning_python_api_planning_scene.py --ros-args -r __node:=moveit_py --params-file /tmp/launch_params_7y_yvm98'].

Does anyone know how to fix this problem? Thanks in advance.

System:

Ubuntu 24.04 Ros version: ros2-jazzy Moveit Tutorial: cloned from "main" branch Moveit2 installation: https://moveit.picknik.ai/main/doc/tutorials/getting_started/getting_started.html