Simbody physics engine. More...
#include <SimbodyPhysics.hh>
Inherits PhysicsEngine.
Public Member Functions | |
SimbodyPhysics (WorldPtr _world) | |
Constructor. More... | |
virtual | ~SimbodyPhysics () |
Destructor. More... | |
virtual CollisionPtr | CreateCollision (const std::string &_type, LinkPtr _body) |
Create a collision. More... | |
CollisionPtr | CreateCollision (const std::string &_shapeType, const std::string &_linkName) |
Create a collision. More... | |
virtual JointPtr | CreateJoint (const std::string &_type, ModelPtr _parent) |
Create a new joint. More... | |
virtual LinkPtr | CreateLink (ModelPtr _parent) |
Create a new body. More... | |
virtual ModelPtr | CreateModel (BasePtr _parent) |
Create a new model. More... | |
virtual ShapePtr | CreateShape (const std::string &_shapeType, CollisionPtr _collision) |
Create a physics::Shape object. More... | |
virtual void | DebugPrint () const |
Debug print out of the physic engine state. More... | |
virtual void | Fini () |
Finilize the physics engine. More... | |
virtual bool | GetAutoDisableFlag () |
: Remove this function, and replace it with a more generic property map More... | |
ContactManager * | GetContactManager () const |
Get a pointer to the contact manger. More... | |
SimTK::MultibodySystem * | GetDynamicsWorld () const |
Register a joint with the dynamics world. More... | |
virtual math::Vector3 | GetGravity () const |
Return the gravity vector. More... | |
double | GetMaxStepSize () const |
Get max step size. More... | |
virtual boost::any | GetParam (const std::string &_key) const |
Get an parameter of the physics engine. More... | |
virtual bool | GetParam (const std::string &_key, boost::any &_value) const |
Get a parameter from the physics engine with a boolean to indicate success or failure. More... | |
boost::recursive_mutex * | GetPhysicsUpdateMutex () const |
returns a pointer to the PhysicsEngine::physicsUpdateMutex. More... | |
double | GetRealTimeUpdateRate () const |
Get real time update rate. More... | |
sdf::ElementPtr | GetSDF () const |
Get a pointer to the SDF element for this physics engine. More... | |
double | GetTargetRealTimeFactor () const |
Get target real time factor. More... | |
virtual std::string | GetType () const |
Return the physics engine type (ode|bullet|dart|simbody). More... | |
double | GetUpdatePeriod () |
Get the simulation update period. More... | |
virtual void | Init () |
Initialize the physics engine. More... | |
virtual void | InitForThread () |
Init the engine for threads. More... | |
void | InitModel (const physics::ModelPtr _model) |
Add a Model to the Simbody system. More... | |
virtual void | Load (sdf::ElementPtr _sdf) |
Load the physics engine. More... | |
virtual ignition::math::Vector3d | MagneticField () const |
Return the magnetic field vector. More... | |
virtual void | Reset () |
Rest the physics engine. More... | |
virtual void | SetAutoDisableFlag (bool _autoDisable) |
: Remove this function, and replace it with a more generic property map More... | |
virtual void | SetGravity (const gazebo::math::Vector3 &_gravity) |
Set the gravity vector. More... | |
virtual void | SetMaxContacts (unsigned int _maxContacts) |
: Remove this function, and replace it with a more generic property map More... | |
void | SetMaxStepSize (double _stepSize) |
Set max step size. More... | |
virtual bool | SetParam (const std::string &_key, const boost::any &_value) |
Set a parameter of the physics engine. More... | |
void | SetRealTimeUpdateRate (double _rate) |
Set real time update rate. More... | |
virtual void | SetSeed (uint32_t _seed) |
Set the random number seed for the physics engine. More... | |
void | SetTargetRealTimeFactor (double _factor) |
Set target real time factor. More... | |
virtual void | UpdateCollision () |
Update the physics engine collision. More... | |
virtual void | UpdatePhysics () |
Update the physics engine. More... | |
WorldPtr | World () const |
Get a pointer to the world. More... | |
Static Public Member Functions | |
static SimTK::Transform | GetPose (sdf::ElementPtr _element) |
If the given element contains a <pose> element, return it as a Transform. More... | |
static std::string | GetTypeString (unsigned int _type) |
Convert Base::GetType() to string, this is needed by the MultibodyGraphMaker. More... | |
static std::string | GetTypeString (physics::Base::EntityType _type) |
Convert Base::GetType() to string, this is needed by the MultibodyGraphMaker. More... | |
static SimTK::Transform | Pose2Transform (const math::Pose &_pose) |
Convert the given pose in x,y,z,thetax,thetay,thetaz format to a Simbody Transform. More... | |
static SimTK::Quaternion | QuadToQuad (const math::Quaternion &_q) |
Convert gazebo::math::Quaternion to SimTK::Quaternion. More... | |
static math::Quaternion | QuadToQuad (const SimTK::Quaternion &_q) |
Convert SimTK::Quaternion to gazebo::math::Quaternion. More... | |
static math::Pose | Transform2Pose (const SimTK::Transform &_xAB) |
Convert a Simbody transform to a pose in x,y,z, thetax,thetay,thetaz format. More... | |
static math::Vector3 | Vec3ToVector3 (const SimTK::Vec3 &_v) |
Convert SimTK::Vec3 to gazebo::math::Vector3. More... | |
static SimTK::Vec3 | Vector3ToVec3 (const math::Vector3 &_v) |
Convert gazebo::math::Vector3 to SimTK::Vec3. More... | |
Public Attributes | |
SimTK::CompliantContactSubsystem | contact |
SimTK::Force::DiscreteForces | discreteForces |
SimTK::GeneralForceSubsystem | forces |
SimTK::Force::Gravity | gravity |
SimTK::Integrator * | integ |
SimTK::SimbodyMatterSubsystem | matter |
bool | simbodyPhysicsInitialized |
true if initialized More... | |
bool | simbodyPhysicsStepped |
SimTK::MultibodySystem | system |
SimTK::ContactTrackerSubsystem | tracker |
Protected Member Functions | |
virtual void | OnPhysicsMsg (ConstPhysicsPtr &_msg) |
virtual callback for gztopic "~/physics". More... | |
virtual void | OnRequest (ConstRequestPtr &_msg) |
virtual callback for gztopic "~/request". More... | |
Protected Attributes | |
ContactManager * | contactManager |
Class that handles all contacts generated by the physics engine. More... | |
double | maxStepSize |
Real time update rate. More... | |
transport::NodePtr | node |
Node for communication. More... | |
transport::SubscriberPtr | physicsSub |
Subscribe to the physics topic. More... | |
boost::recursive_mutex * | physicsUpdateMutex |
Mutex to protect the update cycle. More... | |
double | realTimeUpdateRate |
Real time update rate. More... | |
transport::SubscriberPtr | requestSub |
Subscribe to the request topic. More... | |
transport::PublisherPtr | responsePub |
Response publisher. More... | |
sdf::ElementPtr | sdf |
Our SDF values. More... | |
double | targetRealTimeFactor |
Target real time factor. More... | |
WorldPtr | world |
Pointer to the world. More... | |
Simbody physics engine.
SimbodyPhysics | ( | WorldPtr | _world | ) |
Constructor.
|
virtual |
Destructor.
|
virtual |
Create a collision.
[in] | _shapeType | Type of collision to create. |
[in] | _link | Parent link. |
Implements PhysicsEngine.
|
inherited |
Create a collision.
[in] | _shapeType | Type of collision to create. |
[in] | _linkName | Name of the parent link. |
Create a new joint.
[in] | _type | Type of joint to create. |
[in] | _parent | Model parent. |
Implements PhysicsEngine.
Create a new model.
[in] | _base | Boost shared pointer to a new model. |
Reimplemented from PhysicsEngine.
|
virtual |
Create a physics::Shape object.
[in] | _shapeType | Type of shape to create. |
[in] | _collision | Collision parent. |
Implements PhysicsEngine.
|
virtual |
Debug print out of the physic engine state.
Implements PhysicsEngine.
|
virtual |
Finilize the physics engine.
Reimplemented from PhysicsEngine.
|
inlinevirtualinherited |
: Remove this function, and replace it with a more generic property map
access functions to set ODE parameters..
|
inherited |
Get a pointer to the contact manger.
SimTK::MultibodySystem* GetDynamicsWorld | ( | ) | const |
Register a joint with the dynamics world.
|
virtualinherited |
Return the gravity vector.
|
inherited |
Get max step size.
|
virtual |
Get an parameter of the physics engine.
[in] | _attr | String key |
Reimplemented from PhysicsEngine.
|
virtual |
Get a parameter from the physics engine with a boolean to indicate success or failure.
[in] | _key | Key of the accessed param |
[out] | _value | Value of the accessed param |
Reimplemented from PhysicsEngine.
|
inlineinherited |
returns a pointer to the PhysicsEngine::physicsUpdateMutex.
References PhysicsEngine::physicsUpdateMutex.
|
static |
If the given element contains a <pose> element, return it as a Transform.
Otherwise return the identity Transform. If there is more than one <pose> element, only the first one is processed.
|
inherited |
Get real time update rate.
|
inherited |
Get a pointer to the SDF element for this physics engine.
|
inherited |
Get target real time factor.
|
virtual |
Return the physics engine type (ode|bullet|dart|simbody).
Implements PhysicsEngine.
|
static |
Convert Base::GetType() to string, this is needed by the MultibodyGraphMaker.
[in] | _type | Joint type returned by Joint::GetType(). |
|
static |
Convert Base::GetType() to string, this is needed by the MultibodyGraphMaker.
[in] | _type | Joint type returned by Joint::GetType(). |
|
inherited |
Get the simulation update period.
|
virtual |
Initialize the physics engine.
Implements PhysicsEngine.
|
virtual |
Init the engine for threads.
Implements PhysicsEngine.
void InitModel | ( | const physics::ModelPtr | _model | ) |
Add a Model to the Simbody system.
[in] | _model | Pointer to the model to add into Simbody. |
|
virtual |
Load the physics engine.
[in] | _sdf | Pointer to the SDF parameters. |
Reimplemented from PhysicsEngine.
|
virtualinherited |
Return the magnetic field vector.
|
protectedvirtual |
virtual callback for gztopic "~/physics".
[in] | _msg | Physics message. |
Reimplemented from PhysicsEngine.
|
protectedvirtual |
virtual callback for gztopic "~/request".
[in] | _msg | Request message. |
Reimplemented from PhysicsEngine.
|
static |
Convert the given pose in x,y,z,thetax,thetay,thetaz format to a Simbody Transform.
The rotation angles are interpreted as a body-fixed sequence, meaning we rotation about x, then about the new y, then about the now twice-rotated z.
[in] | _pose | Gazeb's math::Pose object |
|
static |
Convert gazebo::math::Quaternion to SimTK::Quaternion.
[in] | _q | Gazeb's math::Quaternion object |
|
static |
Convert SimTK::Quaternion to gazebo::math::Quaternion.
[in] | _q | Simbody's SimTK::Quaternion object |
|
virtual |
Rest the physics engine.
Reimplemented from PhysicsEngine.
|
virtualinherited |
: Remove this function, and replace it with a more generic property map
Access functions to set ODE parameters.
[in] | _autoDisable | True to enable auto disabling of bodies. |
|
virtual |
|
virtualinherited |
: Remove this function, and replace it with a more generic property map
access functions to set ODE parameters
[in] | _maxContacts | Maximum number of contacts. |
Reimplemented in ODEPhysics.
|
inherited |
Set max step size.
[in] | _stepSize | Max step size. |
|
virtual |
Set a parameter of the physics engine.
See SetParam documentation for descriptions of duplicate parameters.
[in] | _key | String key Below is a list of _key parameter definitions:
|
[in] | _value | The value to set to |
Reimplemented from PhysicsEngine.
|
inherited |
Set real time update rate.
[in] | _rate | Update rate |
|
virtual |
Set the random number seed for the physics engine.
[in] | _seed | The random number seed. |
Implements PhysicsEngine.
|
inherited |
Set target real time factor.
[in] | _factor | Target real time factor |
|
static |
Convert a Simbody transform to a pose in x,y,z, thetax,thetay,thetaz format.
[in] | _xAB | Simbody's SimTK::Transform object |
|
virtual |
Update the physics engine collision.
Implements PhysicsEngine.
|
virtual |
Update the physics engine.
Reimplemented from PhysicsEngine.
|
static |
Convert SimTK::Vec3 to gazebo::math::Vector3.
[in] | _v | Simbody's SimTK::Vec3 object |
|
static |
Convert gazebo::math::Vector3 to SimTK::Vec3.
[in] | _v | Gazeb's math::Vector3 object |
SimTK::CompliantContactSubsystem contact |
|
protectedinherited |
Class that handles all contacts generated by the physics engine.
SimTK::Force::DiscreteForces discreteForces |
SimTK::GeneralForceSubsystem forces |
SimTK::Force::Gravity gravity |
SimTK:: Integrator* integ |
SimTK::SimbodyMatterSubsystem matter |
|
protectedinherited |
Real time update rate.
|
protectedinherited |
Node for communication.
|
protectedinherited |
Subscribe to the physics topic.
|
protectedinherited |
Mutex to protect the update cycle.
Referenced by PhysicsEngine::GetPhysicsUpdateMutex().
|
protectedinherited |
Real time update rate.
|
protectedinherited |
Subscribe to the request topic.
|
protectedinherited |
Response publisher.
|
protectedinherited |
Our SDF values.
bool simbodyPhysicsInitialized |
true if initialized
bool simbodyPhysicsStepped |
SimTK::MultibodySystem system |
|
protectedinherited |
Target real time factor.
SimTK::ContactTrackerSubsystem tracker |
|
protectedinherited |
Pointer to the world.