Skip to content

Commit

Permalink
Fix "Planning Scene ROS API" tutorial to spawn the object in the gripper
Browse files Browse the repository at this point in the history
  • Loading branch information
sjahr committed Oct 12, 2020
1 parent 40bd382 commit f9a22a5
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,23 +91,24 @@ int main(int argc, char** argv)
// subtract the object from the world
// and to attach the object to the robot.
moveit_msgs::AttachedCollisionObject attached_object;
attached_object.link_name = "panda_leftfinger";
attached_object.link_name = "panda_hand";
/* The header must contain a valid TF frame*/
attached_object.object.header.frame_id = "panda_leftfinger";
attached_object.object.header.frame_id = "panda_hand";
/* The id of the object */
attached_object.object.id = "box";

/* A default pose */
geometry_msgs::Pose pose;
pose.position.z = 0.11;
pose.orientation.w = 1.0;

/* Define a box to be attached */
shape_msgs::SolidPrimitive primitive;
primitive.type = primitive.BOX;
primitive.dimensions.resize(3);
primitive.dimensions[0] = 0.1;
primitive.dimensions[1] = 0.1;
primitive.dimensions[2] = 0.1;
primitive.dimensions[0] = 0.075;
primitive.dimensions[1] = 0.075;
primitive.dimensions[2] = 0.075;

attached_object.object.primitives.push_back(primitive);
attached_object.object.primitive_poses.push_back(pose);
Expand Down Expand Up @@ -194,7 +195,7 @@ int main(int argc, char** argv)
/* First, define the DETACH object message*/
moveit_msgs::AttachedCollisionObject detach_object;
detach_object.object.id = "box";
detach_object.link_name = "panda_link8";
detach_object.link_name = "panda_hand";
detach_object.object.operation = attached_object.object.REMOVE;

// Note how we make sure that the diff message contains no other
Expand Down

0 comments on commit f9a22a5

Please sign in to comment.