moveit / moveit_ros

THIS REPO HAS MOVED TO https://github.com/ros-planning/moveit
70 stars 118 forks source link

Benchmarking Segfault in Planning Stage #354

Open davetcoleman opened 11 years ago

davetcoleman commented 11 years ago

Using latest source, OMPL segfaults when using benchmarking. I tracked it down to where it crosses into the OMPL library itself...

The motion planning request is:

workspace_parameters: 
  header: 
    seq: 0
    stamp: 0.000000000
    frame_id: 
  min_corner: 
    x: 0
    y: 0
    z: 0
  max_corner: 
    x: 0
    y: 0
    z: 0
start_state: 
  joint_state: 
    header: 
      seq: 0
      stamp: 0.000000000
      frame_id: /base
    name[]
      name[0]: head_pan
      name[1]: left_s0
      name[2]: left_s1
      name[3]: left_e0
      name[4]: left_e1
      name[5]: left_w0
      name[6]: left_w1
      name[7]: left_w2
      name[8]: left_gripper_l_finger_joint
      name[9]: left_gripper_r_finger_joint
      name[10]: right_s0
      name[11]: right_s1
      name[12]: right_e0
      name[13]: right_e1
      name[14]: right_w0
      name[15]: right_w1
      name[16]: right_w2
      name[17]: right_gripper_l_finger_joint
      name[18]: right_gripper_r_finger_joint
    position[]
      position[0]: 0
      position[1]: -1.59479
      position[2]: -0.0604895
      position[3]: 0.469904
      position[4]: 1.22184
      position[5]: 2.06193
      position[6]: 0.87572
      position[7]: 1.75659
      position[8]: 0
      position[9]: 0
      position[10]: 0
      position[11]: 0
      position[12]: 0
      position[13]: 0
      position[14]: 0
      position[15]: 0
      position[16]: 0
      position[17]: 0
      position[18]: 0
    velocity[]
    effort[]
  multi_dof_joint_state: 
    header: 
      seq: 0
      stamp: 0.000000000
      frame_id: /base
    joint_names[]
    transforms[]
    twist[]
    wrench[]
  attached_collision_objects[]
  is_diff: 0
goal_constraints[]
  goal_constraints[0]: 
    name: industrial_pose_0000
    joint_constraints[]
    position_constraints[]
      position_constraints[0]: 
            header: 
          seq: 0
          stamp: 0.000000000
          frame_id: /base
        link_name: left_wrist
        target_point_offset: 
          x: 0
          y: 0
          z: 0
        constraint_region: 
          primitives[]
            primitives[0]: 
                        type: 1
              dimensions[]
                dimensions[0]: 1.19209e-06
                dimensions[1]: 1.19209e-06
                dimensions[2]: 1.19209e-06
          primitive_poses[]
            primitive_poses[0]: 
                        position: 
                x: 0.853983
                y: 0.660279
                z: 0.419242
              orientation: 
                x: 0
                y: 0
                z: 0
                w: 1
          meshes[]
          mesh_poses[]
        weight: 1
    orientation_constraints[]
      orientation_constraints[0]: 
            header: 
          seq: 0
          stamp: 0.000000000
          frame_id: /base
        orientation: 
          x: -0.270595
          y: 0.65328
          z: 0.270603
          w: 0.653282
        link_name: left_wrist
        absolute_x_axis_tolerance: 1.19209e-06
        absolute_y_axis_tolerance: 1.19209e-06
        absolute_z_axis_tolerance: 1.19209e-06
        weight: 1
    visibility_constraints[]
path_constraints: 
  name: 
  joint_constraints[]
  position_constraints[]
  orientation_constraints[]
  visibility_constraints[]
trajectory_constraints: 
  constraints[]
planner_id: left_arm[SBLkConfigDefault]
group_name: left_arm
num_planning_attempts: 0
allowed_planning_time: 3

The backtrace is:

#0  0x00007fffdc0a4294 in ompl_interface::ModelBasedPlanningContext::preSolve() () from /home/dave/ros/ws_moveit/devel/lib/libmoveit_ompl_interface.so
#1  0x00007fffdc0a68a0 in ompl_interface::ModelBasedPlanningContext::solve(double, unsigned int) () from /home/dave/ros/ws_moveit/devel/lib/libmoveit_ompl_interface.so
#2  0x00007fffdc0a727a in ompl_interface::ModelBasedPlanningContext::solve(planning_interface::MotionPlanDetailedResponse&) () from /home/dave/ros/ws_moveit/devel/lib/libmoveit_ompl_interface.so
#3  0x00007ffff7b1e10c in moveit_benchmarks::BenchmarkExecution::runPlanningBenchmark (this=0x7fffffffc360, req=...)
    at /home/dave/ros/ws_moveit/src/moveit_ros/benchmarks/benchmarks/src/benchmark_execution.cpp:1090
#4  0x00007ffff7b1ad16 in moveit_benchmarks::BenchmarkExecution::runBenchmark (this=0x7fffffffc360, req=...) at /home/dave/ros/ws_moveit/src/moveit_ros/benchmarks/benchmarks/src/benchmark_execution.cpp:771
#5  0x00007ffff7b1473e in moveit_benchmarks::BenchmarkExecution::runAllBenchmarks (this=0x7fffffffc360, type=1) at /home/dave/ros/ws_moveit/src/moveit_ros/benchmarks/benchmarks/src/benchmark_execution.cpp:402
#6  0x0000000000422548 in main (argc=3, argv=0x7fffffffd1b8) at /home/dave/ros/ws_moveit/src/moveit_ros/benchmarks/benchmarks/src/run_benchmarks.cpp:91

It crashes at:

bool gls = ompl_simple_setup_.getGoal()->hasType(ob::GOAL_LAZY_SAMPLES);

Any guidance welcomed!

RedoXyde commented 10 years ago

Hi,

I had the same problem (Ubuntu12.04, ROS Hydro) and traced it back to: benchmarks/benchmarks/src/benchmark_execution.cpp on line 1081 The clear() function should not clear the start and goal positions/constraints but it actually does, so the planning request doesn't make sense and the assertion fails in preSolve()

Comment this line (1081) and it should work. It may also be better to move Line 1069 in the for loop to make sure to clean the planning context, but I'm not really sure about that.

I know it has been a while since you opened the issue, but I just spent two days trying to find this nasty little bug; I hope this answer might help someone someday...

Best, RedoXPS