17#ifndef _ODEPHYSICS_HH_
18#define _ODEPHYSICS_HH_
21#include <tbb/spin_mutex.h>
22#include <tbb/concurrent_vector.h>
27#include <boost/thread/thread.hpp>
34#include "gazebo/gazebo_config.h"
41 class ODEJointFeedback;
42 class ODEPhysicsPrivate;
105 public:
virtual void Load(sdf::ElementPtr _sdf);
134 const std::string &_shapeType,
LinkPtr _parent);
145 public:
virtual void SetGravity(
const ignition::math::Vector3d &_gravity);
219 public:
virtual bool SetParam(
const std::string &_key,
220 const boost::any &_value);
223 public:
virtual boost::any
GetParam(
const std::string &_key)
const;
226 public:
virtual bool GetParam(
const std::string &_key,
227 boost::any &_value)
const;
252 public:
static Friction_Model
259 public:
static std::string
266 public:
static std::string
273 public:
static World_Solver_Type
290 dContactGeom *_contactCollisions);
296 protected:
virtual void OnRequest(ConstRequestPtr &_msg);
304 private:
static void CollisionCallback(
void *_data, dGeomID _o1,
311 private:
void AddTrimeshCollider(
ODECollision *_collision1,
322 private: ODEPhysicsPrivate *dataPtr;
ODE wrapper forward declarations and typedefs.
Base class for all ODE collisions.
Definition ODECollision.hh:41
ODE physics engine.
Definition ODEPhysics.hh:51
void ProcessJointFeedback(ODEJointFeedback *_feedback)
process joint feedbacks.
virtual bool GetParam(const std::string &_key, boost::any &_value) const
Documentation inherited.
virtual LinkPtr CreateLink(ModelPtr _parent)
Create a new body.
static World_Solver_Type ConvertWorldStepSolverType(const std::string &_solverType)
Convert a string to a World_Solver_Type enum.
virtual double GetSORPGSW()
virtual void SetWorldCFM(double cfm)
virtual void SetContactMaxCorrectingVel(double vel)
ODEParam
ODE Physics parameter types.
Definition ODEPhysics.hh:55
@ GLOBAL_CFM
Constraint force mixing.
Definition ODEPhysics.hh:60
@ INERTIA_RATIO_REDUCTION
Limit ratios of inertias of adjacent links (note that the corresponding SDF tag is "use_dynamic_moi_r...
Definition ODEPhysics.hh:88
@ GLOBAL_ERP
Error reduction parameter.
Definition ODEPhysics.hh:63
@ CONTACT_SURFACE_LAYER
Surface layer depth.
Definition ODEPhysics.hh:78
@ CONTACT_MAX_CORRECTING_VEL
Max correcting velocity.
Definition ODEPhysics.hh:75
@ PGS_ITERS
Number of iterations.
Definition ODEPhysics.hh:69
@ SOLVER_TYPE
Solve type.
Definition ODEPhysics.hh:57
@ MIN_STEP_SIZE
Minimum step size.
Definition ODEPhysics.hh:84
@ FRICTION_MODEL
friction model
Definition ODEPhysics.hh:91
@ WORLD_SOLVER_TYPE
LCP Solver.
Definition ODEPhysics.hh:94
@ MAX_CONTACTS
Maximum number of contacts.
Definition ODEPhysics.hh:81
@ SOR
SOR over-relaxation parameter.
Definition ODEPhysics.hh:72
@ SOR_PRECON_ITERS
Number of iterations.
Definition ODEPhysics.hh:66
static void ConvertMass(void *_odeMass, InertialPtr _inertial)
Convert an Inertial to ODE mass.
virtual void Fini()
Finilize the physics engine.
void Collide(ODECollision *_collision1, ODECollision *_collision2, dContactGeom *_contactCollisions)
Collide two collision objects.
dWorldID GetWorldId()
Get the world id.
virtual int GetSORPGSIters()
virtual void Init()
Initialize the physics engine.
ODEPhysics(WorldPtr _world)
Constructor.
virtual void Reset()
Rest the physics engine.
virtual ~ODEPhysics()
Destructor.
virtual void UpdateCollision()
Update the physics engine collision.
static std::string ConvertWorldStepSolverType(const World_Solver_Type _solverType)
Convert a World_Solver_Type enum to a string.
virtual void UpdatePhysics()
Update the physics engine.
virtual void OnRequest(ConstRequestPtr &_msg)
virtual callback for gztopic "~/request".
virtual void SetWorldERP(double erp)
virtual void SetMaxContacts(unsigned int max_contacts)
\TODO: Remove this function, and replace it with a more generic property map
virtual std::string GetWorldStepSolverType() const
Get solver type for world step.
virtual double GetWorldERP()
virtual void SetWorldStepSolverType(const std::string &_worldSolverType)
Set world step solver type.
virtual void SetSORPGSW(double w)
virtual ShapePtr CreateShape(const std::string &_shapeType, CollisionPtr _collision)
Create a physics::Shape object.
virtual void InitForThread()
Init the engine for threads.
virtual void SetSORPGSPreconIters(unsigned int iters)
static Friction_Model ConvertFrictionModel(const std::string &_fricModel)
Convert a string to a Friction_Model enum.
virtual std::string GetType() const
Return the physics engine type (ode|bullet|dart|simbody).
Definition ODEPhysics.hh:126
virtual void SetSORPGSIters(unsigned int iters)
virtual void OnPhysicsMsg(ConstPhysicsPtr &_msg)
virtual callback for gztopic "~/physics".
virtual void SetStepType(const std::string &_type)
Set the step type (quick, world).
virtual boost::any GetParam(const std::string &_key) const
Documentation inherited.
virtual void SetGravity(const ignition::math::Vector3d &_gravity)
Set the gravity vector.
static std::string ConvertFrictionModel(const Friction_Model _fricModel)
Convert a Friction_Model enum to a string.
virtual void DebugPrint() const
Debug print out of the physic engine state.
virtual void Load(sdf::ElementPtr _sdf)
Load the physics engine.
virtual double GetWorldCFM()
virtual bool SetParam(const std::string &_key, const boost::any &_value)
Documentation inherited.
virtual void SetSeed(uint32_t _seed)
Set the random number seed for the physics engine.
virtual void SetContactSurfaceLayer(double layer_depth)
virtual CollisionPtr CreateCollision(const std::string &_shapeType, LinkPtr _parent)
Create a collision.
virtual unsigned int GetMaxContacts()
virtual void SetFrictionModel(const std::string &_fricModel)
Set friction model type.
dSpaceID GetSpaceId() const
Return the world space id.
virtual double GetContactSurfaceLayer()
virtual JointPtr CreateJoint(const std::string &_type, ModelPtr _parent)
Create a new joint.
virtual double GetContactMaxCorrectingVel()
virtual std::string GetStepType() const
Get the step type (quick, world).
virtual int GetSORPGSPreconIters()
virtual std::string GetFrictionModel() const
Get friction model.
static void ConvertMass(InertialPtr _interial, void *_odeMass)
Convert an ODE mass to Inertial.
Base class for a physics engine.
Definition PhysicsEngine.hh:42
boost::shared_ptr< Link > LinkPtr
Definition PhysicsTypes.hh:109
boost::shared_ptr< Inertial > InertialPtr
Definition PhysicsTypes.hh:157
boost::shared_ptr< Collision > CollisionPtr
Definition PhysicsTypes.hh:113
boost::shared_ptr< Shape > ShapePtr
Definition PhysicsTypes.hh:141
boost::shared_ptr< World > WorldPtr
Definition PhysicsTypes.hh:89
boost::shared_ptr< Model > ModelPtr
Definition PhysicsTypes.hh:93
boost::shared_ptr< Joint > JointPtr
Definition PhysicsTypes.hh:117
Forward declarations for the common classes.
Definition Animation.hh:27