25 #ifndef SRC_PLANTS_INCLUDE_CORBO_PLANTS_PLANT_INTERFACE_H_ 26 #define SRC_PLANTS_INCLUDE_CORBO_PLANTS_PLANT_INTERFACE_H_ 32 #ifdef MESSAGE_SUPPORT 33 #include <corbo-communication/messages/plants/plant.pb.h> 57 using Ptr = std::shared_ptr<PlantInterface>;
99 const std::string& ns =
"");
144 #ifdef MESSAGE_SUPPORT 145 virtual void toMessage(messages::Plant& message)
const {}
148 virtual void fromMessage(
const messages::Plant& message, std::stringstream* issues =
nullptr) {}
153 #define FACTORY_REGISTER_PLANT(type) FACTORY_REGISTER_OBJECT(type, PlantInterface) 157 #endif // SRC_PLANTS_INCLUDE_CORBO_PLANTS_PLANT_INTERFACE_H_
virtual Ptr getInstance() const =0
Return a newly created shared instance of the implemented class.
virtual void getAvailableSignals(SignalTargetInterface &signal_target, const std::string &ns="") const
Retrieve available signals from the plant.
virtual bool requiresFutureStates() const =0
virtual void stop()
Stop plant (you might probably use this to set the plant into a safe setpoint)
static Factory< PlantInterface > & getFactory()
Get access to the associated factory.
Interface class for signal targets.
Representation of time stamps.
virtual int getInputDimension() const =0
Return the plant input dimension (u)
virtual bool requiresFutureControls() const =0
Eigen::VectorXd StateVector
virtual ~PlantInterface()
Virtual destructor.
static Factory & instance()
< Retrieve static instance of the factory
Eigen::VectorXd ControlVector
std::shared_ptr< PlantInterface > Ptr
A matrix or vector expression mapping an existing expression.
virtual bool initialize()
Initialize plant.
virtual int getOutputDimension() const =0
Return the plant output dimension (y)
virtual bool setState(const Eigen::Ref< const Eigen::VectorXd > &state)
Set/move plant to a desired state (if possible)
virtual bool control(const ControlVector &u, const Duration &dt, const Time &t, SignalTargetInterface *signal_target=nullptr, const std::string &ns="")
Send commands to plant.
Eigen::VectorXd OutputVector
virtual bool output(OutputVector &output, const Time &t, SignalTargetInterface *signal_target=nullptr, const std::string &ns="")=0
Retrieve current plant output (measurements)
std::shared_ptr< const TimeSeries > ConstPtr
Representation of time durations.
Interface class for plants.