|  | RobWorkProject
    23.9.11-
    | 
A general physics engine interface for simulating dynamics of objects and robot devices. More...
#include <PhysicsEngine.hpp>
Inherited by ODESimulator, RWSimulator, and BtSimulator.
| Classes | |
| class | Dispatcher | 
| Each engine implements a dispatcher that creates instances of the engine.  More... | |
| class | Factory | 
| a factory for PhysicsEngine. This factory defines an extension point for PhysicsEngines.  More... | |
| Public Types | |
| typedef rw::core::Ptr< PhysicsEngine > | Ptr | 
| smart pointer type of PhysicsEngine | |
| Public Member Functions | |
| virtual | ~PhysicsEngine () | 
| destructor | |
| virtual void | load (rw::core::Ptr< rwsim::dynamics::DynamicWorkCell > dwc)=0 | 
| adds dynamic workcell | |
| virtual bool | setContactDetector (rw::core::Ptr< rwsim::contacts::BaseContactDetector > detector)=0 | 
| Change the contact detector used by the engine.  More... | |
| virtual void | step (double dt, rw::kinematics::State &state)=0 | 
| Performs a step and updates the state. | |
| virtual void | resetScene (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 | initPhysics (rw::kinematics::State &state)=0 | 
| initialize simulator physics with state | |
| virtual void | exitPhysics ()=0 | 
| cleans up the allocated storage fo bullet physics | |
| virtual double | getTime ()=0 | 
| gets the the current simulated time | |
| 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 drawable::SimulatorDebugRender::Ptr | createDebugRender ()=0 | 
| create a debug render for the specific implementation  More... | |
| virtual rw::core::PropertyMap & | getPropertyMap ()=0 | 
| properties of the physics engine | |
| virtual void | emitPropertyChanged ()=0 | 
| should be called when properties have been changed and one wants the physics engine to reflect the new properties. | |
| virtual void | addController (rw::core::Ptr< rwlibs::simulation::SimulatedController > controller)=0 | 
| add a simulated controller to this simulator | |
| virtual void | removeController (rw::core::Ptr< rwlibs::simulation::SimulatedController > controller)=0 | 
| removes a simulated controller from this simulator  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 | addDevice (rw::core::Ptr< rwsim::dynamics::DynamicDevice > device, rw::kinematics::State &state)=0 | 
| add a dynamic device to the physics engine  More... | |
| virtual void | addSensor (rwlibs::simulation::SimulatedSensor::Ptr sensor, rw::kinematics::State &state)=0 | 
| add a simulated sensor to this simulator | |
| virtual void | removeSensor (rwlibs::simulation::SimulatedSensor::Ptr sensor)=0 | 
| add a simulated sensor to this simulator | |
| 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 std::vector< rwlibs::simulation::SimulatedSensor::Ptr > | getSensors ()=0 | 
| get the list of simulated sensors  More... | |
| virtual void | setSimulatorLog (rw::core::Ptr< rwsim::log::SimulatorLogScope > log) | 
| Store internal info during simulation.  More... | |
A general physics engine interface for simulating dynamics of objects and robot devices.
The general step looks like this:;
Foreach controller=_controllers controller->update(dt,state);
collision detection (contact detection) constraint solving update device/body positions (integration)
Foreach sensor=_sensors sensor->update(dt,state)
| 
 | pure virtual | 
add a body to the physics engine
| body | [in] body to add | 
| state | [in] current state | 
Implemented in BtSimulator.
| 
 | pure virtual | 
add a dynamic device to the physics engine
| device | [in] device to add | 
| state | [in] current state | 
Implemented in BtSimulator, and RWSimulator.
| 
 | pure virtual | 
creates a 6dof dynamic constraint between the two bodies b1 and b2
| b1 | |
| b2 | 
Implemented in BtSimulator.
| 
 | pure virtual | 
create a debug render for the specific implementation
Implemented in ODESimulator, BtSimulator, and RWSimulator.
| 
 | pure virtual | 
removes the 6dof constraint between bodies b1 and b2 if there is any
| b1 | |
| b2 | 
Implemented in BtSimulator.
| 
 | pure virtual | 
get the list of simulated sensors
Implemented in ODESimulator, BtSimulator, and RWSimulator.
| 
 | pure virtual | 
removes a simulated controller from this simulator
| controller | 
Implemented in BtSimulator, and RWSimulator.
| 
 | pure virtual | 
Change the contact detector used by the engine.
| detector | [in] the contact detector to use (NULL for default contact detection) | 
Implemented in ODESimulator, BtSimulator, and RWSimulator.
| 
 | pure virtual | 
| 
 | pure virtual | 
Enables or disables a body. A body is automatically enabled if contacts or new interactions with the Body arrise
| body | [in] the body to enable/disable | 
| enabled | [in] | 
Implemented in BtSimulator.
| 
 | inlinevirtual | 
Store internal info during simulation.
This can be used for debugging, statistics, visualization of internal subresults, timing, benchmark and similar.
| log | [in] a pointer to the log structure to store to. | 
Reimplemented in ODESimulator.