From de3404067f1376d1783d8a188ac33e7c0e35988c Mon Sep 17 00:00:00 2001 From: Rainer Kartmann <rainer.kartmann@kit.edu> Date: Tue, 26 Oct 2021 17:51:33 +0200 Subject: [PATCH 1/5] Update ARON ice type name --- source/armarx/navigation/client/ice/NavigatorInterface.ice | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/armarx/navigation/client/ice/NavigatorInterface.ice b/source/armarx/navigation/client/ice/NavigatorInterface.ice index 9b12ab94..ed6a378d 100644 --- a/source/armarx/navigation/client/ice/NavigatorInterface.ice +++ b/source/armarx/navigation/client/ice/NavigatorInterface.ice @@ -62,7 +62,7 @@ module armarx interface NavigatorInterface extends armem::client::MemoryListenerInterface { - void createConfig(aron::data::AronDict config, string callerId); + void createConfig(aron::data::dto::Dict config, string callerId); void moveTo(Eigen::Matrix4fSeq waypoints, string navigationFrame, string callerId); -- GitLab From 13b783fa7fe0f78b8a0c02321c43c64c3ed76c4f Mon Sep 17 00:00:00 2001 From: Rainer Kartmann <rainer.kartmann@kit.edu> Date: Wed, 27 Oct 2021 09:26:10 +0200 Subject: [PATCH 2/5] Update includes and type name of ARON --- .../client/NavigationStackConfig.cpp | 30 +++++++++---------- .../navigation/client/NavigationStackConfig.h | 8 ++--- .../NavigationMemory/NavigationMemory.cpp | 6 ++-- .../components/Navigator/Navigator.cpp | 2 +- .../components/Navigator/Navigator.h | 2 +- source/armarx/navigation/core/Graph.cpp | 3 +- source/armarx/navigation/core/Graph.h | 3 +- .../factories/GlobalPlannerFactory.cpp | 9 +++--- .../factories/GlobalPlannerFactory.h | 5 ++-- .../factories/LocalPlannerFactory.cpp | 9 +++--- .../factories/LocalPlannerFactory.h | 5 ++-- .../factories/NavigationStackFactory.cpp | 12 ++++---- .../factories/NavigationStackFactory.h | 7 ++--- .../factories/SafetyControllerFactory.cpp | 9 +++--- .../factories/SafetyControllerFactory.h | 5 ++-- .../factories/TrajectoryControllerFactory.cpp | 8 ++--- .../factories/TrajectoryControllerFactory.h | 6 ++-- .../navigation/global_planning/AStar.cpp | 8 ++--- .../armarx/navigation/global_planning/AStar.h | 4 +-- .../global_planning/GlobalPlanner.cpp | 2 -- .../global_planning/GlobalPlanner.h | 4 +-- .../global_planning/Point2Point.cpp | 4 +-- .../navigation/global_planning/Point2Point.h | 4 +-- .../navigation/local_planning/LocalPlanner.h | 4 +-- .../local_planning/TimedElasticBands.cpp | 4 +-- .../local_planning/TimedElasticBands.h | 6 ++-- .../memory/client/events/Writer.cpp | 7 ++--- .../memory/client/parameterization/Writer.cpp | 4 +-- .../memory/client/parameterization/Writer.h | 4 +-- .../safety_control/LaserBasedProximity.cpp | 4 +-- .../safety_control/LaserBasedProximity.h | 4 +-- .../safety_control/SafetyController.h | 4 +-- .../MemoryParameterizationService.cpp | 16 +++++----- .../MemoryParameterizationService.h | 6 ++-- .../trajectory_control/TrajectoryController.h | 4 +-- .../TrajectoryFollowingController.cpp | 4 +-- .../TrajectoryFollowingController.h | 4 +-- .../trajectory_control/WaypointController.cpp | 4 +-- .../trajectory_control/WaypointController.h | 4 +-- 39 files changed, 117 insertions(+), 121 deletions(-) diff --git a/source/armarx/navigation/client/NavigationStackConfig.cpp b/source/armarx/navigation/client/NavigationStackConfig.cpp index 90e6247b..85a5a5df 100644 --- a/source/armarx/navigation/client/NavigationStackConfig.cpp +++ b/source/armarx/navigation/client/NavigationStackConfig.cpp @@ -6,9 +6,10 @@ #include <ArmarXCore/core/logging/Logging.h> #include <RobotAPI/interface/aron/Aron.h> -#include <RobotAPI/libraries/aron/core/navigator/data/NavigatorFactory.h> -#include <RobotAPI/libraries/aron/core/navigator/data/container/Dict.h> -#include <RobotAPI/libraries/aron/core/navigator/data/primitive/String.h> +#include <RobotAPI/libraries/aron/core/data/variant/Factory.h> +#include <RobotAPI/libraries/aron/core/data/variant/container/Dict.h> +#include <RobotAPI/libraries/aron/core/data/variant/primitive/String.h> + #include <armarx/navigation/core/constants.h> #include <armarx/navigation/core/types.h> @@ -16,15 +17,14 @@ namespace armarx::navigation::client { - aron::datanavigator::DictNavigatorPtr + aron::data::DictPtr GeneralConfig::toAron() const { - aron::datanavigator::DictNavigatorPtr element(new aron::datanavigator::DictNavigator); + aron::data::DictPtr element(new aron::data::Dict); return element; } - aron::data::AronDictPtr - NavigationStackConfig::toAron() const + aron::data::dto::DictPtr NavigationStackConfig::toAron() const { ARMARX_CHECK(isValid()) << "The NavigationStackConfig is not valid as some elements are not set!"; @@ -62,9 +62,9 @@ namespace armarx::navigation::client NavigationStackConfig& NavigationStackConfig::globalPlanner(const glob_plan::GlobalPlannerParams& params) { - aron::datanavigator::DictNavigatorPtr element(new aron::datanavigator::DictNavigator); + aron::data::DictPtr element(new aron::data::Dict); element->addElement(core::NAME_KEY, - std::make_shared<aron::datanavigator::StringNavigator>( + std::make_shared<aron::data::String>( glob_plan::AlgorithmNames.to_name(params.algorithm()))); element->addElement(core::PARAMS_KEY, params.toAron()); @@ -76,9 +76,9 @@ namespace armarx::navigation::client NavigationStackConfig& NavigationStackConfig::localPlanner(const loc_plan::LocalPlannerParams& params) { - aron::datanavigator::DictNavigatorPtr element(new aron::datanavigator::DictNavigator); + aron::data::DictPtr element(new aron::data::Dict); element->addElement(core::NAME_KEY, - std::make_shared<aron::datanavigator::StringNavigator>( + std::make_shared<aron::data::String>( loc_plan::AlgorithmNames.to_name(params.algorithm()))); element->addElement(core::PARAMS_KEY, params.toAron()); @@ -90,9 +90,9 @@ namespace armarx::navigation::client NavigationStackConfig& NavigationStackConfig::trajectoryController(const traj_ctrl::TrajectoryControllerParams& params) { - aron::datanavigator::DictNavigatorPtr element(new aron::datanavigator::DictNavigator); + aron::data::DictPtr element(new aron::data::Dict); element->addElement(core::NAME_KEY, - std::make_shared<aron::datanavigator::StringNavigator>( + std::make_shared<aron::data::String>( traj_ctrl::AlgorithmNames.to_name(params.algorithm()))); element->addElement(core::PARAMS_KEY, params.toAron()); @@ -105,9 +105,9 @@ namespace armarx::navigation::client NavigationStackConfig& NavigationStackConfig::safetyController(const safe_ctrl::SafetyControllerParams& params) { - aron::datanavigator::DictNavigatorPtr element(new aron::datanavigator::DictNavigator); + aron::data::DictPtr element(new aron::data::Dict); element->addElement(core::NAME_KEY, - std::make_shared<aron::datanavigator::StringNavigator>( + std::make_shared<aron::data::String>( safe_ctrl::AlgorithmNames.to_name(params.algorithm()))); element->addElement(core::PARAMS_KEY, params.toAron()); diff --git a/source/armarx/navigation/client/NavigationStackConfig.h b/source/armarx/navigation/client/NavigationStackConfig.h index fd49c961..c20a36bb 100644 --- a/source/armarx/navigation/client/NavigationStackConfig.h +++ b/source/armarx/navigation/client/NavigationStackConfig.h @@ -25,7 +25,7 @@ #include <memory> #include <RobotAPI/interface/aron/Aron.h> -#include <RobotAPI/libraries/aron/core/navigator/data/container/Dict.h> +#include <RobotAPI/libraries/aron/core/data/variant/container/Dict.h> #include <armarx/navigation/core/types.h> @@ -48,7 +48,7 @@ namespace armarx::navigation::client virtual ~GeneralConfig() = default; - virtual aron::datanavigator::DictNavigatorPtr toAron() const; + virtual aron::data::DictPtr toAron() const; }; class NavigationStackConfig @@ -68,13 +68,13 @@ namespace armarx::navigation::client NavigationStackConfig& safetyController(const safe_ctrl::SafetyControllerParams& params); - aron::data::AronDictPtr toAron() const; + aron::data::dto::DictPtr toAron() const; //! checks if at least global planner and trajectory controller are set bool isValid() const; protected: private: - aron::datanavigator::DictNavigator dict; + aron::data::Dict dict; }; } // namespace armarx::navigation::client diff --git a/source/armarx/navigation/components/NavigationMemory/NavigationMemory.cpp b/source/armarx/navigation/components/NavigationMemory/NavigationMemory.cpp index 24388b80..ab09c3fe 100644 --- a/source/armarx/navigation/components/NavigationMemory/NavigationMemory.cpp +++ b/source/armarx/navigation/components/NavigationMemory/NavigationMemory.cpp @@ -30,7 +30,7 @@ #include <RobotAPI/libraries/armem/client/query.h> #include <RobotAPI/libraries/armem/core/operations.h> -#include <RobotAPI/libraries/armem/server/ltm/disk/operations.h> +#include <RobotAPI/libraries/armem/server/ltm/disk/Memory.h> #include <RobotAPI/libraries/armem/server/wm/memory_definitions.h> #include "Visu.h" @@ -138,7 +138,9 @@ namespace armarx::navigation std::string resolved = ArmarXDataPath::resolvePath(properties.snapshotToLoad); if (auto path = findSnapshotDirectory(resolved, workingMemory().name())) { - armem::wm::Memory memory = armem::server::ltm::disk::load(path.value()); + // armem::wm::Memory memory = armem::server::ltm::disk::load(path.value()); + armem::server::ltm::disk::Memory ltm(path.value()); + armem::wm::Memory memory = ltm.loadAll(); ARMARX_INFO << "Loaded " << armem::print(memory); workingMemory().update(armem::toCommit(memory)); diff --git a/source/armarx/navigation/components/Navigator/Navigator.cpp b/source/armarx/navigation/components/Navigator/Navigator.cpp index a53c8528..74292c5b 100644 --- a/source/armarx/navigation/components/Navigator/Navigator.cpp +++ b/source/armarx/navigation/components/Navigator/Navigator.cpp @@ -227,7 +227,7 @@ namespace armarx::navigation::components } void - components::Navigator::createConfig(const aron::data::AronDictPtr& stackConfig, + components::Navigator::createConfig(const aron::data::dto::DictPtr& stackConfig, const std::string& callerId, const Ice::Current&) { diff --git a/source/armarx/navigation/components/Navigator/Navigator.h b/source/armarx/navigation/components/Navigator/Navigator.h index 9acc01de..e557ffff 100644 --- a/source/armarx/navigation/components/Navigator/Navigator.h +++ b/source/armarx/navigation/components/Navigator/Navigator.h @@ -93,7 +93,7 @@ namespace armarx::navigation::components /// @see armarx::ManagedIceObject::getDefaultName() std::string getDefaultName() const override; - void createConfig(const aron::data::AronDictPtr& stackConfig, + void createConfig(const aron::data::dto::DictPtr& stackConfig, const std::string& callerId, const Ice::Current& c = Ice::emptyCurrent) override; diff --git a/source/armarx/navigation/core/Graph.cpp b/source/armarx/navigation/core/Graph.cpp index cf969e9f..c7cf378a 100644 --- a/source/armarx/navigation/core/Graph.cpp +++ b/source/armarx/navigation/core/Graph.cpp @@ -230,8 +230,7 @@ namespace armarx::navigation void - core::resolveLocation(Graph::Vertex& vertex, - const aron::datanavigator::DictNavigatorPtr& locationData) + core::resolveLocation(Graph::Vertex& vertex, const aron::data::DictPtr& locationData) { navigation::location::arondto::Location dto; dto.fromAron(locationData); diff --git a/source/armarx/navigation/core/Graph.h b/source/armarx/navigation/core/Graph.h index b933c5e9..5b8fb88b 100644 --- a/source/armarx/navigation/core/Graph.h +++ b/source/armarx/navigation/core/Graph.h @@ -114,8 +114,7 @@ namespace armarx::navigation::core // Location resolution - void resolveLocation(Graph::Vertex& vertex, - const aron::datanavigator::DictNavigatorPtr& locationData); + void resolveLocation(Graph::Vertex& vertex, const aron::data::DictPtr& locationData); template <class MemoryContainerT> diff --git a/source/armarx/navigation/factories/GlobalPlannerFactory.cpp b/source/armarx/navigation/factories/GlobalPlannerFactory.cpp index 04e75215..2e9944a1 100644 --- a/source/armarx/navigation/factories/GlobalPlannerFactory.cpp +++ b/source/armarx/navigation/factories/GlobalPlannerFactory.cpp @@ -2,7 +2,8 @@ #include <ArmarXCore/core/exceptions/local/ExpressionException.h> -#include <RobotAPI/libraries/aron/core/navigator/data/primitive/String.h> +#include <RobotAPI/libraries/aron/core/data/variant/container/Dict.h> +#include <RobotAPI/libraries/aron/core/data/variant/primitive/String.h> #include <armarx/navigation/core/constants.h> #include <armarx/navigation/global_planning/AStar.h> @@ -12,7 +13,7 @@ namespace armarx::navigation::fac { glob_plan::GlobalPlannerPtr - GlobalPlannerFactory::create(const aron::datanavigator::DictNavigatorPtr& params, + GlobalPlannerFactory::create(const aron::data::DictPtr& params, const core::Scene& ctx) { namespace layer = glob_plan; @@ -24,13 +25,13 @@ namespace armarx::navigation::fac // algo name const auto algoName = - aron::datanavigator::StringNavigator::DynamicCast(params->getElement(core::NAME_KEY)); + aron::data::String::DynamicCast(params->getElement(core::NAME_KEY)); ARMARX_CHECK_NOT_NULL(algoName); const layer::Algorithms algo = layer::AlgorithmNames.from_name(algoName->getValue()); // algo params const auto algoParams = - aron::datanavigator::DictNavigator::DynamicCast(params->getElement(core::PARAMS_KEY)); + aron::data::Dict::DynamicCast(params->getElement(core::PARAMS_KEY)); ARMARX_CHECK_NOT_NULL(algoParams); glob_plan::GlobalPlannerPtr globalPlanner; diff --git a/source/armarx/navigation/factories/GlobalPlannerFactory.h b/source/armarx/navigation/factories/GlobalPlannerFactory.h index 269d9992..4b366f82 100644 --- a/source/armarx/navigation/factories/GlobalPlannerFactory.h +++ b/source/armarx/navigation/factories/GlobalPlannerFactory.h @@ -22,8 +22,7 @@ #pragma once -// #include <RobotAPI/libraries/aron/core/navigator/data/container/Dict.h> -#include <RobotAPI/libraries/aron/core/navigator/data/NavigatorFwd.h> +#include <RobotAPI/libraries/aron/core/data/variant/forward_declarations.h> #include <armarx/navigation/core/fwd.h> #include <armarx/navigation/factories/fwd.h> @@ -38,7 +37,7 @@ namespace armarx::navigation::fac { public: static glob_plan::GlobalPlannerPtr - create(const aron::datanavigator::DictNavigatorPtr& params, const core::Scene& ctx); + create(const aron::data::DictPtr& params, const core::Scene& ctx); }; } // namespace armarx::navigation::fac diff --git a/source/armarx/navigation/factories/LocalPlannerFactory.cpp b/source/armarx/navigation/factories/LocalPlannerFactory.cpp index 95441621..e386f55d 100644 --- a/source/armarx/navigation/factories/LocalPlannerFactory.cpp +++ b/source/armarx/navigation/factories/LocalPlannerFactory.cpp @@ -2,7 +2,8 @@ #include <ArmarXCore/core/exceptions/local/ExpressionException.h> -#include <RobotAPI/libraries/aron/core/navigator/data/primitive/String.h> +#include <RobotAPI/libraries/aron/core/data/variant/container/Dict.h> +#include <RobotAPI/libraries/aron/core/data/variant/primitive/String.h> #include <armarx/navigation/core/constants.h> #include <armarx/navigation/local_planning/TimedElasticBands.h> @@ -10,7 +11,7 @@ namespace armarx::navigation::fac { loc_plan::LocalPlannerPtr - LocalPlannerFactory::create(const aron::datanavigator::DictNavigatorPtr& params, + LocalPlannerFactory::create(const aron::data::DictPtr& params, const core::Scene& ctx) { namespace layer = loc_plan; @@ -22,13 +23,13 @@ namespace armarx::navigation::fac // algo name const auto algoName = - aron::datanavigator::StringNavigator::DynamicCast(params->getElement(core::NAME_KEY)); + aron::data::String::DynamicCast(params->getElement(core::NAME_KEY)); ARMARX_CHECK_NOT_NULL(algoName); const layer::Algorithms algo = layer::AlgorithmNames.from_name(algoName->getValue()); // algo params const auto algoParams = - aron::datanavigator::DictNavigator::DynamicCast(params->getElement(core::PARAMS_KEY)); + aron::data::Dict::DynamicCast(params->getElement(core::PARAMS_KEY)); ARMARX_CHECK_NOT_NULL(algoParams); loc_plan::LocalPlannerPtr localPlanner; diff --git a/source/armarx/navigation/factories/LocalPlannerFactory.h b/source/armarx/navigation/factories/LocalPlannerFactory.h index 1d3d4b49..4e3b0e09 100644 --- a/source/armarx/navigation/factories/LocalPlannerFactory.h +++ b/source/armarx/navigation/factories/LocalPlannerFactory.h @@ -22,8 +22,7 @@ #pragma once -// #include <RobotAPI/libraries/aron/core/navigator/data/container/Dict.h> -#include <RobotAPI/libraries/aron/core/navigator/data/NavigatorFwd.h> +#include <RobotAPI/libraries/aron/core/data/variant/forward_declarations.h> #include <armarx/navigation/core/fwd.h> #include <armarx/navigation/factories/fwd.h> @@ -38,7 +37,7 @@ namespace armarx::navigation::fac class LocalPlannerFactory { public: - static loc_plan::LocalPlannerPtr create(const aron::datanavigator::DictNavigatorPtr& params, + static loc_plan::LocalPlannerPtr create(const aron::data::DictPtr& params, const core::Scene& ctx); protected: diff --git a/source/armarx/navigation/factories/NavigationStackFactory.cpp b/source/armarx/navigation/factories/NavigationStackFactory.cpp index f394d9db..e6c90a5c 100644 --- a/source/armarx/navigation/factories/NavigationStackFactory.cpp +++ b/source/armarx/navigation/factories/NavigationStackFactory.cpp @@ -14,19 +14,19 @@ namespace armarx::navigation::fac { server::NavigationStack - NavigationStackFactory::create(const aron::datanavigator::DictNavigatorPtr& params, + NavigationStackFactory::create(const aron::data::DictPtr& params, const core::Scene& ctx) { - using aron::datanavigator::DictNavigator; + using aron::data::Dict; const auto getElementOrNull = - [¶ms](const core::StackLayer& layer) -> DictNavigator::PointerType + [¶ms](const core::StackLayer& layer) -> Dict::PointerType { const std::string key = core::StackLayerNames.to_name(layer); if (params->hasElement(key)) { - return DictNavigator::DynamicCast(params->getElement(key)); + return Dict::DynamicCast(params->getElement(key)); } ARMARX_INFO << "Skipping '" << key << "'"; @@ -48,9 +48,9 @@ namespace armarx::navigation::fac } server::NavigationStack - NavigationStackFactory::create(const aron::data::AronDictPtr& params, const core::Scene& ctx) + NavigationStackFactory::create(const aron::data::dto::DictPtr& params, const core::Scene& ctx) { - const auto dict = aron::datanavigator::DictNavigator::FromAronDictPtr(params); + const auto dict = aron::data::Dict::FromAronDictPtr(params); ARMARX_CHECK_NOT_NULL(dict); return create(dict, ctx); } diff --git a/source/armarx/navigation/factories/NavigationStackFactory.h b/source/armarx/navigation/factories/NavigationStackFactory.h index 7e99c67e..f0ee4e19 100644 --- a/source/armarx/navigation/factories/NavigationStackFactory.h +++ b/source/armarx/navigation/factories/NavigationStackFactory.h @@ -24,8 +24,7 @@ #include <armarx/navigation/server/NavigationStack.h> -// #include <RobotAPI/libraries/aron/core/navigator/data/container/Dict.h> -#include <RobotAPI/libraries/aron/core/navigator/data/NavigatorFwd.h> +#include <RobotAPI/libraries/aron/core/data/variant/forward_declarations.h> #include <armarx/navigation/core/fwd.h> @@ -38,10 +37,10 @@ namespace armarx::navigation::fac class NavigationStackFactory { public: - static server::NavigationStack create(const aron::datanavigator::DictNavigatorPtr& params, + static server::NavigationStack create(const aron::data::DictPtr& params, const core::Scene& ctx); - static server::NavigationStack create(const aron::data::AronDictPtr& params, + static server::NavigationStack create(const aron::data::dto::DictPtr& params, const core::Scene& ctx); protected: diff --git a/source/armarx/navigation/factories/SafetyControllerFactory.cpp b/source/armarx/navigation/factories/SafetyControllerFactory.cpp index d49bae34..8dec9fb3 100644 --- a/source/armarx/navigation/factories/SafetyControllerFactory.cpp +++ b/source/armarx/navigation/factories/SafetyControllerFactory.cpp @@ -2,7 +2,8 @@ #include <ArmarXCore/core/exceptions/local/ExpressionException.h> -#include <RobotAPI/libraries/aron/core/navigator/data/primitive/String.h> +#include <RobotAPI/libraries/aron/core/data/variant/container/Dict.h> +#include <RobotAPI/libraries/aron/core/data/variant/primitive/String.h> #include <armarx/navigation/core/constants.h> #include <armarx/navigation/safety_control/LaserBasedProximity.h> @@ -12,7 +13,7 @@ namespace armarx::navigation::fac { safe_ctrl::SafetyControllerPtr - SafetyControllerFactory::create(const aron::datanavigator::DictNavigatorPtr& params, + SafetyControllerFactory::create(const aron::data::DictPtr& params, const core::Scene& ctx) { namespace layer = safe_ctrl; @@ -24,13 +25,13 @@ namespace armarx::navigation::fac // algo name const auto algoName = - aron::datanavigator::StringNavigator::DynamicCast(params->getElement(core::NAME_KEY)); + aron::data::String::DynamicCast(params->getElement(core::NAME_KEY)); ARMARX_CHECK_NOT_NULL(algoName); const layer::Algorithms algo = layer::AlgorithmNames.from_name(algoName->getValue()); // algo params const auto algoParams = - aron::datanavigator::DictNavigator::DynamicCast(params->getElement(core::PARAMS_KEY)); + aron::data::Dict::DynamicCast(params->getElement(core::PARAMS_KEY)); ARMARX_CHECK_NOT_NULL(algoParams); safe_ctrl::SafetyControllerPtr controller; diff --git a/source/armarx/navigation/factories/SafetyControllerFactory.h b/source/armarx/navigation/factories/SafetyControllerFactory.h index a902c8c3..023a7624 100644 --- a/source/armarx/navigation/factories/SafetyControllerFactory.h +++ b/source/armarx/navigation/factories/SafetyControllerFactory.h @@ -22,8 +22,7 @@ #pragma once -// #include <RobotAPI/libraries/aron/core/navigator/data/container/Dict.h> -#include <RobotAPI/libraries/aron/core/navigator/data/NavigatorFwd.h> +#include <RobotAPI/libraries/aron/core/data/variant/forward_declarations.h> #include <armarx/navigation/core/fwd.h> #include <armarx/navigation/factories/fwd.h> @@ -39,7 +38,7 @@ namespace armarx::navigation::fac { public: static safe_ctrl::SafetyControllerPtr - create(const aron::datanavigator::DictNavigatorPtr& params, const core::Scene& ctx); + create(const aron::data::DictPtr& params, const core::Scene& ctx); protected: private: diff --git a/source/armarx/navigation/factories/TrajectoryControllerFactory.cpp b/source/armarx/navigation/factories/TrajectoryControllerFactory.cpp index 68ecdd8a..c30fe546 100644 --- a/source/armarx/navigation/factories/TrajectoryControllerFactory.cpp +++ b/source/armarx/navigation/factories/TrajectoryControllerFactory.cpp @@ -2,7 +2,7 @@ #include <ArmarXCore/core/exceptions/local/ExpressionException.h> -#include <RobotAPI/libraries/aron/core/navigator/data/primitive/String.h> +#include <RobotAPI/libraries/aron/core/data/variant/primitive/String.h> #include <armarx/navigation/core/constants.h> #include <armarx/navigation/trajectory_control/TrajectoryController.h> @@ -12,7 +12,7 @@ namespace armarx::navigation::fac { traj_ctrl::TrajectoryControllerPtr - TrajectoryControllerFactory::create(const aron::datanavigator::DictNavigatorPtr& params, + TrajectoryControllerFactory::create(const aron::data::DictPtr& params, const core::Scene& ctx) { namespace layer = traj_ctrl; @@ -24,13 +24,13 @@ namespace armarx::navigation::fac // algo name const auto algoName = - aron::datanavigator::StringNavigator::DynamicCast(params->getElement(core::NAME_KEY)); + aron::data::String::DynamicCast(params->getElement(core::NAME_KEY)); ARMARX_CHECK_NOT_NULL(algoName); const layer::Algorithms algo = layer::AlgorithmNames.from_name(algoName->getValue()); // algo params const auto algoParams = - aron::datanavigator::DictNavigator::DynamicCast(params->getElement(core::PARAMS_KEY)); + aron::data::Dict::DynamicCast(params->getElement(core::PARAMS_KEY)); ARMARX_CHECK_NOT_NULL(algoParams); traj_ctrl::TrajectoryControllerPtr controller; diff --git a/source/armarx/navigation/factories/TrajectoryControllerFactory.h b/source/armarx/navigation/factories/TrajectoryControllerFactory.h index 88acc3a7..eb603d5f 100644 --- a/source/armarx/navigation/factories/TrajectoryControllerFactory.h +++ b/source/armarx/navigation/factories/TrajectoryControllerFactory.h @@ -22,8 +22,8 @@ #pragma once -// #include <RobotAPI/libraries/aron/core/navigator/data/container/Dict.h> -#include <RobotAPI/libraries/aron/core/navigator/data/NavigatorFwd.h> +// #include <RobotAPI/libraries/aron/core/data/variant/container/Dict.h> +#include <RobotAPI/libraries/aron/core/data/variant/forward_declarations.h> #include <armarx/navigation/core/fwd.h> #include <armarx/navigation/factories/fwd.h> @@ -39,7 +39,7 @@ namespace armarx::navigation::fac { public: static traj_ctrl::TrajectoryControllerPtr - create(const aron::datanavigator::DictNavigatorPtr& params, const core::Scene& ctx); + create(const aron::data::DictPtr& params, const core::Scene& ctx); protected: private: diff --git a/source/armarx/navigation/global_planning/AStar.cpp b/source/armarx/navigation/global_planning/AStar.cpp index 267f0e59..9180d28e 100644 --- a/source/armarx/navigation/global_planning/AStar.cpp +++ b/source/armarx/navigation/global_planning/AStar.cpp @@ -11,8 +11,8 @@ #include <ArmarXCore/core/exceptions/local/ExpressionException.h> #include <ArmarXCore/core/logging/Logging.h> -#include <RobotAPI/libraries/aron/core/navigator/data/container/Dict.h> -#include <RobotAPI/libraries/aron/core/navigator/data/primitive/String.h> +#include <RobotAPI/libraries/aron/core/data/variant/container/Dict.h> +#include <RobotAPI/libraries/aron/core/data/variant/primitive/String.h> #include <armarx/navigation/algorithms/astar/AStarPlanner.h> #include <armarx/navigation/algorithms/smoothing/ChainApproximation.h> @@ -38,7 +38,7 @@ namespace armarx::navigation::glob_plan return Algorithms::AStar; } - aron::datanavigator::DictNavigatorPtr + aron::data::DictPtr AStarParams::toAron() const { arondto::AStarParams dto; @@ -50,7 +50,7 @@ namespace armarx::navigation::glob_plan } AStarParams - AStarParams::FromAron(const aron::datanavigator::DictNavigatorPtr& dict) + AStarParams::FromAron(const aron::data::DictPtr& dict) { ARMARX_CHECK_NOT_NULL(dict); diff --git a/source/armarx/navigation/global_planning/AStar.h b/source/armarx/navigation/global_planning/AStar.h index 7319216f..326284d8 100644 --- a/source/armarx/navigation/global_planning/AStar.h +++ b/source/armarx/navigation/global_planning/AStar.h @@ -38,9 +38,9 @@ namespace armarx::navigation::glob_plan float resampleDistance{500}; Algorithms algorithm() const override; - aron::datanavigator::DictNavigatorPtr toAron() const override; + aron::data::DictPtr toAron() const override; - static AStarParams FromAron(const aron::datanavigator::DictNavigatorPtr& dict); + static AStarParams FromAron(const aron::data::DictPtr& dict); }; /** diff --git a/source/armarx/navigation/global_planning/GlobalPlanner.cpp b/source/armarx/navigation/global_planning/GlobalPlanner.cpp index ea7c6745..92d45898 100644 --- a/source/armarx/navigation/global_planning/GlobalPlanner.cpp +++ b/source/armarx/navigation/global_planning/GlobalPlanner.cpp @@ -1,7 +1,5 @@ #include "GlobalPlanner.h" -#include <RobotAPI/libraries/aron/core/navigator/data/primitive/String.h> - #include <armarx/navigation/core/constants.h> #include <armarx/navigation/core/types.h> diff --git a/source/armarx/navigation/global_planning/GlobalPlanner.h b/source/armarx/navigation/global_planning/GlobalPlanner.h index 4a68a89d..8a703bd3 100644 --- a/source/armarx/navigation/global_planning/GlobalPlanner.h +++ b/source/armarx/navigation/global_planning/GlobalPlanner.h @@ -24,7 +24,7 @@ #include <VirtualRobot/VirtualRobot.h> -#include <RobotAPI/libraries/aron/core/navigator/data/container/Dict.h> +#include <RobotAPI/libraries/aron/core/data/variant/container/Dict.h> #include <armarx/navigation/core/DynamicScene.h> #include <armarx/navigation/core/StaticScene.h> @@ -52,7 +52,7 @@ namespace armarx::navigation::glob_plan virtual ~GlobalPlannerParams() = default; virtual Algorithms algorithm() const = 0; - virtual aron::datanavigator::DictNavigatorPtr toAron() const = 0; + virtual aron::data::DictPtr toAron() const = 0; }; /** diff --git a/source/armarx/navigation/global_planning/Point2Point.cpp b/source/armarx/navigation/global_planning/Point2Point.cpp index 91e86a7c..53a66810 100644 --- a/source/armarx/navigation/global_planning/Point2Point.cpp +++ b/source/armarx/navigation/global_planning/Point2Point.cpp @@ -25,7 +25,7 @@ namespace armarx::navigation::glob_plan return Algorithms::Point2Point; } - aron::datanavigator::DictNavigatorPtr + aron::data::DictPtr Point2PointParams::toAron() const { arondto::Point2PointParams dto; @@ -37,7 +37,7 @@ namespace armarx::navigation::glob_plan } Point2PointParams - Point2PointParams::FromAron(const aron::datanavigator::DictNavigatorPtr& dict) + Point2PointParams::FromAron(const aron::data::DictPtr& dict) { ARMARX_CHECK_NOT_NULL(dict); diff --git a/source/armarx/navigation/global_planning/Point2Point.h b/source/armarx/navigation/global_planning/Point2Point.h index d505d1e9..0477d96f 100644 --- a/source/armarx/navigation/global_planning/Point2Point.h +++ b/source/armarx/navigation/global_planning/Point2Point.h @@ -39,9 +39,9 @@ namespace armarx::navigation::glob_plan float velocity{400}; Algorithms algorithm() const override; - aron::datanavigator::DictNavigatorPtr toAron() const override; + aron::data::DictPtr toAron() const override; - static Point2PointParams FromAron(const aron::datanavigator::DictNavigatorPtr& dict); + static Point2PointParams FromAron(const aron::data::DictPtr& dict); }; /** diff --git a/source/armarx/navigation/local_planning/LocalPlanner.h b/source/armarx/navigation/local_planning/LocalPlanner.h index aed7fb00..5e7d06bf 100644 --- a/source/armarx/navigation/local_planning/LocalPlanner.h +++ b/source/armarx/navigation/local_planning/LocalPlanner.h @@ -26,7 +26,7 @@ #include <VirtualRobot/VirtualRobot.h> -#include <RobotAPI/libraries/aron/core/navigator/data/container/Dict.h> +#include <RobotAPI/libraries/aron/core/data/variant/container/Dict.h> #include "core.h" #include <armarx/navigation/core/DynamicScene.h> @@ -46,7 +46,7 @@ namespace armarx::navigation::loc_plan virtual ~LocalPlannerParams() = default; virtual Algorithms algorithm() const = 0; - virtual aron::datanavigator::DictNavigatorPtr toAron() const = 0; + virtual aron::data::DictPtr toAron() const = 0; }; class LocalPlanner diff --git a/source/armarx/navigation/local_planning/TimedElasticBands.cpp b/source/armarx/navigation/local_planning/TimedElasticBands.cpp index 99142b1e..b069cba6 100644 --- a/source/armarx/navigation/local_planning/TimedElasticBands.cpp +++ b/source/armarx/navigation/local_planning/TimedElasticBands.cpp @@ -14,14 +14,14 @@ namespace armarx::navigation::loc_plan return Algorithms::TimedElasticBands; } - aron::datanavigator::DictNavigatorPtr + aron::data::DictPtr TimedElasticBandsParams::toAron() const { return nullptr; // TODO implement } TimedElasticBandsParams - TimedElasticBandsParams::FromAron(const aron::datanavigator::DictNavigatorPtr& dict) + TimedElasticBandsParams::FromAron(const aron::data::DictPtr& dict) { return TimedElasticBandsParams(); // TODO implement } diff --git a/source/armarx/navigation/local_planning/TimedElasticBands.h b/source/armarx/navigation/local_planning/TimedElasticBands.h index 90034f03..e43747cd 100644 --- a/source/armarx/navigation/local_planning/TimedElasticBands.h +++ b/source/armarx/navigation/local_planning/TimedElasticBands.h @@ -22,7 +22,7 @@ #pragma once -#include <RobotAPI/libraries/aron/core/navigator/data/container/Dict.h> +#include <RobotAPI/libraries/aron/core/data/variant/container/Dict.h> #include <armarx/navigation/local_planning/LocalPlanner.h> #include <armarx/navigation/local_planning/core.h> @@ -35,8 +35,8 @@ namespace armarx::navigation::loc_plan bool includeStartPose{false}; Algorithms algorithm() const override; - aron::datanavigator::DictNavigatorPtr toAron() const override; - static TimedElasticBandsParams FromAron(const aron::datanavigator::DictNavigatorPtr& dict); + aron::data::DictPtr toAron() const override; + static TimedElasticBandsParams FromAron(const aron::data::DictPtr& dict); }; class TimedElasticBands : virtual public LocalPlanner diff --git a/source/armarx/navigation/memory/client/events/Writer.cpp b/source/armarx/navigation/memory/client/events/Writer.cpp index 08508055..1858dd5d 100644 --- a/source/armarx/navigation/memory/client/events/Writer.cpp +++ b/source/armarx/navigation/memory/client/events/Writer.cpp @@ -3,7 +3,7 @@ #include <type_traits> #include <RobotAPI/libraries/aron/common/aron_conversions/core.h> -#include <RobotAPI/libraries/aron/core/navigator/data/primitive/String.h> +#include <RobotAPI/libraries/aron/core/data/variant/primitive/String.h> #include <armarx/navigation/core/aron/Events.aron.generated.h> #include <armarx/navigation/core/aron_conversions.h> @@ -114,9 +114,8 @@ namespace armarx::navigation::mem::client::events // FIXME auto dto = core::toAron(event); - aron::datanavigator::DictNavigatorPtr element(new aron::datanavigator::DictNavigator); - element->addElement("event", - std::make_shared<aron::datanavigator::StringNavigator>(eventName)); + aron::data::DictPtr element(new aron::data::Dict); + element->addElement("event", std::make_shared<aron::data::String>(eventName)); // FIXME element->addElement("data", dto.toAron()); update.instancesData = {element}; diff --git a/source/armarx/navigation/memory/client/parameterization/Writer.cpp b/source/armarx/navigation/memory/client/parameterization/Writer.cpp index 64fff864..d40f300f 100644 --- a/source/armarx/navigation/memory/client/parameterization/Writer.cpp +++ b/source/armarx/navigation/memory/client/parameterization/Writer.cpp @@ -1,6 +1,6 @@ #include "Writer.h" -#include <RobotAPI/libraries/aron/core/navigator/data/AllNavigators.h> +#include <RobotAPI/libraries/aron/core/data/variant/All.h> #include <armarx/navigation/core/constants.h> @@ -9,7 +9,7 @@ namespace armarx::navigation::mem::client::param { bool Writer::store( - const std::unordered_map<core::StackLayer, aron::datanavigator::DictNavigatorPtr>& stack, + const std::unordered_map<core::StackLayer, aron::data::DictPtr>& stack, const std::string& clientID, const core::TimestampUs& timestamp) { diff --git a/source/armarx/navigation/memory/client/parameterization/Writer.h b/source/armarx/navigation/memory/client/parameterization/Writer.h index aac8fea7..d48c3e80 100644 --- a/source/armarx/navigation/memory/client/parameterization/Writer.h +++ b/source/armarx/navigation/memory/client/parameterization/Writer.h @@ -22,7 +22,7 @@ #pragma once #include <RobotAPI/libraries/armem/client/util/SimpleWriterBase.h> -#include <RobotAPI/libraries/aron/core/navigator/data/forward_declarations.h> +#include <RobotAPI/libraries/aron/core/data/variant/forward_declarations.h> #include <armarx/navigation/core/constants.h> #include <armarx/navigation/core/types.h> @@ -37,7 +37,7 @@ namespace armarx::navigation::mem::client::param bool store(const std::unordered_map<core::StackLayer, - aron::datanavigator::DictNavigatorPtr>& stack, + aron::data::DictPtr>& stack, const std::string& clientID, const core::TimestampUs& timestamp); diff --git a/source/armarx/navigation/safety_control/LaserBasedProximity.cpp b/source/armarx/navigation/safety_control/LaserBasedProximity.cpp index f7e77048..83200767 100644 --- a/source/armarx/navigation/safety_control/LaserBasedProximity.cpp +++ b/source/armarx/navigation/safety_control/LaserBasedProximity.cpp @@ -11,14 +11,14 @@ namespace armarx::navigation::safe_ctrl return Algorithms::LaserBasedProximity; } - aron::datanavigator::DictNavigatorPtr + aron::data::DictPtr LaserBasedProximityParams::toAron() const { return nullptr; // TODO implement } LaserBasedProximityParams - LaserBasedProximityParams::FromAron(const aron::datanavigator::DictNavigatorPtr& dict) + LaserBasedProximityParams::FromAron(const aron::data::DictPtr& dict) { return LaserBasedProximityParams(); // TODO implement } diff --git a/source/armarx/navigation/safety_control/LaserBasedProximity.h b/source/armarx/navigation/safety_control/LaserBasedProximity.h index a63de66c..94108ade 100644 --- a/source/armarx/navigation/safety_control/LaserBasedProximity.h +++ b/source/armarx/navigation/safety_control/LaserBasedProximity.h @@ -32,9 +32,9 @@ namespace armarx::navigation::safe_ctrl bool includeStartPose{false}; Algorithms algorithm() const override; - aron::datanavigator::DictNavigatorPtr toAron() const override; + aron::data::DictPtr toAron() const override; static LaserBasedProximityParams - FromAron(const aron::datanavigator::DictNavigatorPtr& dict); + FromAron(const aron::data::DictPtr& dict); }; class LaserBasedProximity : virtual public SafetyController diff --git a/source/armarx/navigation/safety_control/SafetyController.h b/source/armarx/navigation/safety_control/SafetyController.h index 8a5a3c66..ccba53cb 100644 --- a/source/armarx/navigation/safety_control/SafetyController.h +++ b/source/armarx/navigation/safety_control/SafetyController.h @@ -26,7 +26,7 @@ #include <VirtualRobot/VirtualRobot.h> -#include <RobotAPI/libraries/aron/core/navigator/data/container/Dict.h> +#include <RobotAPI/libraries/aron/core/data/variant/container/Dict.h> #include "core.h" #include <armarx/navigation/core/DynamicScene.h> @@ -46,7 +46,7 @@ namespace armarx::navigation::safe_ctrl virtual ~SafetyControllerParams() = default; virtual Algorithms algorithm() const = 0; - virtual aron::datanavigator::DictNavigatorPtr toAron() const = 0; + virtual aron::data::DictPtr toAron() const = 0; }; class SafetyController diff --git a/source/armarx/navigation/server/parameterization/MemoryParameterizationService.cpp b/source/armarx/navigation/server/parameterization/MemoryParameterizationService.cpp index b0ea4091..94bbd51b 100644 --- a/source/armarx/navigation/server/parameterization/MemoryParameterizationService.cpp +++ b/source/armarx/navigation/server/parameterization/MemoryParameterizationService.cpp @@ -4,29 +4,29 @@ #include <ArmarXCore/core/exceptions/local/ExpressionException.h> -#include <RobotAPI/libraries/aron/core/navigator/data/container/Dict.h> +#include <RobotAPI/libraries/aron/core/data/variant/container/Dict.h> #include <armarx/navigation/core/constants.h> namespace armarx::navigation::server { bool - MemoryParameterizationService::store(const aron::datanavigator::DictNavigatorPtr& params, + MemoryParameterizationService::store(const aron::data::DictPtr& params, const std::string& clientId, const core::TimestampUs& timestamp) { ARMARX_CHECK_NOT_NULL(writer); - using aron::datanavigator::DictNavigator; + using aron::data::Dict; const auto getElementOrNull = - [¶ms](const core::StackLayer& layer) -> DictNavigator::PointerType + [¶ms](const core::StackLayer& layer) -> Dict::PointerType { const std::string key = core::StackLayerNames.to_name(layer); if (params->hasElement(key)) { - return DictNavigator::DynamicCast(params->getElement(key)); + return Dict::DynamicCast(params->getElement(key)); } ARMARX_INFO << "Skipping '" << key << "'"; @@ -35,7 +35,7 @@ namespace armarx::navigation::server }; // convert to more structured representation - std::unordered_map<core::StackLayer, DictNavigator::PointerType> cfgs; + std::unordered_map<core::StackLayer, Dict::PointerType> cfgs; if (const auto globalPlannerCfg = getElementOrNull(core::StackLayer::GlobalPlanner)) { @@ -62,11 +62,11 @@ namespace armarx::navigation::server } bool - MemoryParameterizationService::store(const aron::data::AronDictPtr& params, + MemoryParameterizationService::store(const aron::data::dto::DictPtr& params, const std::string& clientId, const core::TimestampUs& timestamp) { - const auto dict = aron::datanavigator::DictNavigator::FromAronDictPtr(params); + const auto dict = aron::data::Dict::FromAronDictPtr(params); return store(dict, clientId, timestamp); } diff --git a/source/armarx/navigation/server/parameterization/MemoryParameterizationService.h b/source/armarx/navigation/server/parameterization/MemoryParameterizationService.h index 671224b4..478b456a 100644 --- a/source/armarx/navigation/server/parameterization/MemoryParameterizationService.h +++ b/source/armarx/navigation/server/parameterization/MemoryParameterizationService.h @@ -22,7 +22,7 @@ #pragma once #include <RobotAPI/libraries/armem/core/Time.h> -#include <RobotAPI/libraries/aron/core/navigator/data/container/Dict.h> +#include <RobotAPI/libraries/aron/core/data/variant/container/Dict.h> #include <armarx/navigation/core/types.h> #include <armarx/navigation/memory/client/parameterization/Reader.h> @@ -39,11 +39,11 @@ namespace armarx::navigation::server MemoryParameterizationService(mem::client::param::Reader* reader, mem::client::param::Writer* writer); - bool store(const aron::datanavigator::DictNavigatorPtr& params, + bool store(const aron::data::DictPtr& params, const std::string& clientId, const core::TimestampUs& timestamp); - bool store(const aron::data::AronDictPtr& params, + bool store(const aron::data::dto::DictPtr& params, const std::string& clientId, const core::TimestampUs& timestamp); diff --git a/source/armarx/navigation/trajectory_control/TrajectoryController.h b/source/armarx/navigation/trajectory_control/TrajectoryController.h index a6b3ddd6..f13e168a 100644 --- a/source/armarx/navigation/trajectory_control/TrajectoryController.h +++ b/source/armarx/navigation/trajectory_control/TrajectoryController.h @@ -28,7 +28,7 @@ #include <VirtualRobot/VirtualRobot.h> -#include <RobotAPI/libraries/aron/core/navigator/data/container/Dict.h> +#include <RobotAPI/libraries/aron/core/data/variant/container/Dict.h> #include "core.h" #include <armarx/navigation/core/DynamicScene.h> @@ -55,7 +55,7 @@ namespace armarx::navigation::traj_ctrl virtual ~TrajectoryControllerParams() = default; virtual Algorithms algorithm() const = 0; - virtual aron::datanavigator::DictNavigatorPtr toAron() const = 0; + virtual aron::data::DictPtr toAron() const = 0; }; class TrajectoryController diff --git a/source/armarx/navigation/trajectory_control/TrajectoryFollowingController.cpp b/source/armarx/navigation/trajectory_control/TrajectoryFollowingController.cpp index 97235f9a..0fef75df 100644 --- a/source/armarx/navigation/trajectory_control/TrajectoryFollowingController.cpp +++ b/source/armarx/navigation/trajectory_control/TrajectoryFollowingController.cpp @@ -27,7 +27,7 @@ namespace armarx::navigation::traj_ctrl return Algorithms::TrajectoryFollowingController; } - aron::datanavigator::DictNavigatorPtr + aron::data::DictPtr TrajectoryFollowingControllerParams::toAron() const { arondto::TrajectoryFollowingControllerParams dto; @@ -39,7 +39,7 @@ namespace armarx::navigation::traj_ctrl } TrajectoryFollowingControllerParams - TrajectoryFollowingControllerParams::FromAron(const aron::datanavigator::DictNavigatorPtr& dict) + TrajectoryFollowingControllerParams::FromAron(const aron::data::DictPtr& dict) { arondto::TrajectoryFollowingControllerParams dto; dto.fromAron(dict); diff --git a/source/armarx/navigation/trajectory_control/TrajectoryFollowingController.h b/source/armarx/navigation/trajectory_control/TrajectoryFollowingController.h index 561d1fa3..064de2fc 100644 --- a/source/armarx/navigation/trajectory_control/TrajectoryFollowingController.h +++ b/source/armarx/navigation/trajectory_control/TrajectoryFollowingController.h @@ -38,10 +38,10 @@ namespace armarx::navigation::traj_ctrl core::PIDParams pidOri; Algorithms algorithm() const override; - aron::datanavigator::DictNavigatorPtr toAron() const override; + aron::data::DictPtr toAron() const override; static TrajectoryFollowingControllerParams - FromAron(const aron::datanavigator::DictNavigatorPtr& dict); + FromAron(const aron::data::DictPtr& dict); }; class TrajectoryFollowingController : virtual public TrajectoryController diff --git a/source/armarx/navigation/trajectory_control/WaypointController.cpp b/source/armarx/navigation/trajectory_control/WaypointController.cpp index 5ff9ab88..c08ff5b9 100644 --- a/source/armarx/navigation/trajectory_control/WaypointController.cpp +++ b/source/armarx/navigation/trajectory_control/WaypointController.cpp @@ -15,7 +15,7 @@ namespace armarx::navigation::traj_ctrl return Algorithms::WaypointController; } - aron::datanavigator::DictNavigatorPtr + aron::data::DictPtr WaypointControllerParams::toAron() const { arondto::WaypointControllerParams dto; @@ -27,7 +27,7 @@ namespace armarx::navigation::traj_ctrl } WaypointControllerParams - WaypointControllerParams::FromAron(const aron::datanavigator::DictNavigatorPtr& dict) + WaypointControllerParams::FromAron(const aron::data::DictPtr& dict) { arondto::WaypointControllerParams dto; dto.fromAron(dict); diff --git a/source/armarx/navigation/trajectory_control/WaypointController.h b/source/armarx/navigation/trajectory_control/WaypointController.h index 7171be2c..13133e67 100644 --- a/source/armarx/navigation/trajectory_control/WaypointController.h +++ b/source/armarx/navigation/trajectory_control/WaypointController.h @@ -30,8 +30,8 @@ namespace armarx::navigation::traj_ctrl struct WaypointControllerParams : public TrajectoryControllerParams { Algorithms algorithm() const override; - aron::datanavigator::DictNavigatorPtr toAron() const override; - static WaypointControllerParams FromAron(const aron::datanavigator::DictNavigatorPtr& dict); + aron::data::DictPtr toAron() const override; + static WaypointControllerParams FromAron(const aron::data::DictPtr& dict); }; class WaypointController : virtual public TrajectoryController -- GitLab From a67e9370c89d105dc67eaf77aca86d5e90161628 Mon Sep 17 00:00:00 2001 From: Rainer Kartmann <rainer.kartmann@kit.edu> Date: Wed, 27 Oct 2021 09:26:29 +0200 Subject: [PATCH 3/5] Handle removed toJSON() --- source/armarx/navigation/core/CMakeLists.txt | 2 + source/armarx/navigation/core/Graph.cpp | 3 +- .../navigation/core/json_conversions.cpp | 45 +++++++++++++++++++ .../armarx/navigation/core/json_conversions.h | 36 +++++++++++++++ 4 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 source/armarx/navigation/core/json_conversions.cpp create mode 100644 source/armarx/navigation/core/json_conversions.h diff --git a/source/armarx/navigation/core/CMakeLists.txt b/source/armarx/navigation/core/CMakeLists.txt index c9b92d2c..d4eb4883 100644 --- a/source/armarx/navigation/core/CMakeLists.txt +++ b/source/armarx/navigation/core/CMakeLists.txt @@ -15,6 +15,7 @@ armarx_add_library(core types.cpp Graph.cpp aron_conversions.cpp + json_conversions.cpp time/ChronoMonotonicTimeServer.cpp HEADERS types.h @@ -27,6 +28,7 @@ armarx_add_library(core Graph.h TopologicScene.h aron_conversions.h + json_conversions.h time/ChronoMonotonicTimeServer.h time/TimeServerInterface.h DEPENDENCIES diff --git a/source/armarx/navigation/core/Graph.cpp b/source/armarx/navigation/core/Graph.cpp index c7cf378a..7bdd89ba 100644 --- a/source/armarx/navigation/core/Graph.cpp +++ b/source/armarx/navigation/core/Graph.cpp @@ -31,6 +31,7 @@ #include <RobotAPI/libraries/armem/core/wm/memory_definitions.h> #include <armarx/navigation/location/aron/Location.aron.generated.h> +#include <armarx/navigation/core/json_conversions.h> namespace armarx::navigation::core @@ -80,7 +81,7 @@ namespace armarx::navigation::core ss << " cost " << edge.attrib().cost() << ", type: " << static_cast<int>(edge.attrib().strategy) << " , has traj " - << edge.attrib().trajectory.has_value() << ", aron: " << edge.attrib().aron.toJSON(); + << edge.attrib().trajectory.has_value() << ", aron: " << nlohmann::json(edge.attrib().aron); return ss.str(); } diff --git a/source/armarx/navigation/core/json_conversions.cpp b/source/armarx/navigation/core/json_conversions.cpp new file mode 100644 index 00000000..30b8a70f --- /dev/null +++ b/source/armarx/navigation/core/json_conversions.cpp @@ -0,0 +1,45 @@ +/** + * This file is part of ArmarX. + * + * ArmarX is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * ArmarX is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @author Rainer Kartmann ( rainer dot kartmann at kit dot edu ) + * @date 2021 + * @copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ + +#include "json_conversions.h" + +#include <RobotAPI/libraries/aron/core/data/rw/writer/nlohmannJSON/NlohmannJSONWriter.h> +#include <RobotAPI/libraries/aron/core/data/rw/reader/nlohmannJSON/NlohmannJSONReader.h> + + +namespace armarx::navigation::core +{ + + void arondto::to_json(nlohmann::json& j, const Edge& bo) + { + armarx::aron::data::writer::NlohmannJSONWriter writer; + j = bo.write(writer); + } + + + void arondto::from_json(const nlohmann::json& j, Edge& bo) + { + armarx::aron::data::reader::NlohmannJSONReader reader; + bo.read<armarx::aron::data::reader::NlohmannJSONReader::InputType>(reader, j); + } + + +} // namespace armarx::navigation::core diff --git a/source/armarx/navigation/core/json_conversions.h b/source/armarx/navigation/core/json_conversions.h new file mode 100644 index 00000000..57cee75d --- /dev/null +++ b/source/armarx/navigation/core/json_conversions.h @@ -0,0 +1,36 @@ +/** + * This file is part of ArmarX. + * + * ArmarX is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * ArmarX is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @author Rainer Kartmann ( rainer dot kartmann at kit dot edu ) + * @date 2021 + * @copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ + +#pragma once + +#include <SimoxUtility/json/json.hpp> + +#include <armarx/navigation/core/aron/Graph.aron.generated.h> + + +namespace armarx::navigation::core::arondto +{ + + void to_json(nlohmann::json& j, const arondto::Edge& bo); + void from_json(const nlohmann::json& j, arondto::Edge& bo); + + +} // namespace armarx::navigation::graph -- GitLab From 3923b1bdb7f0e76668637d0c1cf8af94f5d0136d Mon Sep 17 00:00:00 2001 From: Rainer Kartmann <rainer.kartmann@kit.edu> Date: Fri, 5 Nov 2021 10:33:32 +0100 Subject: [PATCH 4/5] Update usage of disk ltm --- .../components/NavigationMemory/NavigationMemory.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/armarx/navigation/components/NavigationMemory/NavigationMemory.cpp b/source/armarx/navigation/components/NavigationMemory/NavigationMemory.cpp index ab09c3fe..11b8271d 100644 --- a/source/armarx/navigation/components/NavigationMemory/NavigationMemory.cpp +++ b/source/armarx/navigation/components/NavigationMemory/NavigationMemory.cpp @@ -140,7 +140,8 @@ namespace armarx::navigation { // armem::wm::Memory memory = armem::server::ltm::disk::load(path.value()); armem::server::ltm::disk::Memory ltm(path.value()); - armem::wm::Memory memory = ltm.loadAll(); + armem::wm::Memory memory; + ltm.loadAll(memory); ARMARX_INFO << "Loaded " << armem::print(memory); workingMemory().update(armem::toCommit(memory)); -- GitLab From 13c19db5967b9bc4daf42933297d7d40cfa3e330 Mon Sep 17 00:00:00 2001 From: Rainer Kartmann <rainer.kartmann@kit.edu> Date: Fri, 12 Nov 2021 11:17:05 +0100 Subject: [PATCH 5/5] Fix warnings --- .../navigation/algorithms/astar/NavigationCostMap.cpp | 7 ++++++- source/armarx/navigation/core/Graph.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/source/armarx/navigation/algorithms/astar/NavigationCostMap.cpp b/source/armarx/navigation/algorithms/astar/NavigationCostMap.cpp index 8900c799..883f20a1 100644 --- a/source/armarx/navigation/algorithms/astar/NavigationCostMap.cpp +++ b/source/armarx/navigation/algorithms/astar/NavigationCostMap.cpp @@ -95,7 +95,12 @@ namespace armarx::navigation::algorithm::astar robotCollisionModel->setGlobalPose(globalPose.matrix()); - VirtualRobot::BoundingBox robotBbox = robotCollisionModel->getBoundingBox(true); + // Unused. + if (false) + { + VirtualRobot::BoundingBox robotBbox = robotCollisionModel->getBoundingBox(true); + (void) robotBbox; + } Eigen::Vector3f P1; Eigen::Vector3f P2; diff --git a/source/armarx/navigation/core/Graph.h b/source/armarx/navigation/core/Graph.h index 5b8fb88b..904f51c6 100644 --- a/source/armarx/navigation/core/Graph.h +++ b/source/armarx/navigation/core/Graph.h @@ -58,7 +58,7 @@ namespace armarx::navigation::core { armarx::navigation::core::arondto::Edge aron; - client::GlobalPlanningStrategy strategy; + client::GlobalPlanningStrategy strategy = client::GlobalPlanningStrategy::Free; // client::Config config; float& -- GitLab