LocalPlannerFactory.cpp
Go to the documentation of this file.
1
#include "
LocalPlannerFactory.h
"
2
3
#include <
ArmarXCore/core/exceptions/local/ExpressionException.h
>
4
5
#include <
RobotAPI/libraries/aron/core/data/variant/container/Dict.h
>
6
#include <
RobotAPI/libraries/aron/core/data/variant/primitive/String.h
>
7
8
#include <
armarx/navigation/local_planning/core.h
>
9
#include <
armarx/navigation/core/constants.h
>
10
11
#ifdef TIMED_ELASTIC_BANDS_ENABLED
12
#include <
armarx/navigation/local_planning/TimedElasticBands.h
>
13
#endif
14
15
namespace
armarx::navigation::fac
16
{
17
local_planning::LocalPlannerPtr
18
LocalPlannerFactory::create
(
const
aron::data::DictPtr
& params,
const
core::Scene
& ctx)
19
{
20
ARMARX_TRACE
;
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
37
local_planning::LocalPlannerPtr
localPlanner;
38
switch
(algo)
39
{
40
case
local_planning::Algorithms::TimedElasticBands
:
41
#ifdef TIMED_ELASTIC_BANDS_ENABLED
42
localPlanner = std::make_shared<local_planning::TimedElasticBands>(
43
local_planning::TimedElasticBandsParams::FromAron
(algoParams), ctx);
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 ¶ms, 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
armarx
navigation
factories
LocalPlannerFactory.cpp
Generated on Sat Oct 12 2024 09:14:15 for armarx_documentation by
1.8.17