-
Notifications
You must be signed in to change notification settings - Fork 196
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
Python API tutorial launch file not working with default parameters #724
Comments
If I remove |
I face the same issue. Do we need to add the planner plugin in the YAML? Is it because the MoveitConfigBuilder is unable to find the the planner plugin in the default path? |
@peterdavidfagan @henningkayser Stuck on this for a while. Are we missing something here? |
Hi @pinakjani, Apologies for delay in response I am working towards a research deadline and as a result I haven't been very active in maintaining the Python library. The tutorials were only tested against Humble at the time of their release. If I get time to I will look into this issue in greater detail. |
Hi, @pinakjani and @dghw, I had the same issue, and I think I partially solved it. My setup is ROS2 Humble on Ubuntu 22.04.2 LTS I believe that these instructions as well as some of the other settings in the tutorial are incorrect or incomplete. Instead, here's what I have in terms of code settings: First, the launch file in my ROS2 package:
Here's my YAML file for .moveit_cpp (spot_arm_moveit.yaml):
What seems to be happening is that this part In contrast, this part in the tutorial In other words, I think there seems to be a namespace conflict in the tutorial example. I can get my package to work with the above changes. Having said that, I still get this warning when running my code:
In other words, I'm still having trouble correctly specifying my moveit_cpp YAML file (spot_arm_moveit.yaml) so that MoveItPy can find the pipelines I specified. But, at least my code now works with default solvers, and I can get my robot to do planning and rendered in rviz. Let me know if that above works for you, and if you can also figure out how to fix the warnings I mentioned above. |
Hi @nbkn865, Yes, you are right it looks like a namespace issue, I think @dghw also suggested that the default planner with I am currently working on a different project for now but will give it a shot as soon as I get a chance. 👨💻 |
@pinakjani this is correct, you need to include the plugin in the config for the planner, this should be included by default in the resources package used by If you wanted to use plan_request_params:
planning_attempts: 1
planning_pipeline: chomp
max_velocity_scaling_factor: 1.0
max_acceleration_scaling_factor: 1.0 Where importantly you list your planning_pipeline as chomp. If you want to run a plan with a specific planner or perform parallel planning you can use the Python API to specify ompl_rrtc: # Namespace for individual plan request
plan_request_params: # PlanRequestParameters similar to the ones that are used by the single pipeline planning of moveit_cpp
planning_attempts: 1 # Number of attempts the planning pipeline tries to solve a given motion planning problem
planning_pipeline: ompl # Name of the pipeline that is being used
planner_id: "RRTConnectkConfigDefault" # Name of the specific planner to be used by the pipeline
max_velocity_scaling_factor: 1.0 # Velocity scaling parameter for the trajectory generation algorithm that is called (if configured) after the path planning
max_acceleration_scaling_factor: 1.0 # Acceleration scaling parameter for the trajectory generation algorithm that is called (if configured) after the path planning
planning_time: 1.0 # Time budget for the motion plan request. If the planning problem cannot be solved within this time, an empty solution with error code is returned
|
@nbkn865 you are correct the tutorial in its current form needs updating. The issue relates to mismatches between In particular the cause of the error is this line. This namespace needs to be different from the planning_pipeline_id for the chomp planner. Likely this should be documented somewhere, if the pipeline name is defined under pipeline_names it should have a corresponding namespace with the planner config. You don't want conflicts between these parameters and plan_request_parameters. Below is an example of how these parameters should be separated for # chomp planner config (read automatically from resources package)
chomp.add_randomness
chomp.animate_endeffector
chomp.animate_endeffector_segment
chomp.animate_path
chomp.collision_clearance
chomp.collision_threshold
chomp.default_workspace_bounds
chomp.enable_failure_recovery
chomp.hmc_annealing_factor
chomp.hmc_discretization
chomp.hmc_stochasticity
chomp.jiggle_fraction
chomp.joint_update_limit
chomp.learning_rate
chomp.max_iterations
chomp.max_iterations_after_collision_free
chomp.max_recovery_attempts
chomp.max_sampling_attempts
chomp.min_angle_change
chomp.obstacle_cost_weight
chomp.path_tolerance
chomp.planning_plugin
chomp.planning_time_limit
chomp.pseudo_inverse_ridge_factor
chomp.random_jump_amount
chomp.request_adapters
chomp.resample_dt
chomp.ridge_factor
chomp.smoothness_cost_acceleration
chomp.smoothness_cost_jerk
chomp.smoothness_cost_velocity
chomp.smoothness_cost_weight
chomp.start_state_max_bounds_error
chomp.start_state_max_dt
chomp.trajectory_initialization_method
chomp.use_hamiltonian_monte_carlo
chomp.use_pseudo_inverse
chomp.use_stochastic_descent
# plan request parameters (defined in tutorial config file)
chomp_planner.plan_request_params.max_acceleration_scaling_factor
chomp_planner.plan_request_params.max_velocity_scaling_factor
chomp_planner.plan_request_params.planning_attempts
chomp_planner.plan_request_params.planning_pipeline
chomp_planner.plan_request_params.planning_time |
Addressed in #792. |
@nbkn865 following up on your additional questions.
You likely want to set your config to
This warning is due to the plugin implementation not setting the response value, I don't think this warning is a major concern. |
Closing for now as addressed in the open pull request, please follow up with questions here or through opening a another issue and tagging me in this issue. |
Description
Python API tutorial fails, using default configuration/script/launch files
Your environment
Steps to reproduce
ros2 launch moveit2_tutorials motion_planning_python_api_tutorial.launch.py
as from https://moveit.picknik.ai/main/doc/examples/motion_planning_python_api/motion_planning_python_api_tutorial.htmlNote: have verified that the Pick and Place with MoveIt Task Constructor tutorial works, and so does the Jupyter Notebook Prototyping tutorial, although I get some errors e.g.:
[WARN] [1690796515.991981572] [moveit_py]: Parameter 'plan_request_params.planner_id' not found in config use default value instead, check parameter type and namespace in YAML file
so I guess the Jupyter Notebook tutorial doesn't use the same YAML config file as the standard Python one
Expected behaviour
Backtrace or Console output
(Relevant excerpt)
[motion_planning_python_api_tutorial.py-1] Traceback (most recent call last):
[motion_planning_python_api_tutorial.py-1] File "/home/external/moveit2/iron/install/moveit2_tutorials/lib/moveit2_tutorials/motion_planning_python_api_tutorial.py", line 176, in
[motion_planning_python_api_tutorial.py-1] main()
[motion_planning_python_api_tutorial.py-1] File "/home/external/moveit2/iron/install/moveit2_tutorials/lib/moveit2_tutorials/motion_planning_python_api_tutorial.py", line 62, in main
[motion_planning_python_api_tutorial.py-1] panda = MoveItPy(node_name="moveit_py")
[motion_planning_python_api_tutorial.py-1] RuntimeError: Planning plugin name is empty. Please choose one of the available plugins: chomp_interface/CHOMPPlanner, ompl_interface/OMPLPlanner, pilz_industrial_motion_planner/CommandPlanner, stomp_moveit/StompPlanner
[ERROR] [motion_planning_python_api_tutorial.py-1]: process has died [pid 379489, exit code 1, cmd '/home/external/moveit2/iron/install/moveit2_tutorials/lib/moveit2_tutorials/motion_planning_python_api_tutorial.py --ros-args -r __node:=moveit_py --params-file /tmp/launch_params_utfrvk4b'].
The text was updated successfully, but these errors were encountered: