42 x_extent = y_extent = z_extent = 0.0;
46 if (shape_msg.dimensions.size() >= geometric_shapes::solidPrimitiveDimCount<shape_msgs::SolidPrimitive::SPHERE>())
47 x_extent = y_extent = z_extent = shape_msg.dimensions[shape_msgs::SolidPrimitive::SPHERE_RADIUS] * 2.0;
51 if (shape_msg.dimensions.size() >= geometric_shapes::solidPrimitiveDimCount<shape_msgs::SolidPrimitive::BOX>())
53 x_extent = shape_msg.dimensions[shape_msgs::SolidPrimitive::BOX_X];
54 y_extent = shape_msg.dimensions[shape_msgs::SolidPrimitive::BOX_Y];
55 z_extent = shape_msg.dimensions[shape_msgs::SolidPrimitive::BOX_Z];
60 if (shape_msg.dimensions.size() >= geometric_shapes::solidPrimitiveDimCount<shape_msgs::SolidPrimitive::CYLINDER>())
62 x_extent = y_extent = shape_msg.dimensions[shape_msgs::SolidPrimitive::CYLINDER_RADIUS] * 2.0;
63 z_extent = shape_msg.dimensions[shape_msgs::SolidPrimitive::CYLINDER_HEIGHT];
68 if (shape_msg.dimensions.size() >= geometric_shapes::solidPrimitiveDimCount<shape_msgs::SolidPrimitive::CONE>())
70 x_extent = y_extent = shape_msg.dimensions[shape_msgs::SolidPrimitive::CONE_RADIUS] * 2.0;
71 z_extent = shape_msg.dimensions[shape_msgs::SolidPrimitive::CONE_HEIGHT];
79 x_extent = y_extent = z_extent = 0.0;
80 if (!shape_msg.vertices.empty())
82 double xmin = std::numeric_limits<double>::max(), ymin = std::numeric_limits<double>::max(),
83 zmin = std::numeric_limits<double>::max();
84 double xmax = -std::numeric_limits<double>::max(), ymax = -std::numeric_limits<double>::max(),
85 zmax = -std::numeric_limits<double>::max();
86 for (
const geometry_msgs::Point& vertex : shape_msg.vertices)
101 x_extent = xmax - xmin;
102 y_extent = ymax - ymin;
103 z_extent = zmax - zmin;