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"
102 public:
virtual void Load(sdf::ElementPtr _sdf);
105 public:
virtual void Init();
108 public:
virtual void Reset();
111 public:
virtual void InitForThread();
114 public:
virtual void UpdateCollision();
117 public:
virtual void UpdatePhysics();
120 public:
virtual void Fini();
131 const std::string &_shapeType,
LinkPtr _parent);
134 public:
virtual ShapePtr CreateShape(
const std::string &_shapeType,
138 public:
virtual JointPtr CreateJoint(
const std::string &_type,
145 public:
virtual void SetWorldCFM(
double cfm);
148 public:
virtual void SetWorldERP(
double erp);
151 public:
virtual void SetSORPGSPreconIters(
unsigned int iters);
154 public:
virtual void SetSORPGSIters(
unsigned int iters);
157 public:
virtual void SetSORPGSW(
double w);
160 public:
virtual void SetContactMaxCorrectingVel(
double vel);
163 public:
virtual void SetContactSurfaceLayer(
double layer_depth);
166 public:
virtual void SetMaxContacts(
unsigned int max_contacts);
169 public:
virtual double GetWorldCFM();
172 public:
virtual double GetWorldERP();
175 public:
virtual int GetSORPGSPreconIters();
178 public:
virtual int GetSORPGSIters();
181 public:
virtual double GetSORPGSW();
184 public:
virtual double GetContactMaxCorrectingVel();
187 public:
virtual double GetContactSurfaceLayer();
190 public:
virtual unsigned int GetMaxContacts();
193 public:
virtual void DebugPrint()
const;
196 public:
virtual void SetSeed(uint32_t _seed);
199 public:
virtual bool SetParam(
const std::string &_key,
200 const boost::any &_value);
203 public:
virtual boost::any GetParam(
const std::string &_key)
const;
207 public: dSpaceID GetSpaceId()
const;
211 public: dWorldID GetWorldId();
216 public:
static void ConvertMass(
InertialPtr _interial,
void *_odeMass);
222 public:
static void ConvertMass(
void *_odeMass,
InertialPtr _inertial);
226 public:
virtual std::string GetStepType()
const;
230 public:
virtual void SetStepType(
const std::string &_type);
238 dContactGeom *_contactCollisions);
244 protected:
virtual void OnRequest(ConstRequestPtr &_msg);
246 protected:
virtual void OnPhysicsMsg(ConstPhysicsPtr &_msg);
252 private:
static void CollisionCallback(
void *_data, dGeomID _o1,
259 private:
void AddTrimeshCollider(
ODECollision *_collision1,
269 private: dWorldID worldId;
272 private: dSpaceID spaceId;
275 private: dJointGroupID contactGroup;
278 private: std::string stepType;
281 private: std::vector<ODEJointFeedback*> jointFeedbacks;
284 private:
unsigned int jointFeedbackIndex;
287 private: std::map<std::string, dSpaceID> spaces;
290 private: std::vector< std::pair<ODECollision*, ODECollision*> > colliders;
293 private: std::vector< std::pair<ODECollision*, ODECollision*> >
297 private:
unsigned int collidersCount;
300 private:
unsigned int trimeshCollidersCount;
306 private: int (*physicsStepFunc)(dxWorld*, dReal);
312 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:123
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
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