TrajectoryControllerFactory.cpp
Go to the documentation of this file.
2 
4 
6 
10 
12 {
15  {
16  namespace layer = traj_ctrl::local;
17 
18  if (not params)
19  {
20  return nullptr;
21  }
22 
23  // algo name
24  const auto algoName = aron::data::String::DynamicCast(params->getElement(core::NAME_KEY));
25  ARMARX_CHECK_NOT_NULL(algoName);
26  const layer::Algorithms algo = layer::AlgorithmNames.from_name(algoName->getValue());
27 
28  // algo params
29  const auto algoParams = aron::data::Dict::DynamicCast(params->getElement(core::PARAMS_KEY));
30  ARMARX_CHECK_NOT_NULL(algoParams);
31 
33  switch (algo)
34  {
36  controller = std::make_shared<traj_ctrl::local::TrajectoryFollowingController>(
38  break;
39  }
40 
41  return controller;
42  }
43 } // namespace armarx::navigation::fac
armarx::navigation::core::NAME_KEY
const std::string NAME_KEY
Definition: constants.h:30
TrajectoryController.h
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::traj_ctrl::local::TrajectoryFollowingControllerParams::FromAron
static TrajectoryFollowingControllerParams FromAron(const aron::data::DictPtr &dict)
Definition: TrajectoryFollowingController.cpp:49
constants.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
controller
Definition: AddOperation.h:39
TrajectoryFollowingController.h
armarx::navigation::fac::TrajectoryControllerFactory::create
static traj_ctrl::local::TrajectoryControllerPtr create(const aron::data::DictPtr &params)
Definition: TrajectoryControllerFactory.cpp:14
ExpressionException.h
armarx::aron::data::DictPtr
std::shared_ptr< Dict > DictPtr
Definition: Dict.h:41
armarx::navigation::traj_ctrl::local::TrajectoryControllerPtr
std::shared_ptr< TrajectoryController > TrajectoryControllerPtr
Definition: TrajectoryController.h:71
armarx::navigation::global_planning::Algorithms
Algorithms
Definition: core.h:38
TrajectoryControllerFactory.h
armarx::navigation::traj_ctrl::local::Algorithms::TrajectoryFollowingController
@ TrajectoryFollowingController
String.h