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;
103 public:
virtual void Load(sdf::ElementPtr _sdf);
106 public:
virtual void Init();
109 public:
virtual void Reset();
112 public:
virtual void InitForThread();
115 public:
virtual void UpdateCollision();
118 public:
virtual void UpdatePhysics();
121 public:
virtual void Fini();
132 const std::string &_shapeType,
LinkPtr _parent);
135 public:
virtual ShapePtr CreateShape(
const std::string &_shapeType,
139 public:
virtual JointPtr CreateJoint(
const std::string &_type,
143 public:
virtual void SetGravity(
const ignition::math::Vector3d &_gravity);
146 public:
virtual void SetWorldCFM(
double cfm);
149 public:
virtual void SetWorldERP(
double erp);
152 public:
virtual void SetSORPGSPreconIters(
unsigned int iters);
155 public:
virtual void SetSORPGSIters(
unsigned int iters);
158 public:
virtual void SetSORPGSW(
double w);
161 public:
virtual void SetContactMaxCorrectingVel(
double vel);
164 public:
virtual void SetContactSurfaceLayer(
double layer_depth);
168 public:
virtual void SetFrictionModel(
const std::string &_fricModel);
173 SetWorldStepSolverType(
const std::string &_worldSolverType);
176 public:
virtual void SetMaxContacts(
unsigned int max_contacts);
179 public:
virtual double GetWorldCFM();
182 public:
virtual double GetWorldERP();
185 public:
virtual int GetSORPGSPreconIters();
188 public:
virtual int GetSORPGSIters();
191 public:
virtual double GetSORPGSW();
194 public:
virtual double GetContactMaxCorrectingVel();
198 public:
virtual std::string GetFrictionModel()
const;
202 public:
virtual std::string GetWorldStepSolverType()
const;
205 public:
virtual double GetContactSurfaceLayer();
208 public:
virtual unsigned int GetMaxContacts();
211 public:
virtual void DebugPrint()
const;
214 public:
virtual void SetSeed(uint32_t _seed);
217 public:
virtual bool SetParam(
const std::string &_key,
218 const boost::any &_value);
221 public:
virtual boost::any GetParam(
const std::string &_key)
const;
224 public:
virtual bool GetParam(
const std::string &_key,
225 boost::any &_value)
const;
229 public: dSpaceID GetSpaceId()
const;
233 public: dWorldID GetWorldId();
238 public:
static void ConvertMass(
InertialPtr _interial,
void *_odeMass);
244 public:
static void ConvertMass(
void *_odeMass,
InertialPtr _inertial);
250 public:
static Friction_Model
251 ConvertFrictionModel(
const std::string &_fricModel);
257 public:
static std::string
258 ConvertFrictionModel(
const Friction_Model _fricModel);
264 public:
static std::string
265 ConvertWorldStepSolverType(
const World_Solver_Type _solverType);
271 public:
static World_Solver_Type
272 ConvertWorldStepSolverType(
const std::string &_solverType);
276 public:
virtual std::string GetStepType()
const;
280 public:
virtual void SetStepType(
const std::string &_type);
288 dContactGeom *_contactCollisions);
292 public:
void ProcessJointFeedback(ODEJointFeedback *_feedback);
294 protected:
virtual void OnRequest(ConstRequestPtr &_msg);
296 protected:
virtual void OnPhysicsMsg(ConstPhysicsPtr &_msg);
302 private:
static void CollisionCallback(
void *_data, dGeomID _o1,
309 private:
void AddTrimeshCollider(
ODECollision *_collision1,
320 private: ODEPhysicsPrivate *dataPtr;
boost::shared_ptr< Link > LinkPtr
Definition: PhysicsTypes.hh:110
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:90
Constraint force mixing.
Definition: ODEPhysics.hh:58
Forward declarations for the common classes.
Definition: Animation.hh:26
Minimum step size.
Definition: ODEPhysics.hh:82
Base class for all ODE collisions.
Definition: ODECollision.hh:40
Base class for a physics engine.
Definition: PhysicsEngine.hh:42
Limit ratios of inertias of adjacent links (note that the corresponding SDF tag is "use_dynamic_moi_r...
Definition: ODEPhysics.hh:86
virtual std::string GetType() const
Return the physics engine type (ode|bullet|dart|simbody).
Definition: ODEPhysics.hh:124
boost::shared_ptr< Joint > JointPtr
Definition: PhysicsTypes.hh:118
ODE physics engine.
Definition: ODEPhysics.hh:48
ODEParam
ODE Physics parameter types.
Definition: ODEPhysics.hh:52
Surface layer depth.
Definition: ODEPhysics.hh:76
SOR over-relaxation parameter.
Definition: ODEPhysics.hh:70
Error reduction parameter.
Definition: ODEPhysics.hh:61
friction model
Definition: ODEPhysics.hh:89
Number of iterations.
Definition: ODEPhysics.hh:64
boost::shared_ptr< Inertial > InertialPtr
Definition: PhysicsTypes.hh:158
Number of iterations.
Definition: ODEPhysics.hh:67
ODE wrapper forward declarations and typedefs.
boost::shared_ptr< Shape > ShapePtr
Definition: PhysicsTypes.hh:142
Max correcting velocity.
Definition: ODEPhysics.hh:73
boost::shared_ptr< Model > ModelPtr
Definition: PhysicsTypes.hh:94
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
Maximum number of contacts.
Definition: ODEPhysics.hh:79
boost::shared_ptr< Collision > CollisionPtr
Definition: PhysicsTypes.hh:114
Solve type.
Definition: ODEPhysics.hh:55