28 #include <boost/function.hpp>
29 #include <boost/thread/recursive_mutex.hpp>
39 class recursive_mutex;
60 public:
virtual ~
Model();
64 public:
void Load(sdf::ElementPtr _sdf);
67 public:
void LoadJoints();
70 public:
virtual void Init();
73 public:
void Update();
76 public:
virtual void Fini();
80 public:
virtual void UpdateParameters(sdf::ElementPtr _sdf);
84 public:
virtual const sdf::ElementPtr GetSDF();
91 public:
virtual const sdf::ElementPtr UnscaledSDF();
95 public:
virtual void RemoveChild(
EntityPtr _child);
104 public:
void ResetPhysicsStates();
142 public:
virtual math::Vector3 GetRelativeLinearAccel()
const;
150 public:
virtual math::Vector3 GetRelativeAngularAccel()
const;
158 public:
virtual math::Box GetBoundingBox()
const;
162 public:
unsigned int GetJointCount()
const;
167 public:
ModelPtr NestedModel(
const std::string &_name)
const;
171 public:
const Model_V &NestedModels()
const;
176 public:
const Link_V &GetLinks()
const;
180 public:
const Joint_V &GetJoints()
const;
185 public:
JointPtr GetJoint(
const std::string &name);
191 public:
LinkPtr GetLinkById(
unsigned int _id)
const;
197 public:
LinkPtr GetLink(
const std::string &_name =
"canonical")
const;
206 public:
virtual bool GetSelfCollide()
const;
211 public:
virtual void SetSelfCollide(
bool _self_collide);
215 public:
void SetGravityMode(
const bool &_value);
221 public:
void SetCollideMode(
const std::string &_mode);
225 public:
void SetLaserRetro(
const float _retro);
229 public:
virtual void FillMsg(msgs::Model &_msg);
233 public:
void ProcessMsg(
const msgs::Model &_msg);
239 public:
void SetJointPosition(
const std::string &_jointName,
240 double _position,
int _index = 0);
245 public:
void SetJointPositions(
246 const std::map<std::string, double> &_jointPositions);
252 public:
void SetJointAnimation(
253 const std::map<std::string, common::NumericAnimationPtr> &_anims,
254 boost::function<
void()> _onComplete =
NULL);
257 public:
virtual void StopAnimation();
278 public:
void DetachStaticModel(
const std::string &_model);
282 public:
void SetState(
const ModelState &_state);
295 public:
void SetScale(
const ignition::math::Vector3d &_scale,
296 const bool _publish =
false);
302 public: ignition::math::Vector3d Scale()
const;
306 public:
void SetEnabled(
bool _enabled);
314 public:
void SetLinkWorldPose(
const math::Pose &_pose,
315 std::string _linkName);
323 public:
void SetLinkWorldPose(
const math::Pose &_pose,
329 public:
void SetAutoDisable(
bool _disable);
333 public:
bool GetAutoDisable()
const;
338 public:
void LoadPlugins();
342 public:
unsigned int GetPluginCount()
const;
347 public:
unsigned int GetSensorCount()
const;
355 public:
GripperPtr GetGripper(
size_t _index)
const;
360 public:
size_t GetGripperCount()
const;
365 public:
double GetWorldEnergyPotential()
const;
371 public:
double GetWorldEnergyKinetic()
const;
377 public:
double GetWorldEnergy()
const;
389 const std::string &_name,
const std::string &_type,
395 public:
bool RemoveJoint(
const std::string &_name);
399 public:
virtual void SetWindMode(
const bool _mode);
403 public:
virtual bool WindMode()
const;
407 public: boost::shared_ptr<Model> shared_from_this();
413 public:
LinkPtr CreateLink(
const std::string &_name);
416 protected:
virtual void OnPoseChange();
419 private:
void LoadLinks();
422 private:
void LoadModels();
426 private:
void LoadJoint(sdf::ElementPtr _sdf);
430 private:
void LoadPlugin(sdf::ElementPtr _sdf);
434 private:
void LoadGripper(sdf::ElementPtr _sdf);
439 private:
void RemoveLink(
const std::string &_name);
442 private:
virtual void PublishScale();
454 private:
LinkPtr canonicalLink;
466 private: std::vector<GripperPtr> grippers;
469 private: std::vector<ModelPluginPtr> plugins;
472 private: std::map<std::string, common::NumericAnimationPtr>
476 private: boost::function<void()> onJointAnimationComplete;
479 private:
mutable boost::recursive_mutex updateMutex;
boost::shared_ptr< Link > LinkPtr
Definition: PhysicsTypes.hh:109
std::vector< ModelPtr > Model_V
Definition: PhysicsTypes.hh:205
Encapsulates a position and rotation in three space.
Definition: Pose.hh:37
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:39
Mathematical representation of a box and related functions.
Definition: Box.hh:35
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:49
#define GAZEBO_DEPRECATED(version)
Definition: CommonTypes.hh:48
boost::shared_ptr< Joint > JointPtr
Definition: PhysicsTypes.hh:117
std::vector< math::Pose > attachedModelsOffset
used by Model::AttachStaticModel
Definition: Model.hh:448
virtual void RemoveChild(unsigned int _id)
Remove a child from this entity.
std::vector< ModelPtr > attachedModels
used by Model::AttachStaticModel
Definition: Model.hh:445
default namespace for gazebo
A model is a collection of links, joints, and plugins.
Definition: Model.hh:53
transport::PublisherPtr jointPub
Publisher for joint info.
Definition: Model.hh:451
boost::shared_ptr< Gripper > GripperPtr
Definition: PhysicsTypes.hh:197
std::vector< JointPtr > Joint_V
Definition: PhysicsTypes.hh:213
#define NULL
Definition: CommonTypes.hh:31
Base class for all physics objects in Gazebo.
Definition: Entity.hh:58
boost::shared_ptr< Entity > EntityPtr
Definition: PhysicsTypes.hh:85
boost::shared_ptr< JointController > JointControllerPtr
Definition: PhysicsTypes.hh:121
boost::shared_ptr< Model > ModelPtr
Definition: PhysicsTypes.hh:93
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
virtual void Reset()
Reset the entity.
Store state information of a physics::Model object.
Definition: ModelState.hh:48
std::vector< LinkPtr > Link_V
Definition: PhysicsTypes.hh:225
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:77