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...
Originally posted by lechn_do on ROS Answers with karma: 1 on 2012-02-09
Post score: 0