本文整理汇总了C++中OrderedTaskPoint::update_oz方法的典型用法代码示例。如果您正苦于以下问题:C++ OrderedTaskPoint::update_oz方法的具体用法?C++ OrderedTaskPoint::update_oz怎么用?C++ OrderedTaskPoint::update_oz使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OrderedTaskPoint
的用法示例。
在下文中一共展示了OrderedTaskPoint::update_oz方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test_task_aat
bool test_task_aat(TaskManager& task_manager,
const Waypoints &waypoints)
{
const TaskProjection &projection =
task_manager.get_ordered_task().get_task_projection();
task_manager.set_factory(OrderedTask::FACTORY_AAT);
AbstractTaskFactory &fact = task_manager.get_factory();
const Waypoint *wp;
task_report(task_manager, "# adding start\n");
wp = waypoints.lookup_id(1);
if (wp) {
if (!fact.append(fact.createStart(*wp),false)) {
return false;
}
}
task_manager.setActiveTaskPoint(0);
task_manager.resume();
task_report(task_manager, "# adding intermediate\n");
wp = waypoints.lookup_id(2);
if (wp) {
OrderedTaskPoint* tp = fact.createIntermediate(AbstractTaskFactory::AAT_CYLINDER,*wp);
if (tp->get_oz()->shape == ObservationZonePoint::CYLINDER) {
CylinderZone *cz = (CylinderZone *)tp->get_oz();
cz->setRadius(fixed(30000.0));
tp->update_oz(projection);
}
if (!fact.append(tp,false)) {
return false;
}
}
task_report(task_manager, "# adding intermediate\n");
wp = waypoints.lookup_id(3);
if (wp) {
OrderedTaskPoint* tp = fact.createIntermediate(AbstractTaskFactory::AAT_CYLINDER,*wp);
if (tp->get_oz()->shape == ObservationZonePoint::CYLINDER) {
CylinderZone *cz = (CylinderZone *)tp->get_oz();
cz->setRadius(fixed(40000.0));
tp->update_oz(projection);
}
if (!fact.append(tp,false)) {
return false;
}
}
task_report(task_manager, "# adding finish\n");
wp = waypoints.lookup_id(1);
if (wp) {
if (!fact.append(fact.createFinish(*wp),false)) {
return false;
}
}
task_report(task_manager, "# checking task..\n");
if (!fact.validate()) {
return false;
}
if (!task_manager.check_ordered_task()) {
return false;
}
return true;
}
示例2: test_task_mixed
bool test_task_mixed(TaskManager& task_manager,
const Waypoints &waypoints)
{
const TaskProjection &projection =
task_manager.get_ordered_task().get_task_projection();
OrderedTaskPoint *tp;
const Waypoint *wp;
task_manager.set_factory(TaskBehaviour::FACTORY_MIXED);
AbstractTaskFactory &fact = task_manager.get_factory();
task_report(task_manager, "# adding start\n");
wp = waypoints.lookup_id(1);
if (wp) {
tp = fact.createStart(AbstractTaskFactory::START_LINE,*wp);
if (tp->get_oz()->shape == ObservationZonePoint::CYLINDER) {
CylinderZone *cz = (CylinderZone *)tp->get_oz();
cz->setRadius(fixed(5000.0));
tp->update_oz(projection);
}
if (!fact.append(*tp,false)) return false;
delete tp;
} else {
return false;
}
task_manager.setActiveTaskPoint(0);
task_manager.resume();
task_report(task_manager, "# adding intermdiate\n");
wp = waypoints.lookup_id(2);
if (wp) {
tp = fact.createIntermediate(AbstractTaskFactory::AST_CYLINDER,*wp);
if (!fact.append(*tp,false)) return false;
delete tp;
} else {
return false;
}
task_report(task_manager, "# adding intermdiate\n");
wp = waypoints.lookup_id(3);
if (wp) {
tp = fact.createIntermediate(AbstractTaskFactory::AAT_CYLINDER,*wp);
if (tp->get_oz()->shape == ObservationZonePoint::CYLINDER) {
CylinderZone *cz = (CylinderZone *)tp->get_oz();
cz->setRadius(fixed(30000.0));
tp->update_oz(projection);
}
if (!fact.append(*tp,false)) return false;
delete tp;
} else {
return false;
}
task_report(task_manager, "# adding intermediate\n");
wp = waypoints.lookup_id(4);
if (wp) {
tp = fact.createIntermediate(AbstractTaskFactory::AAT_CYLINDER,*wp);
if (!fact.append(*tp,false)) return false;
delete tp;
} else {
return false;
}
task_report(task_manager, "# adding intermediate\n");
wp = waypoints.lookup_id(5);
if (wp) {
tp = fact.createIntermediate(AbstractTaskFactory::AAT_CYLINDER,*wp);
if (tp->get_oz()->shape == ObservationZonePoint::CYLINDER) {
CylinderZone *cz = (CylinderZone *)tp->get_oz();
cz->setRadius(fixed(30000.0));
tp->update_oz(projection);
}
if (!fact.append(*tp,false)) return false;
delete tp;
} else {
return false;
}
task_report(task_manager, "# adding finish\n");
wp = waypoints.lookup_id(1);
if (wp) {
tp = fact.createFinish(AbstractTaskFactory::FINISH_LINE,*wp);
if (!fact.append(*tp,false)) return false;
delete tp;
} else {
return false;
}
task_report(task_manager, "# checking task\n");
if (!fact.validate()) {
return false;
}
if (!task_manager.check_ordered_task()) {
return false;
}
return true;
}