Exemplo n.º 1
0
bool getBoundingBox(GetBoundingBox::Request &req, GetBoundingBox::Response &res)
{
  ROS_INFO("GETTING BOUNDING BOX");

  if (primitives.count(req.name) > 0)
  {
    BoundingBox *obj = (BoundingBox*)primitives.at(req.name);
    if (obj->getPrimitiveType() == srs_interaction_primitives::PrimitiveType::BOUNDING_BOX)
    {
      res.name = req.name;
      res.frame_id = obj->getFrameID();
      res.pose_type = obj->getPoseType();
      res.pose = obj->getPose();
      res.description = obj->getDescription();
      res.color = obj->getColor();
      res.scale = obj->getScale();
      res.object_name = obj->getAttachedObjectName();
      return true;
    }
  }
  ROS_ERROR("Bounding box with that name doesn't exist!");
  return false;
}