Ask Your Question
0

Attaching objects to the robot's body in diamondback

asked 2012-02-09 01:59:58 -0500

lechn_do gravatar image

updated 2012-03-12 00:53:11 -0500

Hallo everybody,

I followed this tutorial: Attaching objects to the robot's body

I just wanted to attach a cylinder to the endeffector of my robot arm to avoid collisions between the environment and the object carried by the robot... but it does not work...

ros::Publisher att_object_in_map_pub  = nh.advertise<mapping_msgs::AttachedCollisionObject>("attached_collision_object", 10);
mapping_msgs::AttachedCollisionObject att_object;
att_object.link_name = "link_name";
att_object.object.id = "box";
att_object.object.operation.operation = mapping_msgs::CollisionObjectOperation::ADD;
att_object.object.header.frame_id = "link_name";
att_object.touch_links.push_back("contact_link");
att_object.object.header.stamp = ros::Time::now();
geometric_shapes_msgs::Shape object;
object.type = geometric_shapes_msgs::Shape::CYLINDER;
object.dimensions.resize(2);
object.dimensions[0] = radius*1.2;
object.dimensions[1] = hight*1.2;
geometry_msgs::Pose pose;
pose.position.x = 0.0;
pose.position.y = 0.0;
pose.position.z = object.dimensions[1]/2.0;
pose.orientation.x = 0;
pose.orientation.y = 0;
pose.orientation.z = 0;
pose.orientation.w = 1;
att_object.object.shapes.push_back(object);
att_object.object.poses.push_back(pose);
att_object_in_map_pub.publish(att_object);

the arm and the collision free path planning works fine but the attached object is ignored...

can anyone tell me which "Display Type" i have to add in rviz to get the attached object displayed?
Which "Display Type" is "Known objects" in the tutorial?
any ideas what could cause my problem? are there any visionaries in the community?

Update:

I also followed this tutorial:
Adding known objects to the collision environment
Worked!!! but of course in this case the object is not attached to the arm...

I also solved my problem with the "DisplayType"...
Type: Markers, Topic: /collision_model_markers/environment_server
This worked for the tutorial "Adding known objects to the collision environment"
I hope it's the same for the other one...

Update 2:
@ egiljones
The link names are different for my robot. The code above is part of a function and the link names are given as arguments. I don't think that this is problem... Anyway, thx for the answer...

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2012-02-29 06:24:10 -0500

egiljones gravatar image

Is there an actual link on your robot called "link_name"? If not, this code fragment will not actually do anything - you must specify a valid link that's associated with your robot to have the AttachedObject take effect. This link need not actually touch the object, but when you update the position of that link it will also update the position of any attached bodies. Add to the 'touch_links' any additional links that it's ok for the attached object to contact - if you don't do this for all links that will be in constant contact with the object then planning won't work, as every state will be in collision.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2012-02-09 01:59:58 -0500

Seen: 207 times

Last updated: Mar 12 '12