本文整理汇总了C++中base::PlannerData::recordEdge方法的典型用法代码示例。如果您正苦于以下问题:C++ PlannerData::recordEdge方法的具体用法?C++ PlannerData::recordEdge怎么用?C++ PlannerData::recordEdge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类base::PlannerData
的用法示例。
在下文中一共展示了PlannerData::recordEdge方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void ompl::control::KPIECE1::getPlannerData(base::PlannerData &data) const
{
Planner::getPlannerData(data);
Grid::CellArray cells;
tree_.grid.getCells(cells);
if (PlannerData *cpd = dynamic_cast<control::PlannerData*>(&data))
{
double delta = siC_->getPropagationStepSize();
for (unsigned int i = 0 ; i < cells.size() ; ++i)
for (unsigned int j = 0 ; j < cells[i]->data->motions.size() ; ++j)
{
const Motion* m = cells[i]->data->motions[j];
if (m->parent)
cpd->recordEdge(m->parent->state, m->state, m->control, m->steps * delta);
else
cpd->recordEdge(NULL, m->state, NULL, 0.);
cpd->tagState(m->state, cells[i]->border ? 2 : 1);
}
}
else
{
for (unsigned int i = 0 ; i < cells.size() ; ++i)
for (unsigned int j = 0 ; j < cells[i]->data->motions.size() ; ++j)
{
const Motion* m = cells[i]->data->motions[j];
data.recordEdge(m->parent ? m->parent->state : NULL, m->state);
data.tagState(m->state, cells[i]->border ? 2 : 1);
}
}
}
示例2:
void ompl::control::SyclopEST::getPlannerData(base::PlannerData& data) const
{
Planner::getPlannerData(data);
if (PlannerData *cpd = dynamic_cast<control::PlannerData*>(&data))
{
const double delta = siC_->getPropagationStepSize();
for (std::vector<Motion*>::const_iterator i = motions_.begin(); i != motions_.end(); ++i)
{
const Motion* m = *i;
if (m->parent)
cpd->recordEdge(m->parent->state, m->state, m->control, m->steps * delta);
else
cpd->recordEdge(NULL, m->state, NULL, 0.);
}
}
else
{
for (std::vector<Motion*>::const_iterator i = motions_.begin(); i != motions_.end(); ++i)
{
const Motion* m = *i;
data.recordEdge(m->parent ? m->parent->state : NULL, m->state);
}
}
}
示例3:
void ompl::geometric::BasicPRMmodif::getPlannerData(base::PlannerData &data) const
{
Planner::getPlannerData(data);
for (unsigned int i = 0 ; i < milestones_.size() ; ++i)
for (unsigned int j = 0 ; j < milestones_[i]->adjacent.size() ; ++j)
data.recordEdge(milestones_[i]->state, milestones_[i]->adjacent[j]->state);
}
示例4:
void ompl::geometric::BallTreeRRTstar::getPlannerData(base::PlannerData &data) const
{
Planner::getPlannerData(data);
std::vector<Motion*> motions;
if (nn_)
nn_->list(motions);
for (unsigned int i = 0 ; i < motions.size() ; ++i)
data.recordEdge(motions[i]->parent ? motions[i]->parent->state : NULL, motions[i]->state);
}
示例5:
void ompl::geometric::LazyRRT::getPlannerData(base::PlannerData &data) const
{
Planner::getPlannerData(data);
std::vector<Motion*> motions;
if (nn_)
nn_->list(motions);
for (unsigned int i = 0 ; i < motions.size() ; ++i)
{
data.recordEdge(motions[i]->parent ? motions[i]->parent->state : NULL, motions[i]->state);
if (motions[i]->valid)
data.tagState(motions[i]->state, 1);
}
}