17 #ifndef _ODEPHYSICS_HH_
18 #define _ODEPHYSICS_HH_
20 #include <tbb/spin_mutex.h>
21 #include <tbb/concurrent_vector.h>
27 #include <boost/thread/thread.hpp>
34 #include "gazebo/gazebo_config.h"
95 INERTIA_RATIO_REDUCTION
106 public:
virtual void Load(sdf::ElementPtr _sdf);
109 public:
virtual void Init();
112 public:
virtual void Reset();
115 public:
virtual void InitForThread();
118 public:
virtual void UpdateCollision();
121 public:
virtual void UpdatePhysics();
124 public:
virtual void Fini();
135 const std::string &_shapeType,
LinkPtr _parent);
138 public:
virtual ShapePtr CreateShape(
const std::string &_shapeType,
142 public:
virtual JointPtr CreateJoint(
const std::string &_type,
149 public:
virtual void SetWorldCFM(
double cfm);
152 public:
virtual void SetWorldERP(
double erp);
155 public:
virtual void SetSORPGSPreconIters(
unsigned int iters);
158 public:
virtual void SetSORPGSIters(
unsigned int iters);
161 public:
virtual void SetSORPGSW(
double w);
164 public:
virtual void SetContactMaxCorrectingVel(
double vel);
167 public:
virtual void SetContactSurfaceLayer(
double layer_depth);
170 public:
virtual void SetMaxContacts(
unsigned int max_contacts);
173 public:
virtual double GetWorldCFM();
176 public:
virtual double GetWorldERP();
179 public:
virtual int GetSORPGSPreconIters();
182 public:
virtual int GetSORPGSIters();
185 public:
virtual double GetSORPGSW();
188 public:
virtual double GetContactMaxCorrectingVel();
191 public:
virtual double GetContactSurfaceLayer();
194 public:
virtual unsigned int GetMaxContacts();
197 public:
virtual void DebugPrint()
const;
200 public:
virtual void SetSeed(uint32_t _seed);
203 public:
virtual bool SetParam(
const std::string &_key,
204 const boost::any &_value);
207 public:
virtual boost::any GetParam(
const std::string &_key)
const;
211 public: dSpaceID GetSpaceId()
const;
215 public: dWorldID GetWorldId();
220 public:
static void ConvertMass(
InertialPtr _interial,
void *_odeMass);
226 public:
static void ConvertMass(
void *_odeMass,
InertialPtr _inertial);
230 public:
virtual std::string GetStepType()
const;
234 public:
virtual void SetStepType(
const std::string &_type);
242 dContactGeom *_contactCollisions);
248 protected:
virtual void OnRequest(ConstRequestPtr &_msg);
250 protected:
virtual void OnPhysicsMsg(ConstPhysicsPtr &_msg);
256 private:
static void CollisionCallback(
void *_data, dGeomID _o1,
263 private:
void AddTrimeshCollider(
ODECollision *_collision1,
273 private: dWorldID worldId;
276 private: dSpaceID spaceId;
279 private: dJointGroupID contactGroup;
282 private: std::string stepType;
285 private: std::vector<ODEJointFeedback*> jointFeedbacks;
288 private:
unsigned int jointFeedbackIndex;
291 private: std::map<std::string, dSpaceID> spaces;
294 private: std::vector< std::pair<ODECollision*, ODECollision*> > colliders;
297 private: std::vector< std::pair<ODECollision*, ODECollision*> >
301 private:
unsigned int collidersCount;
304 private:
unsigned int trimeshCollidersCount;
310 private: int (*physicsStepFunc)(dxWorld*, dReal);
316 private:
unsigned int maxContacts;
boost::shared_ptr< Model > ModelPtr
Definition: PhysicsTypes.hh:82
ODEJointFeedback()
Definition: ODEPhysics.hh:44
virtual std::string GetType() const
Return the physics engine type (ode|bullet|dart|simbody).
Definition: ODEPhysics.hh:127
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:43
Constraint force mixing.
Definition: ODEPhysics.hh:67
Base class for all ODE collisions.
Definition: ODECollision.hh:39
boost::shared_ptr< Shape > ShapePtr
Definition: PhysicsTypes.hh:110
boost::shared_ptr< Inertial > InertialPtr
Definition: PhysicsTypes.hh:126
Base class for a physics engine.
Definition: PhysicsEngine.hh:40
Data structure for contact feedbacks.
Definition: ODEPhysics.hh:42
Error reduction parameter.
Definition: ODEPhysics.hh:70
ODE physics engine.
Definition: ODEPhysics.hh:57
Minimum step size.
Definition: ODEPhysics.hh:91
Number of iterations.
Definition: ODEPhysics.hh:73
boost::shared_ptr< Collision > CollisionPtr
Definition: PhysicsTypes.hh:94
SOR over-relaxation parameter.
Definition: ODEPhysics.hh:79
Number of iterations.
Definition: ODEPhysics.hh:76
int count
Number of elements in feedbacks array.
Definition: ODEPhysics.hh:50
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:78
boost::shared_ptr< Joint > JointPtr
Definition: PhysicsTypes.hh:98
#define NULL
Definition: CommonTypes.hh:30
Max correcting velocity.
Definition: ODEPhysics.hh:82
ODE wrapper forward declarations and typedefs.
Maximum number of contacts.
Definition: ODEPhysics.hh:88
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
Solve type.
Definition: ODEPhysics.hh:64
Contact * contact
Contact information.
Definition: ODEPhysics.hh:47
Surface layer depth.
Definition: ODEPhysics.hh:85
ODEParam
ODE Physics parameter types.
Definition: ODEPhysics.hh:61
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48
boost::shared_ptr< Link > LinkPtr
Definition: PhysicsTypes.hh:90