当前位置: 首页>>代码示例>>C++>>正文


C++ Billboard::insert方法代码示例

本文整理汇总了C++中Billboard::insert方法的典型用法代码示例。如果您正苦于以下问题:C++ Billboard::insert方法的具体用法?C++ Billboard::insert怎么用?C++ Billboard::insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Billboard的用法示例。


在下文中一共展示了Billboard::insert方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: addBillboard

bool addBillboard(AddBillboard::Request &req, AddBillboard::Response &res)
{
  ROS_INFO("ADDING BILLBOARD");

  InteractiveMarker tmp;
  if ((imServer->get(req.name, tmp)) || (primitives.count(req.name) != 0))
  {
    ROS_ERROR("Object with that name already exists! Please remove it first.");
    return false;
  }

  Billboard *billboard = new Billboard(imServer, req.frame_id, req.name);
  billboard->setType(req.type);
  billboard->setPoseType(req.pose_type);
  billboard->setPose(req.pose);
  billboard->setScale(req.scale);
  billboard->setDescription(req.description);
  billboard->setDirection(req.direction);
  billboard->setVelocity(req.velocity);
  billboard->insert();
  imServer->applyChanges();

  primitives.insert(make_pair(req.name, billboard));

  ROS_INFO("..... DONE");
  return true;
}
开发者ID:ankitasikdar,项目名称:srs_public,代码行数:27,代码来源:service_server.cpp

示例2: main

int main(int argc, char** argv)
{
  ros::init(argc, argv, "test_primitives");

  InteractiveMarkerServerPtr server;
  server.reset(new InteractiveMarkerServer("test_primitives", "", false));

  ColorRGBA c;

  c.a = 0.2;
  c.r = 1.0;
  c.g = 0.0;
  c.b = 0.0;
  Pose p;
  p.position.x = 5;
  p.position.y = 2;
  p.position.z = 1;
  p.orientation.x = M_PI_4;
  p.orientation.y = 0;
  p.orientation.z = M_PI_4;
  Vector3 s;
  s.x = 1.0;
  s.y = 1.0;
  s.z = 1.0;

  // Object
  Billboard *chairBillboard = new Billboard(server, "/world", "person");
  chairBillboard->setType(srs_interaction_primitives::BillboardType::CHAIR);
  chairBillboard->setPose(p);
  chairBillboard->setScale(s);
  chairBillboard->setFrameID("/world");
  chairBillboard->insert();
  // Bounding box
  BoundingBox * chairBoundingBox = new BoundingBox(server, "/world", chairBillboard->getName() + "_bbox");
  chairBoundingBox->setAttachedObjectName(chairBillboard->getName());
  chairBoundingBox->setPose(p);
  chairBoundingBox->setScale(s);
  chairBoundingBox->setColor(c);
  chairBoundingBox->setDescription("Person bounding box");
  chairBoundingBox->insert();

  p.position.x = 1;
  p.position.y = 2;
  p.position.z = 2;
  s.x = 1;
  s.y = 1;
  s.z = 1;
  // Object
  Billboard *milkBillboard = new Billboard(server, "/world", "milk_billboard");
  Quaternion direction;
  direction.x = 2.0;
  direction.y = 1.0;
  direction.z = 3.0;
  direction.w = 1.0;
  milkBillboard->setType(srs_interaction_primitives::BillboardType::MILK);
  milkBillboard->setPose(p);
  milkBillboard->setScale(s);
  milkBillboard->setDirection(direction);
  milkBillboard->setVelocity(3.4);
  milkBillboard->setDescription("MLEEEEKO");
  milkBillboard->insert();

  UnknownObject * unknowObject = new UnknownObject(server, "/world", "unknown_object");
  unknowObject->setFrameID("/world");
  Pose pp;
  pp.position.x = 0;
  pp.position.y = 0;
  pp.position.z = 0;
  unknowObject->setPose(pp);
  Vector3 ss;
  ss.x = 1;
  ss.y = 1;
  ss.z = 1;
  unknowObject->setScale(ss);
  unknowObject->setDescription("Uknown object");
  unknowObject->insert();

  Plane *plane = new Plane(server, "/world", "plane1");
  c.a = 1.0;
  p.position.x = 0;
  p.position.y = 0;
  p.position.z = 0;
  s.x = 5;
  s.y = 2;
  plane->setColor(c);
  plane->setFrameID("/world");
  plane->setPose(p);
  plane->setScale(s);
  plane->insert();
  c.g = 1.0;
  plane->changeColor(c);

  PlanePolygon *planePolygon = new PlanePolygon(server, "/world", "plane_polygon");
  Polygon pol;
  geometry_msgs::Point32 point;
  c.r = 1;
  c.g = 0;
  c.b = 0;
  c.a = 1.0;

//.........这里部分代码省略.........
开发者ID:Praveen-Ramanujam,项目名称:srs_public,代码行数:101,代码来源:test_primitives.cpp


注:本文中的Billboard::insert方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。