RobWorkProject  24.6.21-
Public Types | Public Member Functions | Static Public Member Functions | List of all members
ODEBody Class Reference

a convienience class for bridging RWSim body states with ode body states. Properties of the objects such as MaterialID, collision reduction threshold is kept per instance. More...

#include <ODEBody.hpp>

Public Types

enum  ODEBodyType {
  FIXED , KINEMATIC , RIGID , RIGIDODE ,
  LINK , RigidDummy
}
 

Public Member Functions

 ODEBody (dBodyID odeBody, rw::kinematics::Frame *frame)
 constructor for rigid bodies More...
 
 ODEBody (dBodyID odeBody, rw::core::Ptr< rwsim::dynamics::RigidBody > rwbody, rw::math::Vector3D<> offset, int matID, int conID)
 constructor for rigid bodies More...
 
 ODEBody (dBodyID odeBody, dynamics::Body::Ptr body, rw::math::Vector3D<> offset, int matID, int conID, ODEBodyType type)
 constructor for user defined type, eg. body does not necesarilly need to by of RigidBody to create an ODEBody::RIGID More...
 
 ODEBody (dBodyID odeBody, rw::core::Ptr< rwsim::dynamics::KinematicBody > rwbody, int matID, int conID)
 constructor for kinematic bodies More...
 
 ODEBody (std::vector< dGeomID > geomId, dynamics::Body::Ptr body, int matID, int conID)
 constructor for fixed bodies More...
 
virtual ~ODEBody ()
 Destructor.
 
void update (const rwlibs::simulation::Simulator::UpdateInfo &dt, rw::kinematics::State &state)
 Called before collision checking and time stepping. More...
 
void postupdate (rw::kinematics::State &state)
 This method updates the state with state info of this ode object. Which means that ode states are converted to rw states. More...
 
void reset (const rw::kinematics::State &state)
 resets the ODE body to the values of the RW body More...
 
rwsim::dynamics::Body::Ptr getRwBody () const
 returns the RobWork Body
 
dBodyID getBodyID () const
 get the ODE bodyId
 
rw::math::Transform3D getTransform () const
 get transform from world to bodyframe
 
rw::math::Transform3D getTransformCOM () const
 get transform from world to COM
 
void setTransform (const rw::kinematics::State &state)
 set transform of body, using bodyframe
 
void setTransform (const rw::math::Transform3D<> &wTbody)
 set transform of body, using bodyframe
 
void setTransformCOM (const rw::math::Transform3D<> &wTcom)
 set transform of body, using COM
 
ODEBodyType getType () const
 get type of ODEBody
 
int getMaterialID ()
 get material id
 
int getContactID ()
 get contact model id
 
rw::kinematics::FramegetFrame ()
 get body frame
 
void setCRTThres (double crtthres)
 set contact reduction parameter
 
double getCRThres ()
 get contact reduction parameter
 
rw::math::Vector3D getLastForce ()
 
void bodyChangedListener (dynamics::Body::BodyEventType eventtype)
 
void setTriGeomData (std::vector< ODEUtil::TriGeomData * > &data)
 
std::vector< ODEUtil::TriGeomData * > & getTriGeomData ()
 

Static Public Member Functions

static ODEBodymakeRigidBody (dynamics::Body::Ptr rwbody, dSpaceID spaceId, ODESimulator *sim)
 Construct a rigid body. More...
 
static ODEBodymakeKinematicBody (dynamics::Body::Ptr kbody, dSpaceID spaceid, ODESimulator *sim)
 Construct a kinematic body. More...
 
static ODEBodymakeFixedBody (dynamics::Body::Ptr kbody, dSpaceID spaceid, ODESimulator *sim)
 Construct a fixed body. More...
 

Detailed Description

a convienience class for bridging RWSim body states with ode body states. Properties of the objects such as MaterialID, collision reduction threshold is kept per instance.

Member Enumeration Documentation

◆ ODEBodyType

this enum determines how and what the ODEBody maps from (ODE) and into (RW).

Enumerator
FIXED 

a fixed body

KINEMATIC 

a kinematic ode body and a kinematic RW body

RIGID 

a rigid ode body and a RigidBody RW

RIGIDODE 

a rigid ode body and a RW Body type (any other than RigidBody)

Constructor & Destructor Documentation

◆ ODEBody() [1/5]

ODEBody ( dBodyID  odeBody,
rw::kinematics::Frame frame 
)

constructor for rigid bodies

Parameters
odeBody[in] the id of the ode body.
frame[in] the body frame.

◆ ODEBody() [2/5]

ODEBody ( dBodyID  odeBody,
rw::core::Ptr< rwsim::dynamics::RigidBody rwbody,
rw::math::Vector3D<>  offset,
int  matID,
int  conID 
)

constructor for rigid bodies

Parameters
odeBody[in] the id of the ode body.
rwbody
offset[in] offset of the center of mass relative to rwbody
matID[in]
conID[in]

◆ ODEBody() [3/5]

ODEBody ( dBodyID  odeBody,
dynamics::Body::Ptr  body,
rw::math::Vector3D<>  offset,
int  matID,
int  conID,
ODEBodyType  type 
)

constructor for user defined type, eg. body does not necesarilly need to by of RigidBody to create an ODEBody::RIGID

Parameters
odeBody[in] the id of the ode body.
body
offset[in] offset of the center of mass relative to body
matID
conID
type

◆ ODEBody() [4/5]

ODEBody ( dBodyID  odeBody,
rw::core::Ptr< rwsim::dynamics::KinematicBody rwbody,
int  matID,
int  conID 
)

constructor for kinematic bodies

Parameters
odeBody[in]
rwbody
matID
conID

◆ ODEBody() [5/5]

ODEBody ( std::vector< dGeomID >  geomId,
dynamics::Body::Ptr  body,
int  matID,
int  conID 
)

constructor for fixed bodies

Parameters
geomId
body
matID
conID

Member Function Documentation

◆ makeFixedBody()

static ODEBody* makeFixedBody ( dynamics::Body::Ptr  kbody,
dSpaceID  spaceid,
ODESimulator sim 
)
static

Construct a fixed body.

Parameters
kbody[in] the RobWork body.
spaceid[in] the ODE space to construct body in.
sim[in] the ODE simulator.
Returns
a new ODEBody.

◆ makeKinematicBody()

static ODEBody* makeKinematicBody ( dynamics::Body::Ptr  kbody,
dSpaceID  spaceid,
ODESimulator sim 
)
static

Construct a kinematic body.

Parameters
kbody[in] the RobWork body.
spaceid[in] the ODE space to construct body in.
sim[in] the ODE simulator.
Returns
a new ODEBody.

◆ makeRigidBody()

static ODEBody* makeRigidBody ( dynamics::Body::Ptr  rwbody,
dSpaceID  spaceId,
ODESimulator sim 
)
static

Construct a rigid body.

Parameters
rwbody[in] the RobWork body.
spaceId[in] the ODE space to construct body in.
sim[in] the ODE simulator.
Returns
a new ODEBody.

◆ postupdate()

void postupdate ( rw::kinematics::State state)

This method updates the state with state info of this ode object. Which means that ode states are converted to rw states.

Parameters
state

◆ reset()

void reset ( const rw::kinematics::State state)

resets the ODE body to the values of the RW body

Parameters
state

◆ update()

void update ( const rwlibs::simulation::Simulator::UpdateInfo dt,
rw::kinematics::State state 
)

Called before collision checking and time stepping.

Parameters
dt[in] info related to the timestep.
state

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