Skip to main content

Set collision detection object parameters

Example

moveit_msgs::CollisionObject cylinder;
cylinder.id="Cylinder";
shape_msg::SolidPrimitive primitive;//Set basic shapes and properties
primitve.type=primitive.CYLINDER;
primitive.dimensions.resize(3);
primitive.dimensions[0]=0.6;
primitive.dimensions[1]=0.2;
primitive.dimensions[2]=0.2;
geometry_msgs::Pose pose; //Set the position of the object
pose.position.x = 0 ;
pose.position.y = 0.4;
pose.position.z = 0.5;
cylinder.primitives.push_back(primitive);
cylinder.primitives_poses.push_back(pose);
cylinder.operation = cylinder.ADD;