LocalPlannerFactory.cpp
Go to the documentation of this file.
1 #include "LocalPlannerFactory.h"
2 
5 
8 
13 
14 #ifdef TIMED_ELASTIC_BANDS_ENABLED
16 #endif
17 
19 {
22  {
24  namespace layer = local_planning;
25 
26  if (not params)
27  {
28  return nullptr;
29  }
30 
31  // algo name
32  const auto algoName = aron::data::String::DynamicCast(params->getElement(core::NAME_KEY));
33  ARMARX_CHECK_NOT_NULL(algoName);
34  const layer::Algorithms algo = layer::AlgorithmNames.from_name(algoName->getValue());
35 
36  // algo params
37  const auto algoParams = aron::data::Dict::DynamicCast(params->getElement(core::PARAMS_KEY));
38  ARMARX_CHECK_NOT_NULL(algoParams);
39 
41  switch (algo)
42  {
44 #ifdef TIMED_ELASTIC_BANDS_ENABLED
45  localPlanner = std::make_shared<local_planning::TimedElasticBands>(
47 #endif
48 
49  break;
50  }
51 
52  return localPlanner;
53  }
54 } // namespace armarx::navigation::fac
TimedElasticBands.h
fwd.h
armarx::navigation::core::NAME_KEY
const std::string NAME_KEY
Definition: constants.h:33
armarx::navigation::core::PARAMS_KEY
const std::string PARAMS_KEY
Definition: constants.h:34
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:19
trace.h
armarx::navigation::local_planning::TimedElasticBandsParams::FromAron
static TimedElasticBandsParams FromAron(const aron::data::DictPtr &dict)
Definition: TimedElasticBandsParams.cpp:26
LocalPlannerFactory.h
constants.h
armarx::navigation::local_planning::LocalPlannerPtr
std::shared_ptr< LocalPlanner > LocalPlannerPtr
Definition: fwd.h:38
Dict.h
armarx::aron::data::detail::SpecializedVariantBase< data::dto::AronString, String >::DynamicCast
static PointerType DynamicCast(const VariantPtr &n)
Definition: SpecializedVariant.h:116
armarx::navigation::global_planning::AlgorithmNames
const simox::meta::EnumNames< Algorithms > AlgorithmNames
Definition: core.h:45
ARMARX_TRACE
#define ARMARX_TRACE
Definition: trace.h:77
core.h
armarx::navigation::core::Scene
Definition: types.h:60
ExpressionException.h
armarx::aron::data::DictPtr
std::shared_ptr< Dict > DictPtr
Definition: Dict.h:41
fwd.h
armarx::navigation::fac::LocalPlannerFactory::create
static local_planning::LocalPlannerPtr create(const aron::data::DictPtr &params, const core::Scene &ctx)
Definition: LocalPlannerFactory.cpp:21
armarx::navigation::global_planning::Algorithms
Algorithms
Definition: core.h:38
armarx::navigation::local_planning::Algorithms::TimedElasticBands
@ TimedElasticBands
String.h