Skip to content

Instantly share code, notes, and snippets.

@evenator
Created March 26, 2013 03:02
Show Gist options
  • Save evenator/5242794 to your computer and use it in GitHub Desktop.
Save evenator/5242794 to your computer and use it in GitHub Desktop.
attaching objects to gripper in ROS
void MechanismInterface::attachObjectToGripper(std::string arm_name, std::string collision_object_name)
{
arm_navigation_msgs::AttachedCollisionObject obj;
obj.object.header.stamp = ros::Time::now();
obj.object.header.frame_id = handDescription().robotFrame(arm_name);
obj.object.operation.operation = arm_navigation_msgs::CollisionObjectOperation::ATTACH_AND_REMOVE_AS_OBJECT;
obj.object.id = collision_object_name;
obj.link_name = handDescription().attachLinkName(arm_name);
obj.touch_links = handDescription().gripperTouchLinkNames(arm_name);
attached_object_pub_.publish(obj);
}
https://code.ros.org/svn/wg-ros-pkg/stacks/object_manipulation/trunk/object_manipulator/src/tools/mechanism_interface.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment