25 #ifndef SRC_CONTROLLERS_INCLUDE_CORBO_CONTROLLERS_CONTROLLER_INTERFACE_H_ 26 #define SRC_CONTROLLERS_INCLUDE_CORBO_CONTROLLERS_CONTROLLER_INTERFACE_H_ 36 #ifdef MESSAGE_SUPPORT 37 #include <corbo-communication/messages/controllers/controllers.pb.h> 61 using Ptr = std::shared_ptr<ControllerInterface>;
62 using UPtr = std::unique_ptr<ControllerInterface>;
141 virtual void reset() = 0;
158 #ifdef MESSAGE_SUPPORT 159 virtual void toMessage(corbo::messages::Controller& message)
const {}
162 virtual void fromMessage(
const corbo::messages::Controller& message, std::stringstream* issues =
nullptr) {}
167 #define FACTORY_REGISTER_CONTROLLER(type) FACTORY_REGISTER_OBJECT(type, ControllerInterface) 171 #endif // SRC_CONTROLLERS_INCLUDE_CORBO_CONTROLLERS_CONTROLLER_INTERFACE_H_
virtual double getControlDuration() const
Return the duration for which the control u obtained from step() is valid (useful for asynchronous co...
Eigen::VectorXd ControlVector
virtual void reset()=0
Reset internal controller state and caches.
virtual ControllerStatistics::Ptr getStatistics() const
virtual void sendSignals(double t, SignalTargetInterface &signal_target, const std::string &ns="") const
std::shared_ptr< ControllerStatistics > Ptr
virtual bool step(const StateVector &x, ReferenceTrajectoryInterface &xref, ReferenceTrajectoryInterface &uref, const Duration &dt, const Time &t, ControlVector &u, SignalTargetInterface *signal_target=nullptr, const std::string &ns="")
Perform actual controller step / control law computation.
virtual bool providesFutureStates() const =0
Interface class for signal targets.
Representation of time stamps.
virtual bool hasPiecewiseConstantControls() const =0
Return true if the controller returns piecewise constant control pieces.
virtual int getStateDimension() const =0
Return the dimension of the required plant state/output.
virtual bool supportsAsynchronousControl() const
Specify whether the controllers step function is independent of dt and getControlDuration() returns a...
static Factory & instance()
< Retrieve static instance of the factory
virtual Ptr getInstance() const =0
Return a newly created shared instance of the implemented class.
virtual int getControlInputDimension() const =0
Return the control input dimension.
Interface class for reference trajectories.
Eigen::VectorXd StateVector
virtual bool providesFutureControls() const =0
Interface class for controllers.
std::shared_ptr< TimeSeries > Ptr
virtual bool initialize(const StateVector &x, ReferenceTrajectoryInterface &expected_xref, ReferenceTrajectoryInterface &expected_uref, const Duration &expected_dt, const Time &t, ReferenceTrajectoryInterface *expected_sref=nullptr)
Initialize the controller.
Representation of time durations.
std::unique_ptr< ControllerInterface > UPtr
virtual ~ControllerInterface()
Virtual destructor.
std::shared_ptr< ControllerInterface > Ptr
static Factory< ControllerInterface > & getFactory()
Get access to the associated factory.
virtual void getAvailableSignals(SignalTargetInterface &signal_target, const std::string &ns="") const
Retrieve available signals from the controller.