NavigationStackFactory.cpp
Go to the documentation of this file.
1
#include "
NavigationStackFactory.h
"
2
3
#include <
ArmarXCore/core/exceptions/local/ExpressionException.h
>
4
#include <
ArmarXCore/core/logging/Logging.h
>
5
6
#include <
armarx/navigation/core/constants.h
>
7
#include <
armarx/navigation/factories/GlobalPlannerFactory.h
>
8
#include <
armarx/navigation/factories/LocalPlannerFactory.h
>
9
#include <
armarx/navigation/factories/SafetyControllerFactory.h
>
10
#include <
armarx/navigation/factories/TrajectoryControllerFactory.h
>
11
#include <
armarx/navigation/server/NavigationStack.h
>
12
13
14
namespace
armarx::navigation::fac
15
{
16
server::NavigationStack
17
NavigationStackFactory::create
(
const
aron::data::DictPtr
& params,
const
core::Scene
& ctx)
18
{
19
ARMARX_TRACE
;
20
using
aron::data::Dict
;
21
22
const
auto
getElementOrNull = [¶ms](
const
core::StackLayer
& layer) -> Dict::PointerType
23
{
24
ARMARX_TRACE
;
25
const
std::string key =
core::StackLayerNames
.to_name(layer);
26
27
if
(params->hasElement(key))
28
{
29
return
Dict::DynamicCast(params->getElement(key));
30
}
31
32
ARMARX_INFO
<<
"Skipping '"
<< key <<
"'"
;
33
34
return
nullptr
;
35
};
36
37
const
auto
globalPlannerCfg = getElementOrNull(
core::StackLayer::GlobalPlanner
);
38
const
auto
localPlannerCfg = getElementOrNull(
core::StackLayer::LocalPlanner
);
39
const
auto
trajectoryControllerCfg =
40
getElementOrNull(
core::StackLayer::TrajectoryController
);
41
const
auto
safetyControllerCfg = getElementOrNull(
core::StackLayer::SafetyController
);
42
43
return
server::NavigationStack
{
44
.
globalPlanner
=
GlobalPlannerFactory::create
(globalPlannerCfg, ctx),
45
.localPlanner =
LocalPlannerFactory::create
(localPlannerCfg, ctx),
46
.trajectoryControl =
TrajectoryControllerFactory::create
(trajectoryControllerCfg)};
47
// .safetyControl = SafetyControllerFactory::create(safetyControllerCfg, ctx)};
48
}
49
50
server::NavigationStack
51
NavigationStackFactory::create
(
const
aron::data::dto::DictPtr
& params,
const
core::Scene
& ctx)
52
{
53
ARMARX_TRACE
;
54
const
auto
dict =
aron::data::Dict::FromAronDictDTO
(params);
55
ARMARX_CHECK_NOT_NULL
(dict);
56
return
create
(dict, ctx);
57
}
58
59
}
// namespace armarx::navigation::fac
armarx::navigation::fac::NavigationStackFactory::create
static server::NavigationStack create(const aron::data::DictPtr ¶ms, const core::Scene &ctx)
Definition:
NavigationStackFactory.cpp:17
armarx::navigation::core::StackLayer::LocalPlanner
@ LocalPlanner
NavigationStack.h
armarx::navigation::fac::GlobalPlannerFactory::create
static global_planning::GlobalPlannerPtr create(const aron::data::DictPtr ¶ms, const core::Scene &ctx)
Definition:
GlobalPlannerFactory.cpp:17
SafetyControllerFactory.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
armarx::navigation::server::NavigationStack
Definition:
NavigationStack.h:34
LocalPlannerFactory.h
constants.h
armarx::navigation::core::StackLayer::GlobalPlanner
@ GlobalPlanner
NavigationStackFactory.h
armarx::aron::data::Dict::FromAronDictDTO
static PointerType FromAronDictDTO(const data::dto::DictPtr &aron)
Definition:
Dict.cpp:129
ARMARX_TRACE
#define ARMARX_TRACE
Definition:
trace.h:69
armarx::navigation::core::StackLayerNames
const simox::meta::EnumNames< StackLayer > StackLayerNames
Definition:
constants.h:41
armarx::navigation::fac::TrajectoryControllerFactory::create
static traj_ctrl::local::TrajectoryControllerPtr create(const aron::data::DictPtr ¶ms)
Definition:
TrajectoryControllerFactory.cpp:14
armarx::navigation::core::StackLayer::TrajectoryController
@ TrajectoryController
armarx::navigation::core::Scene
Definition:
types.h:71
ExpressionException.h
armarx::aron::data::DictPtr
std::shared_ptr< Dict > DictPtr
Definition:
Dict.h:41
ARMARX_INFO
#define ARMARX_INFO
Definition:
Logging.h:174
armarx::navigation::core::StackLayer
StackLayer
Definition:
constants.h:33
armarx::navigation::fac::LocalPlannerFactory::create
static local_planning::LocalPlannerPtr create(const aron::data::DictPtr ¶ms, const core::Scene &ctx)
Definition:
LocalPlannerFactory.cpp:18
GlobalPlannerFactory.h
armarx::navigation::core::StackLayer::SafetyController
@ SafetyController
Logging.h
armarx::navigation::server::NavigationStack::globalPlanner
global_planning::GlobalPlannerPtr globalPlanner
Definition:
NavigationStack.h:36
TrajectoryControllerFactory.h
armarx::aron::data::Dict
Definition:
Dict.h:44
armarx
navigation
factories
NavigationStackFactory.cpp
Generated on Sat Oct 12 2024 09:14:15 for armarx_documentation by
1.8.17