NavigationStackConfig.cpp
Go to the documentation of this file.
2 
3 #include <memory>
4 
7 
8 #include <RobotAPI/interface/aron/Aron.h>
12 
15 
16 
18 {
21  {
23  return element;
24  }
25 
28  {
30  << "The NavigationStackConfig is not valid as some elements are not set!";
31  return dict.toAronDictDTO();
32  }
33 
34  bool
36  {
37  // TODO what about general config?
38 
40  {
41  ARMARX_WARNING << "Global planner not set!";
42  return false;
43  }
44 
45  if (not dict.hasElement(
47  {
48  ARMARX_WARNING << "Trajectory controller not set!";
49  return false;
50  }
51 
52  return true;
53  }
54 
57  {
58  // TODO
59  return *this;
60  }
61 
64  {
66  element->setElementCopy(core::NAME_KEY,
67  std::make_shared<aron::data::String>(
68  global_planning::AlgorithmNames.to_name(params.algorithm())));
69  element->setElementCopy(core::PARAMS_KEY, params.toAron());
70 
72 
73  return *this;
74  }
75 
78  {
80  element->setElementCopy(core::NAME_KEY,
81  std::make_shared<aron::data::String>(
82  local_planning::AlgorithmNames.to_name(params.algorithm())));
83  element->setElementCopy(core::PARAMS_KEY, params.toAron());
84 
86 
87  return *this;
88  }
89 
92  {
94  element->setElementCopy(core::NAME_KEY,
95  std::make_shared<aron::data::String>(
96  traj_ctrl::local::AlgorithmNames.to_name(params.algorithm())));
97  element->setElementCopy(core::PARAMS_KEY, params.toAron());
98 
100  element);
101 
102  return *this;
103  }
104 
107  {
109  element->setElementCopy(core::NAME_KEY,
110  std::make_shared<aron::data::String>(
111  safe_ctrl::AlgorithmNames.to_name(params.algorithm())));
112  element->setElementCopy(core::PARAMS_KEY, params.toAron());
113 
115 
116  return *this;
117  }
118 } // namespace armarx::navigation::client
armarx::navigation::traj_ctrl::local::AlgorithmNames
const simox::meta::EnumNames< Algorithms > AlgorithmNames
Definition: core.h:34
armarx::navigation::core::StackLayer::LocalPlanner
@ LocalPlanner
armarx::navigation::safe_ctrl::SafetyControllerParams::algorithm
virtual Algorithms algorithm() const =0
armarx::navigation::global_planning::GlobalPlannerParams::toAron
virtual aron::data::DictPtr toAron() const =0
armarx::navigation::client::NavigationStackConfig::toAron
aron::data::dto::DictPtr toAron() const
Definition: NavigationStackConfig.cpp:27
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::navigation::global_planning::GlobalPlannerParams
Parameters for GlobalPlanner.
Definition: GlobalPlanner.h:48
armarx::navigation::local_planning::LocalPlannerParams::toAron
virtual aron::data::DictPtr toAron() const =0
armarx::navigation::client
This file is part of ArmarX.
Definition: ComponentPlugin.cpp:20
armarx::navigation::local_planning::LocalPlannerParams::algorithm
virtual Algorithms algorithm() const =0
armarx::navigation::client::NavigationStackConfig
Definition: NavigationStackConfig.h:55
constants.h
armarx::navigation::client::NavigationStackConfig::globalPlanner
NavigationStackConfig & globalPlanner(const global_planning::GlobalPlannerParams &params)
Definition: NavigationStackConfig.cpp:63
armarx::navigation::traj_ctrl::local::TrajectoryControllerParams
Definition: TrajectoryController.h:48
armarx::navigation::core::StackLayer::GlobalPlanner
@ GlobalPlanner
Dict.h
armarx::navigation::traj_ctrl::local::TrajectoryControllerParams::algorithm
virtual Algorithms algorithm() const =0
ARMARX_CHECK
#define ARMARX_CHECK(expression)
Shortcut for ARMARX_CHECK_EXPRESSION.
Definition: ExpressionException.h:82
armarx::navigation::global_planning::AlgorithmNames
const simox::meta::EnumNames< Algorithms > AlgorithmNames
Definition: core.h:45
armarx::navigation::global_planning::GlobalPlannerParams::algorithm
virtual Algorithms algorithm() const =0
armarx::navigation::client::NavigationStackConfig::isValid
bool isValid() const
checks if at least global planner and trajectory controller are set
Definition: NavigationStackConfig.cpp:35
NavigationStackConfig.h
armarx::navigation::core::StackLayerNames
const simox::meta::EnumNames< StackLayer > StackLayerNames
Definition: constants.h:41
armarx::navigation::local_planning::LocalPlannerParams
Definition: LocalPlanner.h:45
armarx::navigation::local_planning::AlgorithmNames
const simox::meta::EnumNames< Algorithms > AlgorithmNames
Definition: core.h:35
armarx::aron::data::Dict::hasElement
bool hasElement(const std::string &) const
Definition: Dict.cpp:227
armarx::navigation::core::StackLayer::TrajectoryController
@ TrajectoryController
armarx::navigation::safe_ctrl::SafetyControllerParams
Definition: SafetyController.h:44
ExpressionException.h
armarx::aron::data::DictPtr
std::shared_ptr< Dict > DictPtr
Definition: Dict.h:41
armarx::navigation::safe_ctrl::SafetyControllerParams::toAron
virtual aron::data::DictPtr toAron() const =0
armarx::navigation::safe_ctrl::AlgorithmNames
const simox::meta::EnumNames< Algorithms > AlgorithmNames
Definition: core.h:35
armarx::navigation::client::NavigationStackConfig::safetyController
NavigationStackConfig & safetyController(const safe_ctrl::SafetyControllerParams &params)
Definition: NavigationStackConfig.cpp:106
armarx::navigation::core::StackLayer::SafetyController
@ SafetyController
armarx::aron::data::Dict::setElementCopy
void setElementCopy(const std::string &, const VariantPtr &=nullptr)
Definition: Dict.cpp:282
Logging.h
armarx::navigation::client::GeneralConfig::toAron
virtual aron::data::DictPtr toAron() const
Definition: NavigationStackConfig.cpp:20
ARMARX_WARNING
#define ARMARX_WARNING
Definition: Logging.h:186
armarx::navigation::client::NavigationStackConfig::localPlanner
NavigationStackConfig & localPlanner(const local_planning::LocalPlannerParams &params)
Definition: NavigationStackConfig.cpp:77
armarx::navigation::client::GeneralConfig
Definition: NavigationStackConfig.h:42
String.h
types.h
armarx::navigation::traj_ctrl::local::TrajectoryControllerParams::toAron
virtual aron::data::DictPtr toAron() const =0
Factory.h
armarx::aron::data::Dict
Definition: Dict.h:44
armarx::navigation::client::NavigationStackConfig::trajectoryController
NavigationStackConfig & trajectoryController(const traj_ctrl::local::TrajectoryControllerParams &params)
Definition: NavigationStackConfig.cpp:91
armarx::aron::data::Dict::toAronDictDTO
data::dto::DictPtr toAronDictDTO() const
Definition: Dict.cpp:145
armarx::navigation::client::NavigationStackConfig::general
NavigationStackConfig & general(const GeneralConfig &cfg)
Definition: NavigationStackConfig.cpp:56