RobWorkProject  23.9.11-
Classes | Public Types | Public Member Functions | List of all members
Simulator Class Referenceabstract

interface of a general simulator More...

#include <Simulator.hpp>

Inherited by KinematicSimulator, and DynamicSimulator.

Classes

struct  UpdateInfo
 step info is used when updating controllers, devices and bodies. More...
 

Public Types

typedef rw::core::Ptr< SimulatorPtr
 smart pointer type of simulator
 

Public Member Functions

virtual void step (double dt)=0
 take a step forward in time with timestep dt. More...
 
virtual void reset (const rw::kinematics::State &state)=0
 reset velocity and acceleration of all bodies to 0. And sets the position of all bodies to that described in state
 
virtual void init (rw::kinematics::State &state)=0
 initialize simulator with state variables
 
virtual double getTime ()=0
 gets the the current simulated time
 
virtual rw::kinematics::StategetState ()=0
 get current state of simulator More...
 
virtual void setEnabled (rw::core::Ptr< rw::kinematics::Frame > frame, bool enabled)=0
 
virtual rw::core::PropertyMapgetPropertyMap ()=0
 get propertymap of this simulator
 
virtual rw::sensor::Sensor::Ptr getSensor (const std::string &name)
 get sensor with specific name
 
virtual rwlibs::control::Controller::Ptr getController (const std::string &name)
 get controller with specific name
 
template<class SIMSENSORTYPE >
rw::sensor::Sensor::Ptr getSensorHandle (SIMSENSORTYPE *ssensor)
 get sensorhandle to a statefull instance of the simulated sensor, controlling the sensor in this simulator. More...
 
template<class SIMSENSORTYPE >
bool hasHandle (SIMSENSORTYPE *ssensor)
 Test if handle for simulatedsensor exists. More...
 
template<class SIMSENSORTYPE >
void addHandle (SIMSENSORTYPE *ssensor, rw::sensor::Sensor::Ptr sensor)
 add handle to a specific simulated sensor More...
 

Detailed Description

interface of a general simulator

Member Function Documentation

◆ addHandle()

void addHandle ( SIMSENSORTYPE *  ssensor,
rw::sensor::Sensor::Ptr  sensor 
)
inline

add handle to a specific simulated sensor

Parameters
ssensor[in] simulated sensor to add handle to
sensor[in] handle to statfull instance

◆ getSensorHandle()

rw::sensor::Sensor::Ptr getSensorHandle ( SIMSENSORTYPE *  ssensor)
inline

get sensorhandle to a statefull instance of the simulated sensor, controlling the sensor in this simulator.

Parameters
ssensor[in] the simulated sensor for which to retrieve a handle
Returns
handle to simulated sensor instance or null if none exists

◆ getState()

virtual rw::kinematics::State& getState ( )
pure virtual

get current state of simulator

Returns
current state of simulator

Implemented in DynamicSimulator.

◆ hasHandle()

bool hasHandle ( SIMSENSORTYPE *  ssensor)
inline

Test if handle for simulatedsensor exists.

Parameters
ssensor[in] the simulated sensor for which to check if a handle exists
Returns
true if a handle to simulated sensor instance exists, false otherwise

◆ setEnabled()

virtual void setEnabled ( rw::core::Ptr< rw::kinematics::Frame frame,
bool  enabled 
)
pure virtual

Enables or disables simulation of a frame

Implemented in DynamicSimulator.

◆ step()

virtual void step ( double  dt)
pure virtual

take a step forward in time with timestep dt.

Parameters
dt[in] the time step

Implemented in DynamicSimulator, and KinematicSimulator.


The documentation for this class was generated from the following file: