LocalPlannerFactory.cpp
Go to the documentation of this file.
1 #include "LocalPlannerFactory.h"
2 
4 
7 
10 
11 #ifdef TIMED_ELASTIC_BANDS_ENABLED
13 #endif
14 
16 {
19  {
21  namespace layer = local_planning;
22 
23  if (not params)
24  {
25  return nullptr;
26  }
27 
28  // algo name
29  const auto algoName = aron::data::String::DynamicCast(params->getElement(core::NAME_KEY));
30  ARMARX_CHECK_NOT_NULL(algoName);
31  const layer::Algorithms algo = layer::AlgorithmNames.from_name(algoName->getValue());
32 
33  // algo params
34  const auto algoParams = aron::data::Dict::DynamicCast(params->getElement(core::PARAMS_KEY));
35  ARMARX_CHECK_NOT_NULL(algoParams);
36 
38  switch (algo)
39  {
41  #ifdef TIMED_ELASTIC_BANDS_ENABLED
42  localPlanner = std::make_shared<local_planning::TimedElasticBands>(
44  #endif
45 
46  break;
47  }
48 
49  return localPlanner;
50  }
51 } // namespace armarx::navigation::fac
TimedElasticBands.h
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
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::local_planning::TimedElasticBandsParams::FromAron
static TimedElasticBandsParams FromAron(const aron::data::DictPtr &dict)
Definition: TimedElasticBandsParams.cpp:20
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:117
armarx::navigation::global_planning::AlgorithmNames
const simox::meta::EnumNames< Algorithms > AlgorithmNames
Definition: core.h:45
ARMARX_TRACE
#define ARMARX_TRACE
Definition: trace.h:69
core.h
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::fac::LocalPlannerFactory::create
static local_planning::LocalPlannerPtr create(const aron::data::DictPtr &params, const core::Scene &ctx)
Definition: LocalPlannerFactory.cpp:18
armarx::navigation::global_planning::Algorithms
Algorithms
Definition: core.h:38
armarx::navigation::local_planning::Algorithms::TimedElasticBands
@ TimedElasticBands
String.h