17 #ifndef _ODEPHYSICS_HH_
18 #define _ODEPHYSICS_HH_
20 #include <tbb/spin_mutex.h>
21 #include <tbb/concurrent_vector.h>
25 #include <boost/thread/thread.hpp>
32 #include "gazebo/gazebo_config.h"
39 class ODEJointFeedback;
40 class ODEPhysicsPrivate;
98 public:
virtual void Load(sdf::ElementPtr _sdf);
101 public:
virtual void Init();
104 public:
virtual void Reset();
107 public:
virtual void InitForThread();
110 public:
virtual void UpdateCollision();
113 public:
virtual void UpdatePhysics();
116 public:
virtual void Fini();
127 const std::string &_shapeType,
LinkPtr _parent);
130 public:
virtual ShapePtr CreateShape(
const std::string &_shapeType,
134 public:
virtual JointPtr CreateJoint(
const std::string &_type,
141 public:
virtual void SetWorldCFM(
double cfm);
144 public:
virtual void SetWorldERP(
double erp);
147 public:
virtual void SetSORPGSPreconIters(
unsigned int iters);
150 public:
virtual void SetSORPGSIters(
unsigned int iters);
153 public:
virtual void SetSORPGSW(
double w);
156 public:
virtual void SetContactMaxCorrectingVel(
double vel);
159 public:
virtual void SetContactSurfaceLayer(
double layer_depth);
163 public:
virtual void SetFrictionModel(
const std::string &_fricModel);
168 SetWorldStepSolverType(
const std::string &_worldSolverType);
171 public:
virtual void SetMaxContacts(
unsigned int max_contacts);
174 public:
virtual double GetWorldCFM();
177 public:
virtual double GetWorldERP();
180 public:
virtual int GetSORPGSPreconIters();
183 public:
virtual int GetSORPGSIters();
186 public:
virtual double GetSORPGSW();
189 public:
virtual double GetContactMaxCorrectingVel();
193 public:
virtual std::string GetFrictionModel()
const;
197 public:
virtual std::string GetWorldStepSolverType()
const;
200 public:
virtual double GetContactSurfaceLayer();
203 public:
virtual unsigned int GetMaxContacts();
206 public:
virtual void DebugPrint()
const;
209 public:
virtual void SetSeed(uint32_t _seed);
212 public:
virtual bool SetParam(
const std::string &_key,
213 const boost::any &_value);
216 public:
virtual boost::any GetParam(
const std::string &_key)
const;
219 public:
virtual bool GetParam(
const std::string &_key,
220 boost::any &_value)
const;
224 public: dSpaceID GetSpaceId()
const;
228 public: dWorldID GetWorldId();
233 public:
static void ConvertMass(
InertialPtr _interial,
void *_odeMass);
239 public:
static void ConvertMass(
void *_odeMass,
InertialPtr _inertial);
245 public:
static Friction_Model
246 ConvertFrictionModel(
const std::string &_fricModel);
252 public:
static std::string
253 ConvertFrictionModel(
const Friction_Model _fricModel);
259 public:
static std::string
260 ConvertWorldStepSolverType(
const World_Solver_Type _solverType);
266 public:
static World_Solver_Type
267 ConvertWorldStepSolverType(
const std::string &_solverType);
271 public:
virtual std::string GetStepType()
const;
275 public:
virtual void SetStepType(
const std::string &_type);
283 dContactGeom *_contactCollisions);
289 protected:
virtual void OnRequest(ConstRequestPtr &_msg);
291 protected:
virtual void OnPhysicsMsg(ConstPhysicsPtr &_msg);
297 private:
static void CollisionCallback(
void *_data, dGeomID _o1,
304 private:
void AddTrimeshCollider(
ODECollision *_collision1,
boost::shared_ptr< Model > ModelPtr
Definition: PhysicsTypes.hh:84
Limit ratios of inertias of adjacent links (note that the corresponding SDF tag is "use_dynamic_moi_r...
Definition: ODEPhysics.hh:81
virtual std::string GetType() const
Return the physics engine type (ode|bullet|dart|simbody).
Definition: ODEPhysics.hh:119
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:39
Constraint force mixing.
Definition: ODEPhysics.hh:53
Base class for all ODE collisions.
Definition: ODECollision.hh:39
boost::shared_ptr< Shape > ShapePtr
Definition: PhysicsTypes.hh:116
boost::shared_ptr< Inertial > InertialPtr
Definition: PhysicsTypes.hh:132
Base class for a physics engine.
Definition: PhysicsEngine.hh:40
Data structure for contact feedbacks.
Definition: ODEPhysicsPrivate.hh:34
#define GZ_PHYSICS_ODE_VISIBLE
Definition: system.hh:343
Error reduction parameter.
Definition: ODEPhysics.hh:56
ODE physics engine.
Definition: ODEPhysics.hh:43
Minimum step size.
Definition: ODEPhysics.hh:77
Number of iterations.
Definition: ODEPhysics.hh:59
boost::shared_ptr< Collision > CollisionPtr
Definition: PhysicsTypes.hh:96
Definition: ODEPhysicsPrivate.hh:48
SOR over-relaxation parameter.
Definition: ODEPhysics.hh:65
Number of iterations.
Definition: ODEPhysics.hh:62
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:80
boost::shared_ptr< Joint > JointPtr
Definition: PhysicsTypes.hh:100
Max correcting velocity.
Definition: ODEPhysics.hh:68
ODE wrapper forward declarations and typedefs.
friction model
Definition: ODEPhysics.hh:84
Maximum number of contacts.
Definition: ODEPhysics.hh:74
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
Solve type.
Definition: ODEPhysics.hh:50
Surface layer depth.
Definition: ODEPhysics.hh:71
ODEParam
ODE Physics parameter types.
Definition: ODEPhysics.hh:47
boost::shared_ptr< Link > LinkPtr
Definition: PhysicsTypes.hh:92