本文整理汇总了C++中OcTree::toBoxes方法的典型用法代码示例。如果您正苦于以下问题:C++ OcTree::toBoxes方法的具体用法?C++ OcTree::toBoxes怎么用?C++ OcTree::toBoxes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OcTree
的用法示例。
在下文中一共展示了OcTree::toBoxes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: generateBoxesFromOctomap
void generateBoxesFromOctomap(std::vector<CollisionObject*>& boxes, OcTree& tree)
{
std::vector<boost::array<FCL_REAL, 6> > boxes_ = tree.toBoxes();
for(std::size_t i = 0; i < boxes_.size(); ++i)
{
FCL_REAL x = boxes_[i][0];
FCL_REAL y = boxes_[i][1];
FCL_REAL z = boxes_[i][2];
FCL_REAL size = boxes_[i][3];
FCL_REAL cost = boxes_[i][4];
FCL_REAL threshold = boxes_[i][5];
Box* box = new Box(size, size, size);
box->cost_density = cost;
box->threshold_occupied = threshold;
CollisionObject* obj = new CollisionObject(boost::shared_ptr<CollisionGeometry>(box), Transform3f(Vec3f(x, y, z)));
boxes.push_back(obj);
}
std::cout << "boxes size: " << boxes.size() << std::endl;
}