17 #ifndef _PHYSICSENGINE_HH_
18 #define _PHYSICSENGINE_HH_
20 #include <boost/thread/recursive_mutex.hpp>
22 #include <ignition/transport/Node.hh>
52 public:
virtual void Load(sdf::ElementPtr _sdf);
55 public:
virtual void Init() = 0;
58 public:
virtual void Fini();
64 public:
virtual void InitForThread() = 0;
67 public:
virtual void UpdateCollision() = 0;
71 public:
virtual std::string GetType()
const = 0;
75 public:
virtual void SetSeed(uint32_t _seed) = 0;
79 public:
double GetUpdatePeriod();
83 public:
double GetTargetRealTimeFactor()
const;
87 public:
double GetRealTimeUpdateRate()
const;
91 public:
double GetMaxStepSize()
const;
95 public:
void SetTargetRealTimeFactor(
double _factor);
99 public:
void SetRealTimeUpdateRate(
double _rate);
103 public:
void SetMaxStepSize(
double _stepSize);
120 const std::string &_shapeType,
LinkPtr _link) = 0;
125 public:
CollisionPtr CreateCollision(
const std::string &_shapeType,
126 const std::string &_linkName);
131 public:
virtual ShapePtr CreateShape(
const std::string &_shapeType,
137 public:
virtual JointPtr CreateJoint(
const std::string &_type,
148 public: virtual
void SetGravity(
153 public: virtual
void SetGravity(
154 const ignition::math::Vector3d &_gravity) = 0;
159 public: virtual ignition::math::Vector3d MagneticField() const
160 GAZEBO_DEPRECATED(8.0);
166 public: virtual
void SetAutoDisableFlag(
bool _autoDisable);
172 public: virtual
void SetMaxContacts(
unsigned int _maxContacts);
178 public: virtual
bool GetAutoDisableFlag() {
return 0;}
211 public:
virtual bool SetParam(
const std::string &_key,
212 const boost::any &_value);
218 public:
virtual boost::any GetParam(
const std::string &_key)
const;
225 public:
virtual bool GetParam(
const std::string &_key,
226 boost::any &_value)
const;
229 public:
virtual void DebugPrint()
const = 0;
242 {
return this->physicsUpdateMutex;}
246 public: sdf::ElementPtr GetSDF()
const;
250 protected:
virtual void OnRequest(ConstRequestPtr &_msg);
254 protected:
virtual void OnPhysicsMsg(ConstPhysicsPtr &_msg);
260 protected: sdf::ElementPtr
sdf;
boost::shared_ptr< Link > LinkPtr
Definition: PhysicsTypes.hh:109
sdf::ElementPtr sdf
Our SDF values.
Definition: PhysicsEngine.hh:260
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:89
ignition::transport::Node::Publisher responsePubIgn
Response publisher.
Definition: PhysicsEngine.hh:297
boost::recursive_mutex * GetPhysicsUpdateMutex() const
returns a pointer to the PhysicsEngine::physicsUpdateMutex.
Definition: PhysicsEngine.hh:241
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:44
ContactManager * contactManager
Class that handles all contacts generated by the physics engine.
Definition: PhysicsEngine.hh:279
Base class for a physics engine.
Definition: PhysicsEngine.hh:41
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:117
transport::SubscriberPtr physicsSub
Subscribe to the physics topic.
Definition: PhysicsEngine.hh:269
boost::shared_ptr< Node > NodePtr
Definition: TransportTypes.hh:57
transport::SubscriberPtr requestSub
Subscribe to the request topic.
Definition: PhysicsEngine.hh:272
default namespace for gazebo
virtual void Reset()
Rest the physics engine.
Definition: PhysicsEngine.hh:61
The world provides access to all other object within a simulated environment.
Definition: World.hh:81
double realTimeUpdateRate
Real time update rate.
Definition: PhysicsEngine.hh:282
WorldPtr world
Pointer to the world.
Definition: PhysicsEngine.hh:257
ignition::transport::Node nodeIgn
Ignition node for communication.
Definition: PhysicsEngine.hh:294
double targetRealTimeFactor
Target real time factor.
Definition: PhysicsEngine.hh:285
virtual void UpdatePhysics()
Update the physics engine.
Definition: PhysicsEngine.hh:106
transport::PublisherPtr responsePub
Response publisher.
Definition: PhysicsEngine.hh:266
#define GAZEBO_DEPRECATED(version)
Definition: system.hh:302
boost::shared_ptr< Shape > ShapePtr
Definition: PhysicsTypes.hh:141
boost::shared_ptr< Model > ModelPtr
Definition: PhysicsTypes.hh:93
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:275
double maxStepSize
Real time update rate.
Definition: PhysicsEngine.hh:288
transport::NodePtr node
Node for communication.
Definition: PhysicsEngine.hh:263
boost::shared_ptr< Collision > CollisionPtr
Definition: PhysicsTypes.hh:113
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:77