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

server/execution: using RT-Controller instead

parent 2d5c0739
No related branches found
No related tags found
1 merge request!25RT controller and simplification
......@@ -2,7 +2,7 @@
namespace armarx::navigation::core
{
struct Twist;
class Trajectory;
} // namespace armarx::navigation::core
namespace armarx::navigation::server
......@@ -17,7 +17,8 @@ namespace armarx::navigation::server
public:
virtual ~ExecutorInterface() = default;
virtual void move(const core::Twist& twist) = 0;
virtual void execute(const core::Trajectory& trajectory) = 0;
virtual void stop() = 0;
};
} // namespace armarx::navigation::server
#include "PlatformControllerExecutor.h"
#include <armarx/control/client/ComponentPlugin.h>
#include <armarx/control/common/type.h>
#include <armarx/navigation/common/controller_types.h>
#include <armarx/navigation/platform_controller/aron/PlatformTrajectoryControllerConfig.aron.generated.h>
namespace armarx::navigation::server
{
PlatformControllerExecutor::PlatformControllerExecutor(
ControllerComponentPlugin& controllerComponentPlugin) :
controllerPlugin(controllerComponentPlugin)
{
controllerComponentPlugin.getRobotUnitPlugin().getRobotUnit()->loadLibFromPackage(
"armarx_navigation", "libarmarx_navigation_platform_controller.so");
auto builder = controllerPlugin.createControllerBuilder<
armarx::navigation::common::ControllerType::PlatformTrajectory>();
ctrl.emplace(builder.create().value());
ARMARX_CHECK(ctrl.has_value());
}
PlatformControllerExecutor::~PlatformControllerExecutor() = default;
void
PlatformControllerExecutor::execute(const core::Trajectory& trajectory)
{
}
} // namespace armarx::navigation::server
#pragma once
#include <RobotAPI/interface/units/RobotUnit/RobotUnitInterface.h>
#include <armarx/control/client/ComponentPlugin.h>
#include <armarx/navigation/common/controller_types.h>
#include <armarx/navigation/core/types.h>
#include <armarx/navigation/platform_controller/aron/PlatformTrajectoryControllerConfig.aron.generated.h>
#include <armarx/navigation/platform_controller/controller_descriptions.h>
#include <armarx/navigation/server/execution/ExecutorInterface.h>
namespace armarx::control::client
{
class ComponentPlugin;
}
namespace armarx::navigation::server
{
/**
* @brief The PlatformUnitExecutor class
*
* TODO: Should be renamed to whatever the new unit will be called which takes Mat4f
* as input instead of X/Y/Yaw, so that we have a generic interface.
*/
class PlatformControllerExecutor : virtual public ExecutorInterface
{
public:
using ControllerComponentPlugin = armarx::control::client::ComponentPlugin;
PlatformControllerExecutor(ControllerComponentPlugin& controllerComponentPlugin);
~PlatformControllerExecutor() override;
void execute(const core::Trajectory& trajectory) override;
void stop() override{
// FIXME implement
};
private:
std::optional<armarx::control::client::ControllerWrapper<
armarx::navigation::common::ControllerType::PlatformTrajectory>>
ctrl;
ControllerComponentPlugin& controllerPlugin;
};
} // namespace armarx::navigation::server
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