NavigationStackFactory.cpp
Go to the documentation of this file.
2 
5 
12 
13 
15 {
16  server::NavigationStack
18  {
20  using aron::data::Dict;
21 
22  const auto getElementOrNull = [&params](const core::StackLayer& layer) -> Dict::PointerType
23  {
25  const std::string key = core::StackLayerNames.to_name(layer);
26 
27  if (params->hasElement(key))
28  {
29  return Dict::DynamicCast(params->getElement(key));
30  }
31 
32  ARMARX_INFO << "Skipping '" << key << "'";
33 
34  return nullptr;
35  };
36 
37  const auto globalPlannerCfg = getElementOrNull(core::StackLayer::GlobalPlanner);
38  const auto localPlannerCfg = getElementOrNull(core::StackLayer::LocalPlanner);
39  const auto trajectoryControllerCfg =
41  const auto safetyControllerCfg = getElementOrNull(core::StackLayer::SafetyController);
42 
44  .globalPlanner = GlobalPlannerFactory::create(globalPlannerCfg, ctx),
45  .localPlanner = LocalPlannerFactory::create(localPlannerCfg, ctx),
46  .trajectoryControl = TrajectoryControllerFactory::create(trajectoryControllerCfg)};
47  // .safetyControl = SafetyControllerFactory::create(safetyControllerCfg, ctx)};
48  }
49 
52  {
54  const auto dict = aron::data::Dict::FromAronDictDTO(params);
56  return create(dict, ctx);
57  }
58 
59 } // namespace armarx::navigation::fac
armarx::navigation::fac::NavigationStackFactory::create
static server::NavigationStack create(const aron::data::DictPtr &params, const core::Scene &ctx)
Definition: NavigationStackFactory.cpp:17
armarx::navigation::core::StackLayer::LocalPlanner
@ LocalPlanner
NavigationStack.h
armarx::navigation::fac::GlobalPlannerFactory::create
static global_planning::GlobalPlannerPtr create(const aron::data::DictPtr &params, const core::Scene &ctx)
Definition: GlobalPlannerFactory.cpp:17
SafetyControllerFactory.h
ARMARX_CHECK_NOT_NULL
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
Definition: ExpressionException.h:206
armarx::navigation::fac
This file is part of ArmarX.
Definition: GlobalPlannerFactory.cpp:14
armarx::navigation::server::NavigationStack
Definition: NavigationStack.h:34
LocalPlannerFactory.h
constants.h
armarx::navigation::core::StackLayer::GlobalPlanner
@ GlobalPlanner
NavigationStackFactory.h
armarx::aron::data::Dict::FromAronDictDTO
static PointerType FromAronDictDTO(const data::dto::DictPtr &aron)
Definition: Dict.cpp:129
ARMARX_TRACE
#define ARMARX_TRACE
Definition: trace.h:69
armarx::navigation::core::StackLayerNames
const simox::meta::EnumNames< StackLayer > StackLayerNames
Definition: constants.h:41
armarx::navigation::fac::TrajectoryControllerFactory::create
static traj_ctrl::local::TrajectoryControllerPtr create(const aron::data::DictPtr &params)
Definition: TrajectoryControllerFactory.cpp:14
armarx::navigation::core::StackLayer::TrajectoryController
@ TrajectoryController
armarx::navigation::core::Scene
Definition: types.h:71
ExpressionException.h
armarx::aron::data::DictPtr
std::shared_ptr< Dict > DictPtr
Definition: Dict.h:41
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
armarx::navigation::core::StackLayer
StackLayer
Definition: constants.h:33
armarx::navigation::fac::LocalPlannerFactory::create
static local_planning::LocalPlannerPtr create(const aron::data::DictPtr &params, const core::Scene &ctx)
Definition: LocalPlannerFactory.cpp:18
GlobalPlannerFactory.h
armarx::navigation::core::StackLayer::SafetyController
@ SafetyController
Logging.h
armarx::navigation::server::NavigationStack::globalPlanner
global_planning::GlobalPlannerPtr globalPlanner
Definition: NavigationStack.h:36
TrajectoryControllerFactory.h
armarx::aron::data::Dict
Definition: Dict.h:44