LocalPlannerFactory.cpp
Go to the documentation of this file.
2
5
8
13
14#ifdef TIMED_ELASTIC_BANDS_ENABLED
16#endif
17
19{
22 const aron::data::DictPtr& params,
23 const core::Scene& ctx)
24 {
26 namespace layer = local_planning;
27
28 if (not params)
29 {
30 return nullptr;
31 }
32
33 // algo name
34 const auto algoName = aron::data::String::DynamicCast(params->getElement(core::NAME_KEY));
35 ARMARX_CHECK_NOT_NULL(algoName);
36 const layer::Algorithms algo = layer::AlgorithmNames.from_name(algoName->getValue());
37
38 // algo params
39 const auto algoParams = aron::data::Dict::DynamicCast(params->getElement(core::PARAMS_KEY));
40 ARMARX_CHECK_NOT_NULL(algoParams);
41
43 switch (algo)
44 {
46#ifdef TIMED_ELASTIC_BANDS_ENABLED
47 localPlanner = std::make_shared<local_planning::TimedElasticBands>(
49 generalConfig,
50 ctx);
51#endif
52
53 break;
54 }
55
56 return localPlanner;
57 }
58} // namespace armarx::navigation::fac
static local_planning::LocalPlannerPtr create(const core::GeneralConfig &generalConfig, const aron::data::DictPtr &params, const core::Scene &ctx)
#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...
std::shared_ptr< Dict > DictPtr
Definition Dict.h:42
const std::string PARAMS_KEY
Definition constants.h:34
const std::string NAME_KEY
Definition constants.h:33
This file is part of ArmarX.
This file is part of ArmarX.
Definition fwd.h:36
std::shared_ptr< LocalPlanner > LocalPlannerPtr
Definition fwd.h:38
static TimedElasticBandsParams FromAron(const aron::data::DictPtr &dict)
#define ARMARX_TRACE
Definition trace.h:77