openrave.org

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
OpenRAVE::PhysicsEngineBase Class Referenceabstract

[interface] The physics engine interfaces supporting simulations and dynamics. See Physics Engine Concepts. More...

#include <physicsengine.h>

Inheritance diagram for OpenRAVE::PhysicsEngineBase:
Inheritance graph
[legend]
Collaboration diagram for OpenRAVE::PhysicsEngineBase:
Collaboration graph
[legend]

Public Member Functions

 PhysicsEngineBase (EnvironmentBasePtr penv)
 
virtual ~PhysicsEngineBase ()
 
virtual bool SetPhysicsOptions (int physicsoptions)=0
 Set basic physics engine using the PhysicsEngineOptions enum.
 
virtual int GetPhysicsOptions () const =0
 
virtual bool SetPhysicsOptions (std::ostream &sout, std::istream &sinput) RAVE_DEPRECATED=0
 
virtual bool InitEnvironment ()=0
 called when environment sets this physics engine, engine assumes responsibility for KinBody::_pPhysicsData
 
virtual void DestroyEnvironment ()=0
 
virtual bool InitKinBody (KinBodyPtr body)=0
 notified when a new body has been initialized in the environment. Return
 
virtual void RemoveKinBody (KinBodyPtr body)=0
 notified when a body has been removed from the environment.
 
virtual bool SetLinkVelocity (KinBody::LinkPtr link, const Vector &linearvel, const Vector &angularvel)=0
 Force the body velocity of a link, velocities correspond to the link's coordinate system origin.
 
virtual bool SetLinkVelocities (KinBodyPtr body, const std::vector< std::pair< Vector, Vector > > &velocities)=0
 Sets the velocities for each link, velocities correspond to the link's coordinate system origin.
 
virtual bool GetLinkVelocity (KinBody::LinkConstPtr link, Vector &linearvel, Vector &angularvel)=0
 Gets the velocity of a link, velocities correspond to the link's coordinate system origin.
 
virtual bool GetLinkVelocities (KinBodyConstPtr body, std::vector< std::pair< Vector, Vector > > &velocities)=0
 Sets the velocities for each link, velocities correspond to the link's coordinate system origin.
 
virtual bool SetBodyForce (KinBody::LinkPtr link, const Vector &force, const Vector &position, bool bAdd) OPENRAVE_DUMMY_IMPLEMENTATION
 
virtual bool SetBodyTorque (KinBody::LinkPtr link, const Vector &torque, bool bAdd) OPENRAVE_DUMMY_IMPLEMENTATION
 
virtual bool AddJointTorque (KinBody::JointPtr pjoint, const std::vector< dReal > &pTorques) OPENRAVE_DUMMY_IMPLEMENTATION
 
virtual bool GetLinkForceTorque (KinBody::LinkConstPtr link, Vector &force, Vector &torque) OPENRAVE_DUMMY_IMPLEMENTATION
 
virtual void SetGravity (const Vector &gravity) OPENRAVE_DUMMY_IMPLEMENTATION
 set the gravity direction
 
virtual Vector GetGravity () OPENRAVE_DUMMY_IMPLEMENTATION
 
virtual void SimulateStep (dReal fTimeElapsed)=0
 
virtual bool GetBodyVelocity (KinBodyConstPtr body, std::vector< Vector > &vLinearVelocities, std::vector< Vector > &vAngularVelocities) RAVE_DEPRECATED
 
virtual bool SetBodyVelocity (KinBodyPtr body, const std::vector< Vector > &vLinearVelocities, const std::vector< Vector > &vAngularVelocities) RAVE_DEPRECATED
 
- Public Member Functions inherited from OpenRAVE::InterfaceBase
 InterfaceBase (InterfaceType type, EnvironmentBasePtr penv)
 
virtual ~InterfaceBase ()
 
InterfaceType GetInterfaceType () const
 
const std::string & GetXMLId () const
 
const std::string & GetPluginName () const
 
EnvironmentBasePtr GetEnv () const
 
const READERSMAPGetReadableInterfaces () const
 Returns the raw map reference, this is not multithread safe and the GetInterfaceMutex should be locked before using.
 
virtual XMLReadablePtr GetReadableInterface (const std::string &xmltag) const
 Returns the readable interface. [multi-thread safe]
 
virtual XMLReadablePtr SetReadableInterface (const std::string &xmltag, XMLReadablePtr readable)
 Set a new readable interface and return the previously set interface if it exists. [multi-thread safe]
 
virtual const std::string & GetDescription () const
 Documentation of the interface in reStructuredText format. See Documenting Interfaces. [multi-thread safe]
 
virtual void SetDescription (const std::string &description)
 sets a description [multi-thread safe]
 
virtual void SetUserData (const std::string &key, UserDataPtr data) const
 set user data for a specific key. [multi-thread safe]
 
virtual UserDataPtr GetUserData (const std::string &key=std::string()) const
 return the user custom data [multi-thread safe]
 
virtual bool RemoveUserData (const std::string &key) const
 removes a user data pointer. if user data pointer does not exist, then return 0, otherwise 1. [multi-thread safe]
 
virtual void SetUserData (UserDataPtr data) RAVE_DEPRECATED
 
virtual const std::string & GetURI () const
 the URI used to load the interface (sometimes this is not possible if the definition lies inside an environment file). [multi-thread safe]
 
virtual const std::string & GetXMLFilename () const
 
virtual void Clone (InterfaceBaseConstPtr preference, int cloningoptions)
 Clone the contents of an interface to the current interface.
 
virtual bool SendCommand (std::ostream &os, std::istream &is)
 Used to send special commands to the interface and receive output.
 
virtual void Serialize (BaseXMLWriterPtr writer, int options=0) const
 serializes the interface
 

Static Public Member Functions

static InterfaceType GetInterfaceTypeStatic ()
 return the static interface type this class points to (used for safe casting)
 

Protected Member Functions

virtual void SetPhysicsData (KinBodyPtr body, UserDataPtr data) RAVE_DEPRECATED
 
- Protected Member Functions inherited from OpenRAVE::InterfaceBase
virtual void RegisterCommand (const std::string &cmdname, InterfaceCommandFn fncmd, const std::string &strhelp)
 Registers a command and its help string. [multi-thread safe]
 
virtual void UnregisterCommand (const std::string &cmdname)
 Unregisters the command. [multi-thread safe]
 
virtual boost::shared_mutex & GetInterfaceMutex () const
 

Additional Inherited Members

- Public Types inherited from OpenRAVE::InterfaceBase
typedef std::map< std::string,
XMLReadablePtr,
CaseInsensitiveCompare
READERSMAP
 
- Protected Types inherited from OpenRAVE::InterfaceBase
typedef boost::function< bool(std::ostream
&, std::istream &)> 
InterfaceCommandFn
 The function to be executed for every command.
 
- Protected Attributes inherited from OpenRAVE::InterfaceBase
std::string __description
 

Detailed Description

[interface] The physics engine interfaces supporting simulations and dynamics. See Physics Engine Concepts.

Definition at line 36 of file physicsengine.h.

Constructor & Destructor Documentation

OpenRAVE::PhysicsEngineBase::PhysicsEngineBase ( EnvironmentBasePtr  penv)
inline

Definition at line 39 of file physicsengine.h.

virtual OpenRAVE::PhysicsEngineBase::~PhysicsEngineBase ( )
inlinevirtual

Definition at line 41 of file physicsengine.h.

Member Function Documentation

virtual bool OpenRAVE::PhysicsEngineBase::AddJointTorque ( KinBody::JointPtr  pjoint,
const std::vector< dReal > &  pTorques 
)
virtual

adds torque to a joint

Parameters
pjoint- the joint the torque is added to
pTorques- the torques added to the joint. Pointer because the joint dof can be greater than 1.
virtual void OpenRAVE::PhysicsEngineBase::DestroyEnvironment ( )
pure virtual

called when environment switches to a different physics engine has to clear/deallocate any memory associated with KinBody::_pPhysicsData

virtual bool OpenRAVE::PhysicsEngineBase::GetBodyVelocity ( KinBodyConstPtr  body,
std::vector< Vector > &  vLinearVelocities,
std::vector< Vector > &  vAngularVelocities 
)
inlinevirtual
Deprecated:
(10/11/18)

Definition at line 128 of file physicsengine.h.

virtual Vector OpenRAVE::PhysicsEngineBase::GetGravity ( )
virtual
static InterfaceType OpenRAVE::PhysicsEngineBase::GetInterfaceTypeStatic ( )
inlinestatic

return the static interface type this class points to (used for safe casting)

Definition at line 45 of file physicsengine.h.

virtual bool OpenRAVE::PhysicsEngineBase::GetLinkForceTorque ( KinBody::LinkConstPtr  link,
Vector force,
Vector torque 
)
virtual
Parameters
[in]linka constant pointer to a link
[out]forcecurrent force on the COM of the link
[out]torquecurrent torque on the COM of the link
virtual bool OpenRAVE::PhysicsEngineBase::GetLinkVelocities ( KinBodyConstPtr  body,
std::vector< std::pair< Vector, Vector > > &  velocities 
)
pure virtual

Sets the velocities for each link, velocities correspond to the link's coordinate system origin.

Parameters
[out]velocitiesthe linear and angular (axis * angular_speed) velocities for each link.
virtual bool OpenRAVE::PhysicsEngineBase::GetLinkVelocity ( KinBody::LinkConstPtr  link,
Vector linearvel,
Vector angularvel 
)
pure virtual

Gets the velocity of a link, velocities correspond to the link's coordinate system origin.

Parameters
[out]linearvel- linear velocity of base link
[out]angularvel- angular velocity rotation_axis*theta_dot
virtual int OpenRAVE::PhysicsEngineBase::GetPhysicsOptions ( ) const
pure virtual
virtual bool OpenRAVE::PhysicsEngineBase::InitEnvironment ( )
pure virtual

called when environment sets this physics engine, engine assumes responsibility for KinBody::_pPhysicsData

virtual bool OpenRAVE::PhysicsEngineBase::InitKinBody ( KinBodyPtr  body)
pure virtual

notified when a new body has been initialized in the environment. Return

virtual void OpenRAVE::PhysicsEngineBase::RemoveKinBody ( KinBodyPtr  body)
pure virtual

notified when a body has been removed from the environment.

virtual bool OpenRAVE::PhysicsEngineBase::SetBodyForce ( KinBody::LinkPtr  link,
const Vector force,
const Vector position,
bool  bAdd 
)
virtual

add a force at a particular position in a link

Parameters
forcethe direction and magnitude of the force
positionin the world where the force is getting applied
bAddif true, force is added to previous forces, otherwise it is set
virtual bool OpenRAVE::PhysicsEngineBase::SetBodyTorque ( KinBody::LinkPtr  link,
const Vector torque,
bool  bAdd 
)
virtual

adds torque to a body (absolute coords)

Parameters
linkthe link to add a torque to
torquetorque vector
bAddif true, torque is added to previous torques, otherwise it is set
virtual bool OpenRAVE::PhysicsEngineBase::SetBodyVelocity ( KinBodyPtr  body,
const std::vector< Vector > &  vLinearVelocities,
const std::vector< Vector > &  vAngularVelocities 
)
inlinevirtual

Definition at line 142 of file physicsengine.h.

virtual void OpenRAVE::PhysicsEngineBase::SetGravity ( const Vector gravity)
virtual

set the gravity direction

Parameters
[in]joint
[out]forcecurrent accumulated force on the COM of the link
[out]torquecurrent accumulated torque on the COM of the link
virtual bool OpenRAVE::PhysicsEngineBase::SetLinkVelocities ( KinBodyPtr  body,
const std::vector< std::pair< Vector, Vector > > &  velocities 
)
pure virtual

Sets the velocities for each link, velocities correspond to the link's coordinate system origin.

Parameters
[in]bodythe body to query velocities from.
[in]velocitiessets the linear and angular (axis * angular_speed) velocities for each link
virtual bool OpenRAVE::PhysicsEngineBase::SetLinkVelocity ( KinBody::LinkPtr  link,
const Vector linearvel,
const Vector angularvel 
)
pure virtual

Force the body velocity of a link, velocities correspond to the link's coordinate system origin.

Parameters
[in]linklink to set velocities.
[in]linearvellinear velocity of base link
[in]angularvelangular velocity rotation_axis*theta_dot
virtual void OpenRAVE::PhysicsEngineBase::SetPhysicsData ( KinBodyPtr  body,
UserDataPtr  data 
)
inlineprotectedvirtual
Deprecated:
(12/12/11)

Definition at line 154 of file physicsengine.h.

virtual bool OpenRAVE::PhysicsEngineBase::SetPhysicsOptions ( int  physicsoptions)
pure virtual

Set basic physics engine using the PhysicsEngineOptions enum.

virtual bool OpenRAVE::PhysicsEngineBase::SetPhysicsOptions ( std::ostream &  sout,
std::istream &  sinput 
)
pure virtual
Deprecated:
(10/11/18) use SendCommand instead
virtual void OpenRAVE::PhysicsEngineBase::SimulateStep ( dReal  fTimeElapsed)
pure virtual

dynamically simulate system for fTimeElapsed seconds add torques to the joints of the body. Torques disappear after one timestep of simulation


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