ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Adding Collision Objects

asked 2017-03-07 12:53:22 -0500

palak_hirpara gravatar image

Hello,

I am trying to add collision objects to the planning scene interface. However, the moveit planning seems to ignore the collision objects. I am passing a list of boxes as collision objects. Here is the code:

moveit_utils::MicoController srv_controller;
moveit::planning_interface::MoveGroup group("arm");
moveit::planning_interface::PlanningSceneInterface planning_scene_interface;
ROS_INFO("COLLISION SIZE\n");
ROS_INFO_STREAM(collision_objects.size());
sleep(2.0);
planning_scene_interface.addCollisionObjects(collision_objects);

group.setPlanningTime(10.0); //5 second maximum for collision computation
moveit::planning_interface::MoveGroup::Plan my_plan;

group.setStartState(*group.getCurrentState());
group.setPoseTarget(p_target);

ROS_INFO("[mico_moveit_cartesianpose_service.cpp] starting to plan...");
bool success = group.plan(my_plan);
if(success)
    ROS_INFO("planning successful\n");
else 
    ROS_INFO("not successful :( \n");

Thank You.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-03-08 03:28:06 -0500

v4hn gravatar image

Either use the applyCollisionObjects method instead of addCollisionObjects or sleep again after you added the objects. The latter function runs asynchronously and your planning request probably arrives before your collision object is processed.

Also see http://docs.ros.org/kinetic/api/movei...

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2017-03-07 12:53:22 -0500

Seen: 748 times

Last updated: Mar 08 '17