Skip to content
Snippets Groups Projects
Commit aaea3fe9 authored by Fabian Reister's avatar Fabian Reister
Browse files

update

parent 92f7797f
No related branches found
No related tags found
No related merge requests found
Showing
with 127 additions and 62 deletions
......@@ -29,7 +29,7 @@
// #include <SimoxUtility/color/Color.h>
namespace armarx
namespace armarx::nav::components
{
armarx::PropertyDefinitionsPtr Navigator::createPropertyDefinitions()
......
......@@ -31,7 +31,7 @@
BOOST_AUTO_TEST_CASE(testExample)
{
armarx::Navigator instance;
armarx::nav::components::Navigator instance;
BOOST_CHECK_EQUAL(true, true);
}
......@@ -7,6 +7,8 @@ armarx_add_library(
LIBS
ArmarXCoreInterfaces
ArmarXCore
Navigation::core
SOURCES
./algorithms.cpp
HEADERS
......
......@@ -8,8 +8,14 @@ armarx_add_library(
ArmarXCoreInterfaces
ArmarXCore
# RobotAPI
aron_core
aron
armem
# Navigation
Navigation::core
Navigation::global_planning
Navigation::local_planning
Navigation::trajectory_control
Navigation::safety_control
SOURCES
# ./Navigator.cpp
./NavigationStackConfig.cpp
......
......@@ -2,10 +2,27 @@
#include <RobotAPI/interface/aron/Aron.h>
#include "Navigation/libraries/core/constants.h"
namespace armarx::nav::client
{
aron::data::AronDictPtr NavigationStackConfig::toAron() const
{
return dict.toAronDictPtr();
}
}
\ No newline at end of file
NavigationStackConfig&
NavigationStackConfig::configureGlobalPlanner(const glob_plan::GlobalPlannerParams& params)
{
aron::datanavigator::DictNavigatorPtr element(new aron::datanavigator::DictNavigator);
element->addElement(
core::NAME_KEY,
std::make_shared<aron::datanavigator::StringNavigator>(
glob_plan::AlgorithmNames.to_name(params.algorithm())));
element->addElement(core::PARAMS_KEY, params.toAron());
dict.addElement(GLOBAL_PLANNER, element);
return *this;
}
} // namespace armarx::nav::client
\ No newline at end of file
......@@ -29,57 +29,19 @@
#include <RobotAPI/interface/aron/Aron.h>
#include <RobotAPI/libraries/aron/core/navigator/data/container/Dict.h>
#include "Navigation/libraries/global_planning/GlobalPlanner.h"
#include <type_traits>
namespace armarx::nav::client
{
const std::string NAME_KEY = "name";
const std::string PARAMS_KEY = "params";
class Factory
{
GlobalPlannerPtr create(const aron::data::AronDictPtr& params)
{
const aron::datanavigator::DictNavigatorPtr dict =
aron::datanavigator::DictNavigator::FromAronDictPtr(params);
GlobalPlannerAlgorithms algo; // TODO from params / dict
aron::datanavigator::DictNavigatorPtr algoParams =
aron::datanavigator::DictNavigator::DynamicCast(dict->getElement(PARAMS_KEY));
GlobalPlannerPtr globalPlanner;
switch (algo)
{
case GlobalPlannerAlgorithms::AStar:
globalPlanner = std::make_shared<AStar>(AStarParams::FromAron(algoParams));
}
return globalPlanner;
}
};
class NavigationStackConfig
{
public:
NavigationStackConfig() = default;
NavigationStackConfig& configureGlobalPlanner(const GlobalPlannerParams& params)
{
aron::datanavigator::DictNavigatorPtr element(new aron::datanavigator::DictNavigator);
element->addElement(NAME_KEY,
std::make_shared<aron::datanavigator::StringNavigator>(
GlobalPlannerAlgorithmNames.to_name(params.algorithm())));
element->addElement(PARAMS_KEY, params.toAron());
dict.addElement(GLOBAL_PLANNER, element);
return *this;
}
NavigationStackConfig& configureGlobalPlanner(const glob_plan::GlobalPlannerParams& params);
NavigationStackConfig& configureLocalPlanner();
......
......@@ -20,6 +20,9 @@
* GNU General Public License
*/
#include "Navigation/libraries/global_planning/AStar.h"
#include "Navigation/libraries/server/NavigationStack.h"
#define BOOST_TEST_MODULE Navigation::ArmarXLibraries::client
#define ARMARX_BOOST_TEST
......
......@@ -7,6 +7,10 @@ armarx_add_library(
LIBS
ArmarXCoreInterfaces
ArmarXCore
# RobotAPI
aron_core
aron
RobotAPIInterfaces
SOURCES
HEADERS
types.h
......
/*
* 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 Fabian Reister ( fabian dot reister at kit dot edu )
* @date 2021
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#pragma once
namespace armarx::nav::core
{
const std::string NAME_KEY = "name";
const std::string PARAMS_KEY = "params";
} // namespace armarx::nav::core
\ No newline at end of file
......@@ -7,6 +7,11 @@ armarx_add_library(
LIBS
ArmarXCoreInterfaces
ArmarXCore
Navigation::core
Navigation::global_planning
Navigation::local_planning
Navigation::trajectory_control
Navigation::safety_control
SOURCES
./GlobalPlannerFactory.cpp
./LocalPlannerFactory.cpp
......
#include "GlobalPlannerFactory.h"
#include "Navigation/libraries/global_planning/AStar.h"
#include "Navigation/libraries/core/constants.h"
#include "Navigation/libraries/global_planning/core.h"
namespace armarx::nav::fac
{
glob_plan::GlobalPlannerPtr GlobalPlannerFactory::create(const aron::data::AronDictPtr& params)
{
const aron::datanavigator::DictNavigatorPtr dict =
aron::datanavigator::DictNavigator::FromAronDictPtr(params);
glob_plan::Algorithms algo = glob_plan::Algorithms::AStar; // TODO from params / dict
aron::datanavigator::DictNavigatorPtr algoParams =
aron::datanavigator::DictNavigator::DynamicCast(dict->getElement(core::PARAMS_KEY));
glob_plan::GlobalPlannerPtr globalPlanner;
switch (algo)
{
case glob_plan::Algorithms::AStar:
globalPlanner = std::make_shared<glob_plan::AStar>(glob_plan::AStarParams::FromAron(algoParams));
}
return globalPlanner;
}
} // namespace armarx::nav::fac
......@@ -21,15 +21,13 @@
#pragma once
#include "Navigation/libraries/global_planning/GlobalPlanner.h"
namespace armarx::nav::fac
{
class GlobalPlannerFactory
{
public:
protected:
private:
glob_plan::GlobalPlannerPtr create(const aron::data::AronDictPtr& params);
};
} // namespace armarx::nav::fac
\ No newline at end of file
......@@ -5,20 +5,20 @@ namespace armarx::nav::glob_plan
// AStarParams
GlobalPlannerAlgorithms AStarParams::algorithm() const
Algorithms AStarParams::algorithm() const
{
return GlobalPlannerAlgorithms::AStar;
return Algorithms::AStar;
}
aron::datanavigator::DictNavigatorPtr AStarParams::toAron() const
{
return nullptr; // TODO implement
};
}
AStarParams AStarParams::FromAron(const aron::datanavigator::DictNavigatorPtr& dict)
{
return AStarParams(); // TODO implement
};
}
// AStar
......
......@@ -28,7 +28,7 @@ namespace armarx::nav::glob_plan
struct AStarParams : public GlobalPlannerParams
{
GlobalPlannerAlgorithms algorithm() const override;
Algorithms algorithm() const override;
aron::datanavigator::DictNavigatorPtr toAron() const override;
......
......@@ -7,6 +7,8 @@ armarx_add_library(
LIBS
ArmarXCoreInterfaces
ArmarXCore
Navigation::core
SOURCES
./GlobalPlanner.cpp
./AStar.cpp
......
......@@ -30,7 +30,7 @@ namespace armarx::nav::glob_plan
struct GlobalPlannerParams
{
virtual GlobalPlannerAlgorithms algorithm() const = 0;
virtual Algorithms algorithm() const = 0;
virtual aron::datanavigator::DictNavigatorPtr toAron() const = 0;
};
......@@ -40,4 +40,6 @@ namespace armarx::nav::glob_plan
protected:
private:
};
using GlobalPlannerPtr = std::shared_ptr<GlobalPlanner>;
} // namespace armarx::nav::glob_plan
\ No newline at end of file
......@@ -27,14 +27,14 @@
namespace armarx::nav::glob_plan
{
enum class GlobalPlannerAlgorithms
enum class Algorithms
{
AStar
// TODO extend
};
simox::meta::EnumNames<GlobalPlannerAlgorithms> GlobalPlannerAlgorithmNames
simox::meta::EnumNames<Algorithms> AlgorithmNames
{
{GlobalPlannerAlgorithms::AStar, "AStar"}};
{Algorithms::AStar, "AStar"}};
} // namespace armarx::nav::glob_plan
\ No newline at end of file
......@@ -7,6 +7,8 @@ armarx_add_library(
LIBS
ArmarXCoreInterfaces
ArmarXCore
Navigation::core
SOURCES
./LocalPlanner.cpp
HEADERS
......
......@@ -7,6 +7,8 @@ armarx_add_library(
LIBS
ArmarXCoreInterfaces
ArmarXCore
Navigation::core
SOURCES
./SafetyController.cpp
HEADERS
......
......@@ -21,15 +21,16 @@
#pragma once
#include <memory>
namespace armarx::nav::safe_ctrl
{
class SafetyController
{
public:
protected:
private:
};
using SafetyControllerPtr = std::shared_ptr<SafetyController>;
} // namespace armarx::nav::safe_ctrl
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment