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

Can't remove added collision model

asked 2012-09-11 16:14:26 -0600

mrath gravatar image

updated 2014-01-28 17:13:38 -0600

ngrennan gravatar image

I am doing manipulation with the PR2, and have trouble with removing a collision model I added earlier. I realize that this might be because I don't fully comprehend how the arm_navigation stack works.

I am adding the collision model of the picked object to the collision map, and subsequently adding it as an attached object. I have tried using the /environment_server/set_planning_scene_diff service, but this fails to even add the collision model in the first place.

So I first add it by publishing a CollisionObject message on /collision_object and then an AttachedCollsionObject message on /attached_collision_object. This works fine for attaching the object, as I can see it on the /attached_objects marker in Rviz and I can send MoveArm goals afterwards.

However, none of the following work for removal of the collision object after placing it:

In terminal:

rosservice call /collider_node/reset "{}"

In node:

reset_object = arm_nav_msg.AttachedCollisionObject()
reset_object.link_name = "all"
reset_object.object.header.stamp = rospy.Time.now()
reset_object.object.header.frame_id = "/base_link"
reset_object.object.operation.operation = reset_object.object.operation.REMOVE
reset_object.object.id = "all"
attach_pub.publish(reset_object) # Publishes to /attached_collision_object
collision_pub.publish(reset_object.object) # Publishes to /collision_object

Even though this is the only ways to do it I could come across. It is still there in Rviz, and arm navigation fails, since the gripper has moved, and is now "in contact" with the attached object (which hasn't been removed).

Obviously, restarting the arm navigation does the trick, but that shouldn't really be necessary, eh?

edit retag flag offensive close merge delete

Comments

Maybe a refresh of the planning scene is needed?

bit-pirate gravatar image bit-pirate  ( 2012-09-11 18:18:05 -0600 )edit

Can you elaborate? I tried getting the current planning scene, and sending that one back, but with empty arrays for attached_collision_objects and collision_objects

mrath gravatar image mrath  ( 2012-09-12 03:47:14 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-09-12 07:57:41 -0600

mrath gravatar image

Ok, I know have gotten a simple example to work. I discarded everything I had and wrote a simple Python node, that can successfully attach an object and remove it again.

I guess it was indeed poor understanding of how the arm_navigation stack works, as it seems like the following is the procedure that works.

For attaching:

  • Add CollisionObject to collision_objects in the planning scene using the /environment_server/set_planning_scene_diff service
  • Publish CollisionObject on the /collision_object topic
  • Publish AttachedCollisionObject on the /attached_collision_object topic

For removing attached objects:

  • Using the same topic and message as point 3 above, with the following settings:

    rm_object = arm_navigation_msgs.msg.AttachedCollisionObject()
    rm_object.link_name = rm_object.REMOVE_ALL_ATTACHED_OBJECTS
    rm_object.object.operation.operation = rm_object.object.operation.REMOVE
    
  • The planning scene then needs to be refreshed, as @bit-pirate pointed out. Do this be sending an empty GetPlanningSceneRequest to environment_server/set_planning_scene_diff

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2012-09-11 16:14:26 -0600

Seen: 449 times

Last updated: Sep 12 '12