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

Why environment server does not keep the collision object?

asked 2012-10-30 13:46:05 -0600

updated 2014-01-28 17:14:06 -0600

ngrennan gravatar image

according to my understanding, once we use the set_planning_scene_diff service to add a collision object to the environment_server, it will stay there until another call explicitly deletes it. so if we use a first call to add a cylinder, then we make another set_planning_scene_diff call, but this time, the call is filled with an empty planing scene diff, the cylinder will still be there. but with my test, it seems that is not the case. the following is my test.

i have two nodes. one node(let us call it nodeA) launches a launch file. The launch file is just like the one (myRobot_arm_navigation.launch) generated by the planning_description_configuration_wizard. i.e., it starts the environment_server, ompl, trajectory_filter, kinematics, etc. The other node(let us call it nodeB) is written by myself. it first adds a cylinder as an collision object to the environment_server(through the call of set_planning_scene_diff), and then makes a planning from the start state to the goal where the cylinder is. it works well. then i close nodeB, make some modification to the code(comment the part of adding the cylinder), and re-run it. so this time the set_planning_scene_diff is filled with an empty planing scene. but it seems that the cylinder dispears. is there anybody know why?

thanks.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2012-10-31 01:23:02 -0600

dornhege gravatar image

updated 2012-10-31 01:25:17 -0600

The explanation for this behaviour is simple: your understanding is wrong. It is a bit confusing at first, but everything you did is expected beheviour.

The only way to add objects to the environment server is via the CollisionObject/AttachedCollisionObject topics. Anything done on the planning scene is volatile, i.e. the topics describe the real world, the planning scene is only a modified snapshot.

In addition to that the planning scene is NOT accumulating. Each new set_planning_scene_diff will set the planning scene to what is in the world (via topics) + the diff being send. All other diffs are lost. In particular sending an empty diff will set the planning scene to the world. I hope this clears things up.

edit flag offensive delete link more
1

answered 2012-10-30 22:06:06 -0600

i just messed the two ways to create a collision object.

1) add a collision object through the set_planning_scene_diff call.

arm_navigation_msgs::SetPlanningSceneDiff::Request planning_scene_req;
planning_scene_req.planning_scene_diff.collision_objects.push_back(cylinder_object);

and then call the service.

2) publishing the collision object with an arm_navigation_msgs::CollisionObject topic

with the 1st method, the later call will flush the previous call. with the 2nd method, the object will stay there until an explicit delete command.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2012-10-30 13:46:05 -0600

Seen: 186 times

Last updated: Oct 31 '12