Go to the documentation of this file.
25 #ifndef SRC_PLANTS_INCLUDE_CORBO_PLANTS_SIMULATED_PLANT_THREADED_H_
26 #define SRC_PLANTS_INCLUDE_CORBO_PLANTS_SIMULATED_PLANT_THREADED_H_
52 class SimulatedPlantThreaded :
public SimulatedPlant
65 Ptr getInstance()
const override {
return std::make_shared<SimulatedPlantThreaded>(); }
89 #ifdef MESSAGE_SUPPORT
90 void toMessage(messages::SimulatedPlantThreaded& message)
const;
93 void fromMessage(
const messages::SimulatedPlantThreaded& message, std::stringstream* issues =
nullptr);
96 void toMessage(messages::Plant& message)
const override { toMessage(*message.mutable_simulated_plant_threaded()); }
98 void fromMessage(
const messages::Plant& message, std::stringstream* issues =
nullptr)
override
100 fromMessage(message.simulated_plant_threaded(), issues);
123 #endif // SRC_PLANTS_INCLUDE_CORBO_PLANTS_SIMULATED_PLANT_THREADED_H_
Eigen::VectorXd OutputVector
Interface class for signal targets.
#define FACTORY_REGISTER_PLANT(type)
SimulatedPlantThreaded()
Default constructor.
std::shared_ptr< const TimeSeries > ConstPtr
Ptr getInstance() const override
Return a newly created shared instance of the implemented class.
bool initialize() override
Initialize plant.
Eigen::VectorXd ControlVector
bool output(OutputVector &output, const Time &t, SignalTargetInterface *signal_target=nullptr, const std::string &ns="") override
Retrieve current plant output (measurements)
std::mutex _current_state_mutex
bool setState(const Eigen::Ref< const Eigen::VectorXd > &state) override
Set/move plant to a desired state (if possible)
virtual ~SimulatedPlantThreaded()
Representation of time durations.
void setSimulationRate(double sim_rate)
Specify rate for the simulation thread.
std::shared_ptr< SystemDynamicsInterface > Ptr
Adapter class for plant simulation (threaded version)
A matrix or vector expression mapping an existing expression.
std::thread _worker_thread
Representation of time stamps.
std::shared_ptr< SystemOutputInterface > Ptr
std::mutex _control_mutex
bool control(const TimeSeries::ConstPtr &u_sequence, const TimeSeries::ConstPtr &x_sequence, const Duration &dt, const Time &t, SignalTargetInterface *signal_target=nullptr, const std::string &ns="") override
Send commands to plant.
Eigen::VectorXd StateVector
void stop() override
Stop plant (you might probably use this to set the plant into a safe setpoint)
std::shared_ptr< PlantInterface > Ptr
control_box_rst
Author(s): Christoph Rösmann
autogenerated on Wed Mar 2 2022 00:06:14