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

Inherits PhysicsEngine.

Public Member Functions

 RWSimulator (rw::core::Ptr< rwsim::dynamics::DynamicWorkCell > dwc)
 constructor
 
virtual ~RWSimulator ()
 default destructor
 
void load (rw::core::Ptr< rwsim::dynamics::DynamicWorkCell > dwc)
 adds dynamic workcell More...
 
bool setContactDetector (rw::core::Ptr< rwsim::contacts::BaseContactDetector > 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::core::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::core::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::core::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::core::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::core::Ptr< rwsim::dynamics::Body > body, bool enabled)=0
 
virtual void setDynamicsEnabled (rw::core::Ptr< rwsim::dynamics::Body > body, bool enabled)=0
 disables the dynamics of a body. More...
 
virtual void addBody (rw::core::Ptr< rwsim::dynamics::Body > body, rw::kinematics::State &state)=0
 add a body to the physics engine More...
 
virtual void attach (rw::core::Ptr< rwsim::dynamics::Body > b1, rw::core::Ptr< rwsim::dynamics::Body > b2)=0
 creates a 6dof dynamic constraint between the two bodies b1 and b2 More...
 
virtual void detach (rw::core::Ptr< rwsim::dynamics::Body > b1, rw::core::Ptr< rwsim::dynamics::Body > b2)=0
 removes the 6dof constraint between bodies b1 and b2 if there is any More...
 
virtual void setSimulatorLog (rw::core::Ptr< rwsim::log::SimulatorLogScope > log)
 Store internal info during simulation. More...
 
virtual void forceUpdate (rw::core::Ptr< rwsim::dynamics::Body > body, rw::kinematics::State &state)
 this will force the physics engine to update the state of the body. This can be i.e. be used to teleport a rigid body to a new position. More...
 

Additional Inherited Members

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

Member Function Documentation

◆ addDevice()

void addDevice ( rw::core::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::core::Ptr< rwsim::dynamics::DynamicWorkCell dwc)
virtual

adds dynamic workcell

Implements PhysicsEngine.

◆ removeController()

void removeController ( rw::core::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::core::Ptr< rwsim::contacts::BaseContactDetector 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: