Public Member Functions | Protected Member Functions | Protected Attributes
Entity Class Reference

Base class for all physics objects in Gazebo. More...

#include <Entity.hh>

Inheritance diagram for Entity:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Entity (BasePtr parent)
 Constructor.
virtual ~Entity ()
 Destructor.
virtual void Load (sdf::ElementPtr &_sdf)
 Load.
virtual void Fini ()
 Finalize the entity.
virtual void Reset ()
virtual void UpdateParameters (sdf::ElementPtr &_sdf)
 Update the parameters using new sdf values.
virtual void SetName (const std::string &name)
 Set the name of the entity.
void SetStatic (const bool &s)
 Set whether this entity is static: immovable.
bool IsStatic () const
 Return whether this entity is static.
void SetInitialRelativePose (const math::Pose &p)
 Set the initial pose.
virtual math::Box GetBoundingBox () const
 Return the bounding box for the entity.
const math::PoseGetWorldPose () const
 Get the absolute pose of the entity.
math::Pose GetRelativePose () const
 Get the pose of the entity relative to its parent.
void SetRelativePose (const math::Pose &pose, bool notify=true)
 Set the pose of the entity relative to its parent.
void SetWorldPose (const math::Pose &pose, bool notify=true)
 Set the world pose of the entity.
virtual math::Vector3 GetRelativeLinearVel () const
 Get the linear velocity of the entity.
virtual math::Vector3 GetWorldLinearVel () const
 Get the linear velocity of the entity in the world frame.
virtual math::Vector3 GetRelativeAngularVel () const
 Get the angular velocity of the entity.
virtual math::Vector3 GetWorldAngularVel () const
 Get the angular velocity of the entity in the world frame.
virtual math::Vector3 GetRelativeLinearAccel () const
 Get the linear acceleration of the entity.
virtual math::Vector3 GetWorldLinearAccel () const
 Get the linear acceleration of the entity in the world frame.
virtual math::Vector3 GetRelativeAngularAccel () const
 Get the angular acceleration of the entity.
virtual math::Vector3 GetWorldAngularAccel () const
 Get the angular acceleration of the entity in the world frame.
void SetCanonicalLink (bool _value)
 Set to true if this entity is a canonical link for a model.
bool IsCanonicalLink () const
 A helper function that checks if this is a canonical body.
void SetAnimation (const common::PoseAnimationPtr &_anim, boost::function< void()> _onComplete)
 Set an animation for this entity.
void SetAnimation (const common::PoseAnimationPtr &_anim)
ModelPtr GetParentModel ()
 Get the parent model, if one exists.
CollisionPtr GetChildCollision (const std::string &_name)
 Get a child collision entity, if one exists.
LinkPtr GetChildLink (const std::string &_name)
 Get a child linke entity, if one exists.
void GetNearestEntityBelow (double &_distBelow, std::string &_entityName)
 Get the distance to the nearest entity below (along the Z-axis) this entity.
void PlaceOnNearestEntityBelow ()
 Move this entity to be ontop of the nearest entity below.
math::Box GetCollisionBoundingBox () const
void SetWorldTwist (const math::Vector3 &linear, const math::Vector3 &angular, bool updateChildren=true)
const math::PoseGetDirtyPose () const

Protected Member Functions

virtual void OnPoseChange ()=0
 This function is called when the entity's (or one of its parents) pose of the parent has changed.

Protected Attributes

EntityPtr parentEntity
 A helper that prevents numerous dynamic_casts.
transport::NodePtr node
transport::PublisherPtr visPub
transport::PublisherPtr requestPub
msgs::Visual * visualMsg
msgs::Pose * poseMsg
common::PoseAnimationPtr animation
common::Time prevAnimationTime
math::Pose animationStartPose
std::vector< event::ConnectionPtr > connections
event::ConnectionPtr animationConnection
math::Pose dirtyPose

Detailed Description

Base class for all physics objects in Gazebo.


Constructor & Destructor Documentation

Entity ( BasePtr  parent)

Constructor.

Parameters:
parentParent of the entity.

Member Function Documentation

void GetNearestEntityBelow ( double &  _distBelow,
std::string &  _entityName 
)

Get the distance to the nearest entity below (along the Z-axis) this entity.

Parameters:
_distBelowThe distance to the nearest entity below
_entityNameThe name of the nearest entity below
ModelPtr GetParentModel ( )

Get the parent model, if one exists.

Returns:
Pointer to a model, or NULL if no parent model exists
virtual math::Vector3 GetRelativeAngularAccel ( ) const [inline, virtual]

Get the angular acceleration of the entity.

Returns:
A math::Vector3 for the acceleration

Reimplemented in Link, Collision, and Model.

virtual math::Vector3 GetRelativeAngularVel ( ) const [inline, virtual]

Get the angular velocity of the entity.

Returns:
A math::Vector3 for the velocity

Reimplemented in Link, Collision, and Model.

virtual math::Vector3 GetRelativeLinearAccel ( ) const [inline, virtual]

Get the linear acceleration of the entity.

Returns:
A math::Vector3 for the acceleration

Reimplemented in Link, Collision, and Model.

virtual math::Vector3 GetRelativeLinearVel ( ) const [inline, virtual]

Get the linear velocity of the entity.

Returns:
A math::Vector3 for the linear velocity

Reimplemented in Link, Collision, and Model.

virtual math::Vector3 GetWorldAngularAccel ( ) const [inline, virtual]

Get the angular acceleration of the entity in the world frame.

Returns:
A math::Vector3 for the acceleration

Reimplemented in Link, Collision, and Model.

virtual math::Vector3 GetWorldAngularVel ( ) const [inline, virtual]

Get the angular velocity of the entity in the world frame.

Returns:
A math::Vector3 for the velocity

Reimplemented in Collision, ODELink, and Model.

virtual math::Vector3 GetWorldLinearAccel ( ) const [inline, virtual]

Get the linear acceleration of the entity in the world frame.

Returns:
A math::Vector3 for the acceleration

Reimplemented in Link, Collision, and Model.

virtual math::Vector3 GetWorldLinearVel ( ) const [inline, virtual]

Get the linear velocity of the entity in the world frame.

Returns:
A math::Vector3 for the linear velocity

Reimplemented in Collision, ODELink, and Model.

bool IsStatic ( ) const

Return whether this entity is static.

Returns:
bool True = static
virtual void Load ( sdf::ElementPtr &  _sdf) [virtual]

Load.

Parameters:
nodePointer to an configuration node

Reimplemented from Base.

Reimplemented in Model, Link, ODELink, ODECollision, and Collision.

void SetCanonicalLink ( bool  _value)

Set to true if this entity is a canonical link for a model.

Parameters:
_valueTrue if the link is canonical.
void SetInitialRelativePose ( const math::Pose p)

Set the initial pose.

Parameters:
pThe initial pose
virtual void SetName ( const std::string &  name) [virtual]

Set the name of the entity.

Parameters:
nameThe new name

Reimplemented from Base.

void SetRelativePose ( const math::Pose pose,
bool  notify = true 
)

Set the pose of the entity relative to its parent.

Parameters:
poseThe new pose
notifyTrue = tell children of the pose change
void SetStatic ( const bool &  s)

Set whether this entity is static: immovable.

Parameters:
sBool, true = static
void SetWorldPose ( const math::Pose pose,
bool  notify = true 
)

Set the world pose of the entity.

Parameters:
poseThe new world pose
notifyTrue = tell children of the pose change

The documentation for this class was generated from the following file: