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

About AttachedCollisionObject

asked 2012-11-28 04:15:01 -0500

Sanxano gravatar image

Hi everyone,

Just a quick question,

If you want add two or three attached objects into a scenery, You must to do this?:

arm_navigation_msgs::AttachedCollisionObject pieza1_object;
pieza1_object.link_name = "r_gripper_r_finger_tip_link";
...
pieza1_object.object.operation.operation = arm_navigation_msgs::CollisionObjectOperation::ADD;
...                                                                       
pieza1_object.object.header.frame_id = "odom_combined"; //Referencia origen
pieza1_object.object.header.stamp = ros::Time::now();
...
pieza1_object.object.shapes.push_back(pieza1S);
pieza1_object.object.poses.push_back(pieza1P);
//
**att_object_in_map_pub_.publish(pieza1_object);** //ADD into scenary
//
pieza1_object.object.operation.operation = arm_navigation_msgs::CollisionObjectOperation::DETACH_AND_ADD_AS_OBJECT;
**att_object_in_map_pub_.publish(pieza1_object);** // Change the state

arm_navigation_msgs::AttachedCollisionObject pieza2_object;
pieza2_object.link_name = "r_gripper_r_finger_tip_link";
...
...
**att_object_in_map_pub_.publish(pieza1_object);** //ADD into scenary
//
pieza2_object.object.operation.operation = arm_navigation_msgs::CollisionObjectOperation::DETACH_AND_ADD_AS_OBJECT;
**att_object_in_map_pub_.publish(pieza2_object);** // Change the state

And following this question,

Is it necessary to do:

if(!get_planning_scene_client.call(planning_scene_req, planning_scene_res)) {
      ROS_WARN("Can't get planning scene");
      return -1;
  }

After every object state modification?

Regards.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2012-11-28 04:44:04 -0500

dornhege gravatar image

Have a look at the WorldInterface class in pr2_python. This gives examples for the functionality and I can confirm that it works this way. Even as a C++ guy you should be able to understand what is going on.

Note, that there is a delay after each publish, not sure how necessary that is.

As to the second question: No. This just resets the planning scene. The procedures above influence the world interface and your objects are stored there. However, before you use any component that uses the planning scene (as e.g. the planning scene display in rviz) you should do the reset to get your world updates into the planning scene.

edit flag offensive delete link more
0

answered 2012-11-28 04:43:15 -0500

abc gravatar image

do anyone have complete tutorial on robot navigating a map with full implementation . please help

edit flag offensive delete link more

Comments

2

Please do not create answers for discussion or comments. This is not a forum. Instead, open a new question.

dornhege gravatar image dornhege  ( 2012-11-28 04:44:57 -0500 )edit

Question Tools

Stats

Asked: 2012-11-28 04:15:01 -0500

Seen: 165 times

Last updated: Nov 28 '12