moveit / moveit2_tutorials

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

MoveItPy tutorial seems not working #804

Open ravijo opened 1 year ago

ravijo commented 1 year ago

Description

I am trying to get started with Motion Planning Python API by following the official tutorial. RViz window pops up, but the Panda arm is not moving. RViz shows a warning saying, "Requesting initial scene failed," as shown in the screenshot below:

Screenshot

Your environment

Steps to reproduce

I am executing the following command mentioned in the documentation.

$ ros2 launch moveit2_tutorials motion_planning_python_api_tutorial.launch.py

Expected behaviour

I expect the Panda arm to move.

Backtrace or Console output

sea-bass commented 1 year ago

What version is your moveit_resources repo? I submitted a fix related to this issue for the Panda configuration ~6 days ago in https://github.com/ros-planning/moveit_resources/pull/190 -- can you ensure you have that, rebuid, and try again?

Also, if you're using the main branch of the tutorials, note that these require building MoveIt on the main branch from source at the moment. Not sure if you're installing moveit from binaries?

sea-bass commented 1 year ago

Actually, never mind, might be a duplicate of https://github.com/ros-planning/moveit2_tutorials/issues/784

ravijo commented 1 year ago

@sea-bass

Thanks for quick response. Using https://github.com/ros-planning/moveit_resources/pull/190, the RViz warning is gone. But the robot arm is still not moving. There is an AttributeError displayed on the terminal.

Below are the commands:

$ cd moveit_resources
$ git log
commit 3d6a737f95fb7e5f3cfdc306d12b0bb6cbdadfb2 (HEAD -> ros2, origin/ros2, origin/HEAD)
Author: Sebastian Castro <4603398+sea-bass@users.noreply.github.com>
Date:   Tue Oct 24 02:56:55 2023 -0400

    Fix Panda demo launch for MoveIt 2 tutorials (#190)

$ git fetch origin pull/190/head:moveitpy
$ colcon build --mixin release

$ ros2 launch moveit2_tutorials motion_planning_python_api_tutorial.launch.py
[INFO] [launch]: All log files can be found below /home/user/.ros/log/2023-10-30-12-32-56-639336-dell-87156
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [motion_planning_python_api_tutorial.py-1]: process started with pid [87159]
[INFO] [robot_state_publisher-2]: process started with pid [87161]
[INFO] [ros2_control_node-3]: process started with pid [87163]
[INFO] [rviz2-4]: process started with pid [87165]
[INFO] [static_transform_publisher-5]: process started with pid [87167]
[INFO] [ros2 run controller_manager spawner panda_arm_controller-6]: process started with pid [87169]
[INFO] [ros2 run controller_manager spawner panda_hand_controller-7]: process started with pid [87171]
[INFO] [ros2 run controller_manager spawner joint_state_broadcaster-8]: process started with pid [87173]
[static_transform_publisher-5] [INFO] [1698636776.975412383] [static_transform_publisher]: Spinning until stopped - publishing transform
[static_transform_publisher-5] translation: ('0.000000', '0.000000', '0.000000')
[static_transform_publisher-5] rotation: ('0.000000', '0.000000', '0.000000', '1.000000')
[static_transform_publisher-5] from 'world' to 'panda_link0'
[ros2_control_node-3] [WARN] [1698636776.976797857] [controller_manager]: [Deprecated] Passing the robot description parameter directly to the control_manager node is deprecated. Use '~/robot_description' topic from 'robot_state_publisher' instead.
[ros2_control_node-3] [INFO] [1698636776.977012410] [resource_manager]: Loading hardware 'PandaFakeSystem' 
[ros2_control_node-3] [INFO] [1698636776.977513324] [resource_manager]: Initialize hardware 'PandaFakeSystem' 
[ros2_control_node-3] [WARN] [1698636776.977546227] [mock_generic_system]: Parsing of optional initial interface values failed or uses a deprecated format. Add initial values for every state interface in the ros2_control.xacro. For example: 
[ros2_control_node-3] <state_interface name="velocity"> 
[ros2_control_node-3]   <param name="initial_value">0.0</param> 
[ros2_control_node-3] </state_interface>
[ros2_control_node-3] [INFO] [1698636776.977553846] [resource_manager]: Successful initialization of hardware 'PandaFakeSystem'
[ros2_control_node-3] [INFO] [1698636776.977567124] [resource_manager]: Loading hardware 'PandaHandFakeSystem' 
[ros2_control_node-3] [INFO] [1698636776.977573618] [resource_manager]: Initialize hardware 'PandaHandFakeSystem' 
[ros2_control_node-3] [INFO] [1698636776.977580122] [resource_manager]: Successful initialization of hardware 'PandaHandFakeSystem'
[ros2_control_node-3] [INFO] [1698636776.977610189] [resource_manager]: 'configure' hardware 'PandaHandFakeSystem' 
[ros2_control_node-3] [INFO] [1698636776.977613660] [resource_manager]: Successful 'configure' of hardware 'PandaHandFakeSystem'
[ros2_control_node-3] [INFO] [1698636776.977617504] [resource_manager]: 'activate' hardware 'PandaHandFakeSystem' 
[ros2_control_node-3] [INFO] [1698636776.977620448] [resource_manager]: Successful 'activate' of hardware 'PandaHandFakeSystem'
[ros2_control_node-3] [INFO] [1698636776.977623605] [resource_manager]: 'configure' hardware 'PandaFakeSystem' 
[ros2_control_node-3] [INFO] [1698636776.977626420] [resource_manager]: Successful 'configure' of hardware 'PandaFakeSystem'
[ros2_control_node-3] [INFO] [1698636776.977630753] [resource_manager]: 'activate' hardware 'PandaFakeSystem' 
[ros2_control_node-3] [INFO] [1698636776.977633511] [resource_manager]: Successful 'activate' of hardware 'PandaFakeSystem'
[rviz2-4] Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
[ros2_control_node-3] [INFO] [1698636776.981055760] [controller_manager]: update rate is 100 Hz
[ros2_control_node-3] [INFO] [1698636776.981196726] [controller_manager]: RT kernel is recommended for better performance
[robot_state_publisher-2] [WARN] [1698636776.986207136] [kdl_parser]: The root link panda_link0 has an inertia specified in the URDF, but KDL does not support a root link with an inertia.  As a workaround, you can add an extra dummy link to your URDF.
[robot_state_publisher-2] [INFO] [1698636776.987972301] [robot_state_publisher]: got segment panda_hand
[robot_state_publisher-2] [INFO] [1698636776.988152969] [robot_state_publisher]: got segment panda_leftfinger
[robot_state_publisher-2] [INFO] [1698636776.988171135] [robot_state_publisher]: got segment panda_link0
[robot_state_publisher-2] [INFO] [1698636776.988182048] [robot_state_publisher]: got segment panda_link1
[robot_state_publisher-2] [INFO] [1698636776.988206463] [robot_state_publisher]: got segment panda_link2
[robot_state_publisher-2] [INFO] [1698636776.988216985] [robot_state_publisher]: got segment panda_link3
[robot_state_publisher-2] [INFO] [1698636776.988227746] [robot_state_publisher]: got segment panda_link4
[robot_state_publisher-2] [INFO] [1698636776.988237737] [robot_state_publisher]: got segment panda_link5
[robot_state_publisher-2] [INFO] [1698636776.988261882] [robot_state_publisher]: got segment panda_link6
[robot_state_publisher-2] [INFO] [1698636776.988272505] [robot_state_publisher]: got segment panda_link7
[robot_state_publisher-2] [INFO] [1698636776.988282850] [robot_state_publisher]: got segment panda_link8
[robot_state_publisher-2] [INFO] [1698636776.988293013] [robot_state_publisher]: got segment panda_rightfinger
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636777.073150135] [moveit_cpp_initializer]: Initialize rclcpp
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636777.073819564] [moveit_cpp_initializer]: Initialize node parameters
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636777.073838208] [moveit_cpp_initializer]: Initialize node and executor
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636777.091876134] [moveit_cpp_initializer]: Spin separate thread
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636777.100750940] [moveit_644873175.rdf_loader]: Loaded robot model in 0.00185544 seconds
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636777.100808451] [moveit_robot_model.robot_model]: Loading robot model 'panda'...
[motion_planning_python_api_tutorial.py-1] [WARN] [1698636777.117649708] [kdl_parser]: The root link panda_link0 has an inertia specified in the URDF, but KDL does not support a root link with an inertia.  As a workaround, you can add an extra dummy link to your URDF.
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636777.117717136] [moveit_kinematics_base.kinematics_base]: Joint weights for group 'panda_arm': 1 1 1 1 1 1 1
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636777.148435000] [moveit_644873175.planning_scene_monitor]: Publishing maintained planning scene on 'monitored_planning_scene'
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636777.148557340] [moveit_644873175.moveit_cpp]: Listening to '/joint_states' for joint states
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636777.149745212] [moveit_644873175.current_state_monitor]: Listening to joint states on topic '/joint_states'
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636777.150262151] [moveit_644873175.planning_scene_monitor]: Listening to '/moveit_cpp/planning_scene_monitor' for attached collision objects
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636777.150277053] [moveit_644873175.planning_scene_monitor]: Starting planning scene monitor
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636777.150586437] [moveit_644873175.planning_scene_monitor]: Listening to '/moveit_cpp/publish_planning_scene'
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636777.150600351] [moveit_644873175.planning_scene_monitor]: Starting world geometry update monitor for collision objects, attached objects, octomap updates.
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636777.150899490] [moveit_644873175.planning_scene_monitor]: Listening to 'collision_object'
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636777.151205403] [moveit_644873175.planning_scene_monitor]: Listening to 'planning_scene_world' for planning scene world geometry
[motion_planning_python_api_tutorial.py-1] [WARN] [1698636777.153581721] [moveit_644873175.occupancy_map_monitor]: Resolution not specified for Octomap. Assuming resolution = 0.1 instead
[motion_planning_python_api_tutorial.py-1] [ERROR] [1698636777.153630565] [moveit_644873175.occupancy_map_monitor]: No 3D sensor plugin(s) defined for octomap updates
[rviz2-4] [INFO] [1698636777.255338812] [rviz2]: Stereo is NOT SUPPORTED
[rviz2-4] [INFO] [1698636777.255490731] [rviz2]: OpenGl version: 4.5 (GLSL 4.5)
[rviz2-4] [INFO] [1698636777.307585035] [rviz2]: Stereo is NOT SUPPORTED
[ros2_control_node-3] [INFO] [1698636777.370739586] [controller_manager]: Loading controller 'panda_arm_controller'
[ros2_control_node-3] [WARN] [1698636777.381721769] [panda_arm_controller]: [Deprecated]: "allow_nonzero_velocity_at_trajectory_end" is set to true. The default behavior will change to false.
[ros2_control_node-3] [INFO] [1698636777.404703552] [controller_manager]: Loading controller 'panda_hand_controller'
[ros2 run controller_manager spawner panda_arm_controller-6] [INFO] [1698636777.412555593] [spawner_panda_arm_controller]: Loaded panda_arm_controller
[rviz2-4] [WARN] [1698636777.415166849] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic.
[ros2_control_node-3] [INFO] [1698636777.422561113] [controller_manager]: Configuring controller 'panda_arm_controller'
[ros2_control_node-3] [INFO] [1698636777.422696652] [panda_arm_controller]: No specific joint names are used for command interfaces. Using 'joints' parameter.
[ros2_control_node-3] [INFO] [1698636777.422714003] [panda_arm_controller]: Command interfaces are [position] and state interfaces are [position velocity].
[ros2_control_node-3] [INFO] [1698636777.422725515] [panda_arm_controller]: Using 'splines' interpolation method.
[ros2_control_node-3] [INFO] [1698636777.426544843] [panda_arm_controller]: Action status changes will be monitored at 20.00 Hz.
[rviz2-4] [INFO] [1698636777.433931633] [rviz2.rdf_loader]: Loaded robot model in 0.00228304 seconds
[rviz2-4] [INFO] [1698636777.433998351] [moveit_robot_model.robot_model]: Loading robot model 'panda'...
[ros2 run controller_manager spawner panda_hand_controller-7] [INFO] [1698636777.435300265] [spawner_panda_hand_controller]: Loaded panda_hand_controller
[ros2_control_node-3] [INFO] [1698636777.441985660] [controller_manager]: Configuring controller 'panda_hand_controller'
[ros2_control_node-3] [INFO] [1698636777.442089406] [panda_hand_controller]: Action status changes will be monitored at 20Hz.
[ros2 run controller_manager spawner panda_arm_controller-6] [INFO] [1698636777.442755628] [spawner_panda_arm_controller]: Configured and activated panda_arm_controller
[ros2 run controller_manager spawner panda_hand_controller-7] [INFO] [1698636777.462825958] [spawner_panda_hand_controller]: Configured and activated panda_hand_controller
[INFO] [ros2 run controller_manager spawner panda_arm_controller-6]: process has finished cleanly [pid 87169]
[INFO] [ros2 run controller_manager spawner panda_hand_controller-7]: process has finished cleanly [pid 87171]
[rviz2-4] [INFO] [1698636777.693846489] [rviz2.rdf_loader]: Loaded robot model in 0.00221105 seconds
[rviz2-4] [INFO] [1698636777.693902266] [moveit_robot_model.robot_model]: Loading robot model 'panda'...
[rviz2-4] [WARN] [1698636777.706851057] [rviz2.robot_model_loader]: No kinematics plugins defined. Fill and load kinematics.yaml!
[rviz2-4] [INFO] [1698636777.756893317] [rviz2.planning_scene_monitor]: Starting planning scene monitor
[rviz2-4] [INFO] [1698636777.759293443] [rviz2.planning_scene_monitor]: Listening to '/moveit_cpp/monitored_planning_scene'
[ros2_control_node-3] [INFO] [1698636778.221502320] [controller_manager]: Loading controller 'joint_state_broadcaster'
[ros2 run controller_manager spawner joint_state_broadcaster-8] [INFO] [1698636778.233307331] [spawner_joint_state_broadcaster]: Loaded joint_state_broadcaster
[ros2_control_node-3] [INFO] [1698636778.235965501] [controller_manager]: Configuring controller 'joint_state_broadcaster'
[ros2_control_node-3] [INFO] [1698636778.236086771] [joint_state_broadcaster]: 'joints' or 'interfaces' parameter is empty. All available state interfaces will be published
[ros2 run controller_manager spawner joint_state_broadcaster-8] [INFO] [1698636778.253286777] [spawner_joint_state_broadcaster]: Configured and activated joint_state_broadcaster
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.265698617] [moveit_644873175.planning_pipeline]: Using planning interface 'OMPL'
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.273351799] [moveit_644873175.planning_pipeline]: Using planning request adapter 'Add Time Optimal Parameterization'
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.273382067] [moveit_644873175.planning_pipeline]: Using planning request adapter 'Resolve constraint frames to robot links'
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.273387470] [moveit_644873175.planning_pipeline]: Using planning request adapter 'Fix Workspace Bounds'
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.273392003] [moveit_644873175.planning_pipeline]: Using planning request adapter 'Fix Start State Bounds'
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.273396182] [moveit_644873175.planning_pipeline]: Using planning request adapter 'Fix Start State In Collision'
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.273400494] [moveit_644873175.planning_pipeline]: Using planning request adapter 'Fix Start State Path Constraints'
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.278155431] [moveit.pilz_industrial_motion_planner.joint_limits_aggregator]: Reading limits from namespace robot_description_planning
[motion_planning_python_api_tutorial.py-1] [WARN] [1698636778.279059660] [moveit.pilz_industrial_motion_planner.joint_limits_aggregator]: Multi-DOF-Joint 'virtual_joint' not supported.
[motion_planning_python_api_tutorial.py-1] [WARN] [1698636778.279078811] [moveit.pilz_industrial_motion_planner.joint_limits_aggregator]: Multi-DOF-Joint 'virtual_joint' not supported.
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.283772110] [moveit.pilz_industrial_motion_planner]: Available plugins: pilz_industrial_motion_planner/PlanningContextLoaderCIRC pilz_industrial_motion_planner/PlanningContextLoaderLIN pilz_industrial_motion_planner/PlanningContextLoaderPTP 
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.283833748] [moveit.pilz_industrial_motion_planner]: About to load: pilz_industrial_motion_planner/PlanningContextLoaderCIRC
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.285040056] [moveit.pilz_industrial_motion_planner]: Registered Algorithm [CIRC]
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.285063511] [moveit.pilz_industrial_motion_planner]: About to load: pilz_industrial_motion_planner/PlanningContextLoaderLIN
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.285881427] [moveit.pilz_industrial_motion_planner]: Registered Algorithm [LIN]
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.285903172] [moveit.pilz_industrial_motion_planner]: About to load: pilz_industrial_motion_planner/PlanningContextLoaderPTP
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.286838055] [moveit.pilz_industrial_motion_planner]: Registered Algorithm [PTP]
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.286862974] [moveit_644873175.planning_pipeline]: Using planning interface 'Pilz Industrial Motion Planner'
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.290855867] [moveit_644873175.planning_pipeline]: Using planning request adapter 'Fix Workspace Bounds'
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.290890467] [moveit_644873175.planning_pipeline]: Using planning request adapter 'Fix Start State Bounds'
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.290896494] [moveit_644873175.planning_pipeline]: Using planning request adapter 'Fix Start State In Collision'
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.290901025] [moveit_644873175.planning_pipeline]: Using planning request adapter 'Fix Start State Path Constraints'
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.297181127] [moveit_644873175.planning_pipeline]: Using planning interface 'CHOMP'
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.301390514] [moveit_644873175.planning_pipeline]: Using planning request adapter 'Add Time Optimal Parameterization'
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.301440103] [moveit_644873175.planning_pipeline]: Using planning request adapter 'Fix Workspace Bounds'
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.301447092] [moveit_644873175.planning_pipeline]: Using planning request adapter 'Fix Start State Bounds'
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.301451617] [moveit_644873175.planning_pipeline]: Using planning request adapter 'Fix Start State In Collision'
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.301456039] [moveit_644873175.planning_pipeline]: Using planning request adapter 'Fix Start State Path Constraints'
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.344250690] [moveit.plugins.moveit_simple_controller_manager]: Added FollowJointTrajectory controller for panda_arm_controller
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.344290159] [moveit.plugins.moveit_simple_controller_manager]: Max effort set to 0.0
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.346370098] [moveit.plugins.moveit_simple_controller_manager]: Added GripperCommand controller for panda_hand_controller
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.346563512] [moveit.plugins.moveit_simple_controller_manager]: Returned 2 controllers in list
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.346629853] [moveit.plugins.moveit_simple_controller_manager]: Returned 2 controllers in list
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.347266401] [moveit_644873175.trajectory_execution_manager]: Trajectory execution is managing controllers
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.354218320] [moveit_py.pose_goal]: MoveItPy instance created
[motion_planning_python_api_tutorial.py-1] Traceback (most recent call last):
[motion_planning_python_api_tutorial.py-1]   File "/home/user/ws_moveit2_main_iron/install/moveit2_tutorials/lib/moveit2_tutorials/motion_planning_python_api_tutorial.py", line 176, in <module>
[motion_planning_python_api_tutorial.py-1]     main()
[motion_planning_python_api_tutorial.py-1]   File "/home/user/ws_moveit2_main_iron/install/moveit2_tutorials/lib/moveit2_tutorials/motion_planning_python_api_tutorial.py", line 71, in main
[motion_planning_python_api_tutorial.py-1]     panda_arm.set_start_state(configuration_name="ready")
[motion_planning_python_api_tutorial.py-1] AttributeError: 'moveit.planning.PlanningComponent' object has no attribute 'set_start_state'. Did you mean: 'get_start_state'?
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.397704598] [moveit_644873175.moveit_cpp]: Deleting MoveItCpp
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.405911036] [moveit_644873175.planning_scene_monitor]: Stopped publishing maintained planning scene.
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.406594949] [moveit_644873175.planning_scene_monitor]: Stopping world geometry monitor
[motion_planning_python_api_tutorial.py-1] [INFO] [1698636778.406755408] [moveit_644873175.planning_scene_monitor]: Stopping planning scene monitor
[INFO] [ros2 run controller_manager spawner joint_state_broadcaster-8]: process has finished cleanly [pid 87173]
[ERROR] [motion_planning_python_api_tutorial.py-1]: process has died [pid 87159, exit code 1, cmd '/home/user/ws_moveit2_main_iron/install/moveit2_tutorials/lib/moveit2_tutorials/motion_planning_python_api_tutorial.py --ros-args -r __node:=moveit_py --params-file /tmp/launch_params_jwfxa8wc'].
tylerjw commented 11 months ago

@peterdavidfagan have you seen this?

LeonYo153 commented 6 months ago

Hello, I wonder if it's solved now? I met the same problem