75 public:
virtual ~
Link();
79 public:
virtual void Load(sdf::ElementPtr _sdf);
82 public:
virtual void Init();
92 public:
void ResetPhysicsStates();
96 public:
virtual void UpdateParameters(sdf::ElementPtr _sdf);
109 public:
virtual void SetEnabled(
bool _enable)
const = 0;
113 public:
virtual bool GetEnabled()
const = 0;
118 public:
virtual bool SetSelected(
bool _set);
122 public:
virtual void SetGravityMode(
bool _mode) = 0;
126 public:
virtual bool GetGravityMode()
const = 0;
130 public:
virtual void SetWindMode(
const bool _mode);
134 public:
virtual bool WindMode()
const;
140 public:
virtual void SetSelfCollide(
bool _collide) = 0;
150 public:
void SetCollideMode(
const std::string &_mode);
159 public:
bool GetSelfCollide()
const;
163 public:
void SetLaserRetro(
float _retro);
167 public:
virtual void SetLinearVel(
const math::Vector3 &_vel) = 0;
171 public:
virtual void SetAngularVel(
const math::Vector3 &_vel) = 0;
183 public:
virtual void SetForce(
const math::Vector3 &_force) = 0;
187 public:
virtual void SetTorque(
const math::Vector3 &_torque) = 0;
191 public:
virtual void AddForce(
const math::Vector3 &_force) = 0;
196 public:
virtual void AddRelativeForce(
const math::Vector3 &_force) = 0;
201 public:
virtual void AddForceAtWorldPosition(
const math::Vector3 &_force,
208 public:
virtual void AddForceAtRelativePosition(
218 public:
virtual void AddLinkForce(
const math::Vector3 &_force,
223 public:
virtual void AddTorque(
const math::Vector3 &_torque) = 0;
228 public:
virtual void AddRelativeTorque(
const math::Vector3 &_torque) = 0;
267 public:
virtual math::Vector3 GetWorldCoGLinearVel()
const = 0;
331 public:
void SetInertial(
const InertialPtr &_inertial);
338 public:
math::Pose GetWorldInertialPose()
const;
350 public:
CollisionPtr GetCollisionById(
unsigned int _id)
const;
356 public:
CollisionPtr GetCollision(
const std::string &_name);
361 public:
CollisionPtr GetCollision(
unsigned int _index)
const;
370 public:
virtual math::Box GetBoundingBox()
const;
374 public:
virtual void SetLinearDamping(
double _damping) = 0;
378 public:
virtual void SetAngularDamping(
double _damping) = 0;
382 public:
double GetLinearDamping()
const;
386 public:
double GetAngularDamping()
const;
391 public:
virtual void SetKinematic(
const bool &_kinematic);
404 public:
unsigned int GetSensorCount()
const;
417 public: std::string GetSensorName(
unsigned int _index)
const;
422 public:
template<
typename T>
424 {
return enabledSignal.Connect(_subscriber);}
429 {enabledSignal.Disconnect(_conn);}
433 public:
void FillMsg(msgs::Link &_msg);
437 public:
void ProcessMsg(
const msgs::Link &_msg);
441 public:
void AddChildJoint(
JointPtr _joint);
445 public:
void AddParentJoint(
JointPtr _joint);
449 public:
void RemoveParentJoint(
const std::string &_jointName);
453 public:
void RemoveChildJoint(
const std::string &_jointName);
456 public:
virtual void RemoveChild(
EntityPtr _child);
462 public:
void AttachStaticModel(
ModelPtr &_model,
467 public:
void DetachStaticModel(
const std::string &_modelName);
470 public:
void DetachAllStaticModels();
474 public:
virtual void OnPoseChange();
478 public:
void SetState(
const LinkState &_state);
488 public:
virtual void SetAutoDisable(
bool _disable) = 0;
492 public:
Link_V GetChildJointsLinks()
const;
496 public:
Link_V GetParentJointsLinks()
const;
500 public:
void SetPublishData(
bool _enable);
503 public:
Joint_V GetParentJoints()
const;
506 public:
Joint_V GetChildJoints()
const;
510 public:
void RemoveCollision(
const std::string &_name);
515 public:
double GetWorldEnergyPotential()
const;
520 public:
double GetWorldEnergyKinetic()
const;
526 public:
double GetWorldEnergy()
const;
531 public: msgs::Visual GetVisualMessage(
const std::string &_name)
const;
536 public:
virtual void SetLinkStatic(
bool _static) = 0;
546 public:
void MoveFrame(
const math::Pose &_worldReferenceFrameSrc,
563 public:
bool FindAllConnectedLinksHelper(
564 const LinkPtr &_originalParentLink,
565 Link_V &_connectedLinks,
bool _fistLink =
false);
569 public:
void SetWindEnabled(
const bool _enable);
574 public:
const ignition::math::Vector3d WorldWindLinearVel()
const;
578 public:
const ignition::math::Vector3d RelativeWindLinearVel()
const;
596 public:
size_t BatteryCount()
const;
602 public:
bool VisualId(
const std::string &_visName, uint32_t &_visualId)
609 public:
bool VisualPose(
const uint32_t _id,
610 ignition::math::Pose3d &_pose)
const;
616 public:
bool SetVisualPose(
const uint32_t _id,
617 const ignition::math::Pose3d &_pose);
620 private:
void PublishData();
624 private:
void LoadCollision(sdf::ElementPtr _sdf);
628 private:
void SetInertialFromCollisions();
632 private:
void OnCollision(ConstContactsPtr &_msg);
635 private:
void ParseVisuals();
641 private:
bool ContainsLink(
const Link_V &_vector,
const LinkPtr &_value);
645 private:
void UpdateVisualGeomSDF(
const math::Vector3 &_scale);
648 private:
void UpdateVisualMsg();
653 private:
void OnWrenchMsg(ConstWrenchPtr &_msg);
657 private:
void ProcessWrenchMsg(
const msgs::Wrench &_msg);
661 private:
void LoadBattery(
const sdf::ElementPtr _sdf);
692 private:
bool enabled;
695 private: std::vector<std::string> sensors;
698 private: std::vector<JointPtr> parentJoints;
701 private: std::vector<JointPtr> childJoints;
704 private: std::vector<ModelPtr> attachedModels;
710 private: msgs::LinkData linkDataMsg;
713 private:
bool publishData;
716 private: boost::recursive_mutex *publishDataMutex;
725 private: std::vector<msgs::Wrench> wrenchMsgs;
728 private: boost::mutex wrenchMsgMutex;
731 private: ignition::math::Vector3d windLinearVel;
737 private: std::vector<common::BatteryPtr> batteries;
740 private: std::vector<util::OpenALSourcePtr> audioSources;
virtual void UpdateMass()
Update the mass matrix.
Definition: Link.hh:481
boost::shared_ptr< Link > LinkPtr
Definition: PhysicsTypes.hh:109
bool initialized
This flag is set to true when the link is initialized.
Definition: Link.hh:686
InertialPtr GetInertial() const
Get the inertia of the link.
Definition: Link.hh:327
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:683
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
event::ConnectionPtr ConnectEnabled(T _subscriber)
Connect to the add entity signal.
Definition: Link.hh:423
void DisconnectEnabled(event::ConnectionPtr &_conn)
Disconnect to the add entity signal.
Definition: Link.hh:428
virtual math::Vector3 GetWorldLinearVel() const
Get the linear velocity of the origin of the link frame, expressed in the world frame.
Definition: Link.hh:239
virtual void Update()
Update the object.
Definition: Base.hh:171
virtual void RemoveChild(unsigned int _id)
Remove a child from this entity.
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:674
std::map< uint32_t, msgs::Visual > Visuals_M
Definition: Link.hh:671
virtual bool GetKinematic() const
Implement this function.
Definition: Link.hh:396
A 3x3 matrix class.
Definition: Matrix3.hh:34
std::vector< std::string > cgVisuals
Center of gravity visual elements.
Definition: Link.hh:667
math::Vector3 linearAccel
Linear acceleration.
Definition: Link.hh:677
virtual void UpdateSurface()
Update surface parameters.
Definition: Link.hh:484
std::vector< JointPtr > Joint_V
Definition: PhysicsTypes.hh:213
std::vector< CollisionPtr > Collision_V
Definition: PhysicsTypes.hh:229
OpenAL Source.
Definition: OpenAL.hh:113
A quaternion class.
Definition: Quaternion.hh:42
std::shared_ptr< Battery > BatteryPtr
Definition: CommonTypes.hh:144
boost::shared_ptr< Inertial > InertialPtr
Definition: PhysicsTypes.hh:157
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:680
boost::shared_ptr< Entity > EntityPtr
Definition: PhysicsTypes.hh:85
boost::shared_ptr< Model > ModelPtr
Definition: PhysicsTypes.hh:93
std::shared_ptr< OpenALSink > OpenALSinkPtr
Definition: UtilTypes.hh:44
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
virtual void Reset()
Reset the entity.
static const Vector3 Zero
math::Vector3(0, 0, 0)
Definition: Vector3.hh:42
std::vector< LinkPtr > Link_V
Definition: PhysicsTypes.hh:225
Store state information of a physics::Link object.
Definition: LinkState.hh:49
boost::shared_ptr< Collision > CollisionPtr
Definition: PhysicsTypes.hh:113
InertialPtr inertial
Inertial properties.
Definition: Link.hh:664
OpenAL Listener.
Definition: OpenAL.hh:92