SafetyControllerFactory.cpp
Go to the documentation of this file.
2 
4 
7 
12 
14 {
17  {
18  namespace layer = safe_ctrl;
19 
20  if (not params)
21  {
22  return nullptr;
23  }
24 
25  // algo name
26  const auto algoName = aron::data::String::DynamicCast(params->getElement(core::NAME_KEY));
27  ARMARX_CHECK_NOT_NULL(algoName);
28  const layer::Algorithms algo = layer::AlgorithmNames.from_name(algoName->getValue());
29 
30  // algo params
31  const auto algoParams = aron::data::Dict::DynamicCast(params->getElement(core::PARAMS_KEY));
32  ARMARX_CHECK_NOT_NULL(algoParams);
33 
35  switch (algo)
36  {
38  controller = std::make_shared<safe_ctrl::LaserBasedProximity>(
40  break;
41  }
42 
43  return controller;
44  }
45 } // namespace armarx::navigation::fac
armarx::navigation::core::NAME_KEY
const std::string NAME_KEY
Definition: constants.h:30
armarx::navigation::core::PARAMS_KEY
const std::string PARAMS_KEY
Definition: constants.h:31
SafetyControllerFactory.h
armarx::navigation::fac::SafetyControllerFactory::create
static safe_ctrl::SafetyControllerPtr create(const aron::data::DictPtr &params, const core::Scene &ctx)
Definition: SafetyControllerFactory.cpp:16
core.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
LaserBasedProximity.h
constants.h
Dict.h
armarx::aron::data::detail::SpecializedVariantBase< data::dto::AronString, String >::DynamicCast
static PointerType DynamicCast(const VariantPtr &n)
Definition: SpecializedVariant.h:117
armarx::navigation::global_planning::AlgorithmNames
const simox::meta::EnumNames< Algorithms > AlgorithmNames
Definition: core.h:45
armarx::navigation::safe_ctrl::SafetyControllerPtr
std::shared_ptr< SafetyController > SafetyControllerPtr
Definition: fwd.h:50
controller
Definition: AddOperation.h:39
armarx::navigation::core::Scene
Definition: types.h:71
ExpressionException.h
armarx::aron::data::DictPtr
std::shared_ptr< Dict > DictPtr
Definition: Dict.h:41
armarx::navigation::safe_ctrl::LaserBasedProximityParams::FromAron
static LaserBasedProximityParams FromAron(const aron::data::DictPtr &dict)
Definition: LaserBasedProximity.cpp:21
armarx::navigation::safe_ctrl::Algorithms::LaserBasedProximity
@ LaserBasedProximity
armarx::navigation::global_planning::Algorithms
Algorithms
Definition: core.h:38
String.h
SafetyController.h