RobWorkProject  0.7.0
Public Member Functions | List of all members
RWSimulator Class Reference

Inherits PhysicsEngine.

Public Member Functions

 RWSimulator (rw::common::Ptr< rwsim::dynamics::DynamicWorkCell > dwc)
 constructor
 
virtual ~RWSimulator ()
 default destructor
 
void load (rw::common::Ptr< rwsim::dynamics::DynamicWorkCell > dwc)
 adds dynamic workcell More...
 
bool setContactDetector (rw::common::Ptr< rwsim::contacts::ContactDetector > detector)
 Change the contact detector used by the engine. More...
 
void initPhysics (rw::kinematics::State &state)
 initialize simulator physics with state More...
 
void step (double dt, rw::kinematics::State &state)
 Performs a step and updates the state. More...
 
void resetScene (rw::kinematics::State &state)
 reset velocity and acceleration of all bodies to 0. And sets the position of all bodies to that described in state More...
 
void exitPhysics ()
 cleans up the allocated storage fo bullet physics More...
 
double getTime ()
 gets the the current simulated time More...
 
void attach (dynamics::Body::Ptr b1, dynamics::Body::Ptr b2)
 
void detach (dynamics::Body::Ptr b1, dynamics::Body::Ptr b2)
 
drawable::SimulatorDebugRender::Ptr createDebugRender ()
 create a debug render for the specific implementation More...
 
virtual void setEnabled (dynamics::Body::Ptr body, bool enabled)
 
rw::common::PropertyMapgetPropertyMap ()
 properties of the physics engine
 
void emitPropertyChanged ()
 should be called when properties have been changed and one wants the physics engine to reflect the new properties.
 
void addController (rw::common::Ptr< rwlibs::simulation::SimulatedController > controller)
 add a simulated controller to this simulator
 
void addBody (rwsim::dynamics::Body::Ptr body, rw::kinematics::State &state)
 
void addDevice (rw::common::Ptr< rwsim::dynamics::DynamicDevice > dev, rw::kinematics::State &state)
 add a dynamic device to the physics engine More...
 
void addSensor (rwlibs::simulation::SimulatedSensor::Ptr sensor, rw::kinematics::State &state)
 add a simulated sensor to this simulator
 
void removeController (rw::common::Ptr< rwlibs::simulation::SimulatedController > controller)
 removes a simulated controller from this simulator More...
 
void removeSensor (rwlibs::simulation::SimulatedSensor::Ptr sensor)
 add a simulated sensor to this simulator
 
void setDynamicsEnabled (rwsim::dynamics::Body::Ptr body, bool enabled)
 
std::vector< rwlibs::simulation::SimulatedSensor::PtrgetSensors ()
 get the list of simulated sensors More...
 
- Public Member Functions inherited from PhysicsEngine
virtual ~PhysicsEngine ()
 destructor
 
virtual void setEnabled (rw::common::Ptr< rwsim::dynamics::Body > body, bool enabled)=0
 
virtual void setDynamicsEnabled (rw::common::Ptr< rwsim::dynamics::Body > body, bool enabled)=0
 disables the dynamics of a body. More...
 
virtual void addBody (rw::common::Ptr< rwsim::dynamics::Body > body, rw::kinematics::State &state)=0
 add a body to the physics engine More...
 
virtual void attach (rw::common::Ptr< rwsim::dynamics::Body > b1, rw::common::Ptr< rwsim::dynamics::Body > b2)=0
 creates a 6dof dynamic constraint between the two bodies b1 and b2 More...
 
virtual void detach (rw::common::Ptr< rwsim::dynamics::Body > b1, rw::common::Ptr< rwsim::dynamics::Body > b2)=0
 removes the 6dof constraint between bodies b1 and b2 if there is any More...
 
virtual void setSimulatorLog (rw::common::Ptr< rwsim::log::SimulatorLogScope > log)
 Store internal info during simulation. More...
 

Additional Inherited Members

- Public Types inherited from PhysicsEngine
typedef rw::common::Ptr< PhysicsEnginePtr
 smart pointer type of PhysicsEngine
 

Member Function Documentation

◆ addDevice()

void addDevice ( rw::common::Ptr< rwsim::dynamics::DynamicDevice device,
rw::kinematics::State state 
)
inlinevirtual

add a dynamic device to the physics engine

Parameters
device[in] device to add
state[in] current state

Implements PhysicsEngine.

◆ createDebugRender()

drawable::SimulatorDebugRender::Ptr createDebugRender ( )
virtual

create a debug render for the specific implementation

Returns
NULL if no render is available else a valid render

Implements PhysicsEngine.

◆ exitPhysics()

void exitPhysics ( )
virtual

cleans up the allocated storage fo bullet physics

Implements PhysicsEngine.

◆ getSensors()

std::vector<rwlibs::simulation::SimulatedSensor::Ptr> getSensors ( )
inlinevirtual

get the list of simulated sensors

Returns

Implements PhysicsEngine.

◆ getTime()

double getTime ( )
inlinevirtual

gets the the current simulated time

Implements PhysicsEngine.

◆ initPhysics()

void initPhysics ( rw::kinematics::State state)
virtual

initialize simulator physics with state

Implements PhysicsEngine.

◆ load()

void load ( rw::common::Ptr< rwsim::dynamics::DynamicWorkCell dwc)
virtual

adds dynamic workcell

Implements PhysicsEngine.

◆ removeController()

void removeController ( rw::common::Ptr< rwlibs::simulation::SimulatedController controller)
inlinevirtual

removes a simulated controller from this simulator

Parameters
controller

Implements PhysicsEngine.

◆ resetScene()

void resetScene ( rw::kinematics::State state)
virtual

reset velocity and acceleration of all bodies to 0. And sets the position of all bodies to that described in state

Implements PhysicsEngine.

◆ setContactDetector()

bool setContactDetector ( rw::common::Ptr< rwsim::contacts::ContactDetector detector)
virtual

Change the contact detector used by the engine.

Parameters
detector[in] the contact detector to use (NULL for default contact detection)
Returns
true if engine supports using a ContactDetector and the detector was set successfully.

Implements PhysicsEngine.

◆ step()

void step ( double  dt,
rw::kinematics::State state 
)
virtual

Performs a step and updates the state.

Implements PhysicsEngine.


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