NavigationStackConfig.cpp
Go to the documentation of this file.
2
3#include <memory>
4
7
8#include <RobotAPI/interface/aron/Aron.h>
11
21
23{
24
27 {
29 << "The NavigationStackConfig is not valid as some elements are not set!";
30 return dict.toAronDictDTO();
31 }
32
33 bool
35 {
36 if (not dict.hasElement(core::StackLayerNames.to_name(core::StackLayer::GeneralConfig)))
37 {
38 ARMARX_WARNING << "General params not set!";
39 return false;
40 }
41
42 if (not dict.hasElement(core::StackLayerNames.to_name(core::StackLayer::GlobalPlanner)))
43 {
44 ARMARX_WARNING << "Global planner not set!";
45 return false;
46 }
47
48 if (dict.hasElement(core::StackLayerNames.to_name(core::StackLayer::LocalPlanner)) and
50 {
51 ARMARX_WARNING << "Safety guard is not supported for local planner!";
52 return false;
53 }
54
55 return true;
56 }
57
60 {
62 element->setElementCopy(core::NAME_KEY,
63 std::make_shared<aron::data::String>("GeneralConfig"));
64 element->setElementCopy(core::PARAMS_KEY, cfg.toAron());
65
66 dict.setElementCopy(core::StackLayerNames.to_name(core::StackLayer::GeneralConfig),
67 element);
68
69 return *this;
70 }
71
74 {
76 element->setElementCopy(core::NAME_KEY,
77 std::make_shared<aron::data::String>(
79 element->setElementCopy(core::PARAMS_KEY, params.toAron());
80
81 dict.setElementCopy(core::StackLayerNames.to_name(core::StackLayer::GlobalPlanner),
82 element);
83
84 return *this;
85 }
86
89 {
91 element->setElementCopy(core::NAME_KEY,
92 std::make_shared<aron::data::String>(
93 local_planning::AlgorithmNames.to_name(params.algorithm())));
94 element->setElementCopy(core::PARAMS_KEY, params.toAron());
95
96 dict.setElementCopy(core::StackLayerNames.to_name(core::StackLayer::LocalPlanner), element);
97
98 return *this;
99 }
100
103 {
105 element->setElementCopy(core::NAME_KEY,
106 std::make_shared<aron::data::String>(
107 safety_guard::AlgorithmNames.to_name(params.algorithm())));
108 element->setElementCopy(core::PARAMS_KEY, params.toAron());
109
110 dict.setElementCopy(core::StackLayerNames.to_name(core::StackLayer::SafetyGuard), element);
111
112 return *this;
113 }
114
117 {
119 element->setElementCopy(core::NAME_KEY,
120 std::make_shared<aron::data::String>("GoalReachedConfig"));
121 element->setElementCopy(core::PARAMS_KEY, cfg.toAron());
122
124 element);
125
126 return *this;
127 }
128} // namespace armarx::navigation::client
NavigationStackConfig & goalReached(const core::GoalReachedConfig &cfg)
NavigationStackConfig & safetyGuard(const safety_guard::SafetyGuardParams &params)
bool isValid() const
checks if at least global planner and trajectory controller are set
NavigationStackConfig & localPlanner(const local_planning::LocalPlannerParams &params)
NavigationStackConfig & globalPlanner(const global_planning::GlobalPlannerParams &params)
NavigationStackConfig & general(const core::GeneralConfig &cfg)
#define ARMARX_CHECK(expression)
Shortcut for ARMARX_CHECK_EXPRESSION.
#define ARMARX_WARNING
The logging level for unexpected behaviour, but not a serious problem.
Definition Logging.h:193
::IceInternal::Handle< Dict > DictPtr
std::shared_ptr< Dict > DictPtr
Definition Dict.h:42
This file is part of ArmarX.
const std::string PARAMS_KEY
Definition constants.h:34
const simox::meta::EnumNames< StackLayer > StackLayerNames
Definition constants.h:46
const std::string NAME_KEY
Definition constants.h:33
const simox::meta::EnumNames< Algorithms > AlgorithmNames
Definition core.h:46
const simox::meta::EnumNames< Algorithms > AlgorithmNames
Definition core.h:35
const simox::meta::EnumNames< Algorithms > AlgorithmNames
Definition core.h:35
virtual aron::data::DictPtr toAron() const =0
virtual aron::data::DictPtr toAron() const =0
virtual aron::data::DictPtr toAron() const =0