17 #ifndef _PHYSICSENGINE_HH_    18 #define _PHYSICSENGINE_HH_    20 #include <boost/thread/recursive_mutex.hpp>    51       public: 
virtual void Load(sdf::ElementPtr _sdf);
    54       public: 
virtual void Init() = 0;
    57       public: 
virtual void Fini();
    63       public: 
virtual void InitForThread() = 0;
    66       public: 
virtual void UpdateCollision() = 0;
    70       public: 
virtual std::string GetType() 
const = 0;
    74       public: 
virtual void SetSeed(uint32_t _seed) = 0;
    78       public: 
double GetUpdatePeriod();
    82       public: 
double GetTargetRealTimeFactor() 
const;
    86       public: 
double GetRealTimeUpdateRate() 
const;
    90       public: 
double GetMaxStepSize() 
const;
    94       public: 
void SetTargetRealTimeFactor(
double _factor);
    98       public: 
void SetRealTimeUpdateRate(
double _rate);
   102       public: 
void SetMaxStepSize(
double _stepSize);
   119                   const std::string &_shapeType, 
LinkPtr _link) = 0;
   124       public: 
CollisionPtr CreateCollision(
const std::string &_shapeType,
   125                                            const std::string &_linkName);
   130       public: 
virtual ShapePtr CreateShape(
const std::string &_shapeType,
   136       public: 
virtual JointPtr CreateJoint(
const std::string &_type,
   145       public: 
virtual void SetGravity(
   150       public: 
virtual ignition::math::Vector3d MagneticField() 
const;
   156       public: 
virtual void SetAutoDisableFlag(
bool _autoDisable);
   162       public: 
virtual void SetMaxContacts(
unsigned int _maxContacts);
   201       public: 
virtual bool SetParam(
const std::string &_key,
   202                   const boost::any &_value);
   208       public: 
virtual boost::any GetParam(
const std::string &_key) 
const;
   215       public: 
virtual bool GetParam(
const std::string &_key,
   216                   boost::any &_value) 
const;
   219       public: 
virtual void DebugPrint() 
const = 0;
   228               {
return this->physicsUpdateMutex;}
   232       public: sdf::ElementPtr GetSDF() 
const;
   236       protected: 
virtual void OnRequest(ConstRequestPtr &_msg);
   240       protected: 
virtual void OnPhysicsMsg(ConstPhysicsPtr &_msg);
   246       protected: sdf::ElementPtr 
sdf;
 boost::shared_ptr< Link > LinkPtr
Definition: PhysicsTypes.hh:100
 
sdf::ElementPtr sdf
Our SDF values. 
Definition: PhysicsEngine.hh:246
 
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:84
 
Forward declarations for the common classes. 
Definition: Animation.hh:33
 
The Vector3 class represents the generic vector containing 3 elements. 
Definition: Vector3.hh:39
 
ContactManager * contactManager
Class that handles all contacts generated by the physics engine. 
Definition: PhysicsEngine.hh:265
 
Base class for a physics engine. 
Definition: PhysicsEngine.hh:40
 
Forward declarations for transport. 
 
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:49
 
boost::shared_ptr< Subscriber > SubscriberPtr
Definition: TransportTypes.hh:53
 
boost::shared_ptr< Joint > JointPtr
Definition: PhysicsTypes.hh:108
 
transport::SubscriberPtr physicsSub
Subscribe to the physics topic. 
Definition: PhysicsEngine.hh:255
 
virtual bool GetAutoDisableFlag()
: Remove this function, and replace it with a more generic property map 
Definition: PhysicsEngine.hh:168
 
boost::shared_ptr< Node > NodePtr
Definition: TransportTypes.hh:57
 
transport::SubscriberPtr requestSub
Subscribe to the request topic. 
Definition: PhysicsEngine.hh:258
 
default namespace for gazebo 
 
virtual void Reset()
Rest the physics engine. 
Definition: PhysicsEngine.hh:60
 
double realTimeUpdateRate
Real time update rate. 
Definition: PhysicsEngine.hh:268
 
WorldPtr world
Pointer to the world. 
Definition: PhysicsEngine.hh:243
 
double targetRealTimeFactor
Target real time factor. 
Definition: PhysicsEngine.hh:271
 
virtual void UpdatePhysics()
Update the physics engine. 
Definition: PhysicsEngine.hh:105
 
transport::PublisherPtr responsePub
Response publisher. 
Definition: PhysicsEngine.hh:252
 
boost::shared_ptr< Shape > ShapePtr
Definition: PhysicsTypes.hh:132
 
boost::recursive_mutex * GetPhysicsUpdateMutex() const
returns a pointer to the PhysicsEngine::physicsUpdateMutex. 
Definition: PhysicsEngine.hh:227
 
boost::shared_ptr< Model > ModelPtr
Definition: PhysicsTypes.hh:88
 
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message. 
 
boost::recursive_mutex * physicsUpdateMutex
Mutex to protect the update cycle. 
Definition: PhysicsEngine.hh:261
 
double maxStepSize
Real time update rate. 
Definition: PhysicsEngine.hh:274
 
transport::NodePtr node
Node for communication. 
Definition: PhysicsEngine.hh:249
 
boost::shared_ptr< Collision > CollisionPtr
Definition: PhysicsTypes.hh:104
 
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:72