75 public:
virtual ~
Link();
79 public:
virtual void Load(sdf::ElementPtr _sdf);
82 public:
virtual void Init();
91 public:
void ResetPhysicsStates();
95 public:
virtual void UpdateParameters(sdf::ElementPtr _sdf);
108 public:
virtual void SetEnabled(
bool _enable)
const = 0;
112 public:
virtual bool GetEnabled()
const = 0;
117 public:
virtual bool SetSelected(
bool _set);
121 public:
virtual void SetGravityMode(
bool _mode) = 0;
125 public:
virtual bool GetGravityMode()
const = 0;
131 public:
virtual void SetSelfCollide(
bool _collide) = 0;
141 public:
void SetCollideMode(
const std::string &_mode);
150 public:
bool GetSelfCollide()
const;
154 public:
void SetLaserRetro(
float _retro);
158 public:
virtual void SetLinearVel(
const math::Vector3 &_vel) = 0;
162 public:
virtual void SetAngularVel(
const math::Vector3 &_vel) = 0;
174 public:
virtual void SetForce(
const math::Vector3 &_force) = 0;
178 public:
virtual void SetTorque(
const math::Vector3 &_torque) = 0;
182 public:
virtual void AddForce(
const math::Vector3 &_force) = 0;
187 public:
virtual void AddRelativeForce(
const math::Vector3 &_force) = 0;
192 public:
virtual void AddForceAtWorldPosition(
const math::Vector3 &_force,
199 public:
virtual void AddForceAtRelativePosition(
209 public:
virtual void AddLinkForce(
const math::Vector3 &_force,
214 public:
virtual void AddTorque(
const math::Vector3 &_torque) = 0;
219 public:
virtual void AddRelativeTorque(
const math::Vector3 &_torque) = 0;
258 public:
virtual math::Vector3 GetWorldCoGLinearVel()
const = 0;
322 public:
void SetInertial(
const InertialPtr &_inertial);
329 public:
math::Pose GetWorldInertialPose()
const;
341 public:
CollisionPtr GetCollisionById(
unsigned int _id)
const;
347 public:
CollisionPtr GetCollision(
const std::string &_name);
352 public:
CollisionPtr GetCollision(
unsigned int _index)
const;
361 public:
virtual math::Box GetBoundingBox()
const;
365 public:
virtual void SetLinearDamping(
double _damping) = 0;
369 public:
virtual void SetAngularDamping(
double _damping) = 0;
373 public:
double GetLinearDamping()
const;
377 public:
double GetAngularDamping()
const;
382 public:
virtual void SetKinematic(
const bool &_kinematic);
395 public:
unsigned int GetSensorCount()
const;
408 public: std::string GetSensorName(
unsigned int _index)
const;
413 public:
template<
typename T>
415 {
return enabledSignal.Connect(_subscriber);}
420 {enabledSignal.Disconnect(_conn);}
424 public:
void FillMsg(msgs::Link &_msg);
428 public:
void ProcessMsg(
const msgs::Link &_msg);
432 public:
void AddChildJoint(
JointPtr _joint);
436 public:
void AddParentJoint(
JointPtr _joint);
440 public:
void RemoveParentJoint(
const std::string &_jointName);
444 public:
void RemoveChildJoint(
const std::string &_jointName);
447 public:
virtual void RemoveChild(
EntityPtr _child);
448 using Base::RemoveChild;
453 public:
void AttachStaticModel(
ModelPtr &_model,
458 public:
void DetachStaticModel(
const std::string &_modelName);
461 public:
void DetachAllStaticModels();
465 public:
virtual void OnPoseChange();
469 public:
void SetState(
const LinkState &_state);
479 public:
virtual void SetAutoDisable(
bool _disable) = 0;
483 public:
Link_V GetChildJointsLinks()
const;
487 public:
Link_V GetParentJointsLinks()
const;
491 public:
void SetPublishData(
bool _enable);
494 public:
Joint_V GetParentJoints()
const;
497 public:
Joint_V GetChildJoints()
const;
501 public:
void RemoveCollision(
const std::string &_name);
506 public:
double GetWorldEnergyPotential()
const;
511 public:
double GetWorldEnergyKinetic()
const;
517 public:
double GetWorldEnergy()
const;
522 public: msgs::Visual GetVisualMessage(
const std::string &_name)
const;
527 public:
virtual void SetLinkStatic(
bool _static) = 0;
537 public:
void MoveFrame(
const math::Pose &_worldReferenceFrameSrc,
554 public:
bool FindAllConnectedLinksHelper(
555 const LinkPtr &_originalParentLink,
556 Link_V &_connectedLinks,
bool _fistLink =
false);
570 public:
size_t BatteryCount()
const;
576 public:
bool VisualId(
const std::string &_visName, uint32_t &_visualId)
583 public:
bool VisualPose(
const uint32_t _id,
584 ignition::math::Pose3d &_pose)
const;
590 public:
bool SetVisualPose(
const uint32_t _id,
591 const ignition::math::Pose3d &_pose);
594 private:
void PublishData();
598 private:
void LoadCollision(sdf::ElementPtr _sdf);
602 private:
void SetInertialFromCollisions();
606 private:
void OnCollision(ConstContactsPtr &_msg);
609 private:
void ParseVisuals();
615 private:
bool ContainsLink(
const Link_V &_vector,
const LinkPtr &_value);
619 private:
void UpdateVisualGeomSDF(
const math::Vector3 &_scale);
622 private:
void UpdateVisualMsg();
627 private:
void OnWrenchMsg(ConstWrenchPtr &_msg);
631 private:
void ProcessWrenchMsg(
const msgs::Wrench &_msg);
635 private:
void LoadBattery(
const sdf::ElementPtr _sdf);
668 private:
bool enabled;
671 private: std::vector<std::string> sensors;
674 private: std::vector<JointPtr> parentJoints;
677 private: std::vector<JointPtr> childJoints;
680 private: std::vector<ModelPtr> attachedModels;
686 private: msgs::LinkData linkDataMsg;
689 private:
bool publishData;
692 private: boost::recursive_mutex *publishDataMutex;
701 private: std::vector<msgs::Wrench> wrenchMsgs;
704 private: boost::mutex wrenchMsgMutex;
707 private: std::vector<common::BatteryPtr> batteries;
710 private: std::vector<util::OpenALSourcePtr> audioSources;
virtual void UpdateMass()
Update the mass matrix.
Definition: Link.hh:472
boost::shared_ptr< Link > LinkPtr
Definition: PhysicsTypes.hh:100
bool initialized
This flag is set to true when the link is initialized.
Definition: Link.hh:662
virtual math::Vector3 GetWorldLinearVel() const
Get the linear velocity of the origin of the link frame, expressed in the world frame.
Definition: Link.hh:230
Forward declarations for the common classes.
Definition: Animation.hh:33
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
std::vector< math::Pose > attachedModelsOffset
Offsets for the attached models.
Definition: Link.hh:659
virtual bool GetKinematic() const
Implement this function.
Definition: Link.hh:387
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
event::ConnectionPtr ConnectEnabled(T _subscriber)
Connect to the add entity signal.
Definition: Link.hh:414
void DisconnectEnabled(event::ConnectionPtr &_conn)
Disconnect to the add entity signal.
Definition: Link.hh:419
Link class defines a rigid body entity, containing information on inertia, visual and collision prope...
Definition: Link.hh:68
Information for use in an update event.
Definition: UpdateInfo.hh:30
Visuals_M visuals
Link visual elements.
Definition: Link.hh:650
std::map< uint32_t, msgs::Visual > Visuals_M
Definition: Link.hh:647
A 3x3 matrix class.
Definition: Matrix3.hh:34
std::vector< std::string > cgVisuals
Center of gravity visual elements.
Definition: Link.hh:643
math::Vector3 linearAccel
Linear acceleration.
Definition: Link.hh:653
virtual void UpdateSurface()
Update surface parameters.
Definition: Link.hh:475
std::vector< JointPtr > Joint_V
Definition: PhysicsTypes.hh:204
std::vector< CollisionPtr > Collision_V
Definition: PhysicsTypes.hh:220
A quaternion class.
Definition: Quaternion.hh:42
std::shared_ptr< Battery > BatteryPtr
Definition: CommonTypes.hh:144
boost::shared_ptr< Inertial > InertialPtr
Definition: PhysicsTypes.hh:148
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:153
Base class for all physics objects in Gazebo.
Definition: Entity.hh:58
math::Vector3 angularAccel
Angular acceleration.
Definition: Link.hh:656
boost::shared_ptr< Entity > EntityPtr
Definition: PhysicsTypes.hh:80
boost::shared_ptr< Model > ModelPtr
Definition: PhysicsTypes.hh:88
std::shared_ptr< OpenALSink > OpenALSinkPtr
Definition: UtilTypes.hh:44
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
static const Vector3 Zero
math::Vector3(0, 0, 0)
Definition: Vector3.hh:42
std::vector< LinkPtr > Link_V
Definition: PhysicsTypes.hh:216
InertialPtr GetInertial() const
Get the inertia of the link.
Definition: Link.hh:318
Store state information of a physics::Link object.
Definition: LinkState.hh:49
boost::shared_ptr< Collision > CollisionPtr
Definition: PhysicsTypes.hh:104
InertialPtr inertial
Inertial properties.
Definition: Link.hh:638