All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
gazebo::physics::Base Class Reference

Base class for most physics classes. More...

#include <physics/physics.hh>

Inheritance diagram for gazebo::physics::Base:
Inheritance graph
[legend]

Public Types

enum  EntityType {
  BASE = 0x00000000, ENTITY = 0x00000001, MODEL = 0x00000002, LINK = 0x00000004,
  COLLISION = 0x00000008, ACTOR = 0x00000016, LIGHT = 0x00000010, VISUAL = 0x00000020,
  JOINT = 0x00000040, BALL_JOINT = 0x00000080, HINGE2_JOINT = 0x00000100, HINGE_JOINT = 0x00000200,
  SLIDER_JOINT = 0x00000400, SCREW_JOINT = 0x00000800, UNIVERSAL_JOINT = 0x00001000, SHAPE = 0x00002000,
  BOX_SHAPE = 0x00004000, CYLINDER_SHAPE = 0x00008000, HEIGHTMAP_SHAPE = 0x00010000, MAP_SHAPE = 0x00020000,
  MULTIRAY_SHAPE = 0x00040000, RAY_SHAPE = 0x00080000, PLANE_SHAPE = 0x00100000, SPHERE_SHAPE = 0x00200000,
  MESH_SHAPE = 0x00400000, SENSOR_COLLISION = 0x00800000
}
 Unique identifiers for all entity types. More...

Public Member Functions

 Base (BasePtr _parent)
 Constructor.
virtual ~Base ()
 Destructor.
void AddChild (BasePtr _child)
 Add a child to this entity.
void AddType (EntityType _type)
 Add a type specifier.
virtual void Fini ()
 Finialize the object.
BasePtr GetById (unsigned int _id) const
 This is an internal function.
BasePtr GetByName (const std::string &_name)
 Get by name.
BasePtr GetChild (unsigned int _i) const
 Get a child by index.
BasePtr GetChild (const std::string &_name)
 Get a child by name.
unsigned int GetChildCount () const
 Get the number of children.
unsigned int GetId () const
 Return the ID of this entity.
std::string GetName () const
 Return the name of the entity.
BasePtr GetParent () const
 Get the parent.
int GetParentId () const
 Return the ID of the parent.
bool GetSaveable () const
 Get whether the object should be "saved", when the user selects to save the world to xml.
std::string GetScopedName () const
 Return the name of this entity with the model scope world::model1::...::modelN::entityName.
virtual const sdf::ElementPtr GetSDF ()
 Get the SDF values for the object.
unsigned int GetType () const
 Get the full type definition.
const WorldPtrGetWorld () const
 Get the World this object is in.
bool HasType (const EntityType &_t) const
 Returns true if this object's type definition has the given type.
virtual void Init ()
 Initialize the object.
bool IsSelected () const
 True if the entity is selected by the user.
virtual void Load (sdf::ElementPtr _sdf)
 Load.
bool operator== (const Base &_ent) const
 Returns true if the entities are the same.
void Print (const std::string &_prefix)
 Print this object to screen via gzmsg.
virtual void RemoveChild (unsigned int _id)
 Remove a child from this entity.
void RemoveChild (const std::string &_name)
 Remove a child by name.
void RemoveChildren ()
 Remove all children.
virtual void Reset ()
 Reset the object.
virtual void Reset (Base::EntityType _resetType)
 Calls recursive Reset on one of the Base::EntityType's.
virtual void SetName (const std::string &_name)
 Set the name of the entity.
void SetParent (BasePtr _parent)
 Set the parent.
void SetSaveable (bool _v)
 Set whether the object should be "saved", when the user selects to save the world to xml.
virtual bool SetSelected (bool _show)
 Set whether this entity has been selected by the user through the gui.
void SetWorld (const WorldPtr &_newWorld)
 Set the world this object belongs to.
virtual void Update ()
 Update the object.
virtual void UpdateParameters (sdf::ElementPtr _sdf)
 Update the parameters using new sdf values.

Protected Member Functions

void ComputeScopedName ()
 Compute the scoped name of this object based on its parents.

Protected Attributes

Base_V children
 Children of this entity.
Base_V::iterator childrenEnd
 End of the children vector.
BasePtr parent
 Parent of this entity.
sdf::ElementPtr sdf
 The SDF values for this object.
WorldPtr world
 Pointer to the world.

Detailed Description

Base class for most physics classes.

Member Enumeration Documentation

Unique identifiers for all entity types.

Enumerator:
BASE 

Base type.

ENTITY 

Entity type.

MODEL 

Model type.

LINK 

Link type.

COLLISION 

Collision type.

ACTOR 

Actor type.

LIGHT 

Light type.

VISUAL 

Visual type.

JOINT 

Joint type.

BALL_JOINT 

BallJoint type.

HINGE2_JOINT 

Hing2Joint type.

HINGE_JOINT 

HingeJoint type.

SLIDER_JOINT 

SliderJoint type.

SCREW_JOINT 

ScrewJoint type.

UNIVERSAL_JOINT 

UniversalJoint type.

SHAPE 

Shape type.

BOX_SHAPE 

BoxShape type.

CYLINDER_SHAPE 

CylinderShape type.

HEIGHTMAP_SHAPE 

HeightmapShape type.

MAP_SHAPE 

MapShape type.

MULTIRAY_SHAPE 

MultiRayShape type.

RAY_SHAPE 

RayShape type.

PLANE_SHAPE 

PlaneShape type.

SPHERE_SHAPE 

SphereShape type.

MESH_SHAPE 

MeshShape type.

SENSOR_COLLISION 

Indicates a collision shape used for sensing.

Constructor & Destructor Documentation

gazebo::physics::Base::Base ( BasePtr  _parent)
explicit

Constructor.

Parameters
[in]_parentParent of this object
virtual gazebo::physics::Base::~Base ( )
virtual

Destructor.

Member Function Documentation

void gazebo::physics::Base::AddChild ( BasePtr  _child)

Add a child to this entity.

Parameters
[in]_childChild entity.
void gazebo::physics::Base::AddType ( EntityType  _type)

Add a type specifier.

Parameters
[in]_typeNew type to append to this objects type definition.
void gazebo::physics::Base::ComputeScopedName ( )
protected

Compute the scoped name of this object based on its parents.

See Also
Base::GetScopedName
virtual void gazebo::physics::Base::Fini ( )
virtual
BasePtr gazebo::physics::Base::GetById ( unsigned int  _id) const

This is an internal function.

Get a child or self by id.

Parameters
[in]_idID of the object to retreive.
Returns
A pointer to the object, NULL if not found
BasePtr gazebo::physics::Base::GetByName ( const std::string &  _name)

Get by name.

Parameters
[in]_nameGet a child (or self) object by name
Returns
A pointer to the object, NULL if not found
BasePtr gazebo::physics::Base::GetChild ( unsigned int  _i) const

Get a child by index.

Parameters
[in]_iIndex of the child to retreive.
Returns
A pointer to the object, NULL if the index is invalid.
BasePtr gazebo::physics::Base::GetChild ( const std::string &  _name)

Get a child by name.

Parameters
[in]_nameName of the child.
Returns
A pointer to the object, NULL if not found
unsigned int gazebo::physics::Base::GetChildCount ( ) const

Get the number of children.

Returns
The number of children.
unsigned int gazebo::physics::Base::GetId ( ) const

Return the ID of this entity.

This id is unique.

Returns
Integer ID.
std::string gazebo::physics::Base::GetName ( ) const

Return the name of the entity.

Returns
Name of the entity.
BasePtr gazebo::physics::Base::GetParent ( ) const

Get the parent.

Returns
Pointer to the parent entity.

Reimplemented in gazebo::physics::Joint.

int gazebo::physics::Base::GetParentId ( ) const

Return the ID of the parent.

Returns
Integer ID.
bool gazebo::physics::Base::GetSaveable ( ) const

Get whether the object should be "saved", when the user selects to save the world to xml.

Returns
True if the object is saveable.
std::string gazebo::physics::Base::GetScopedName ( ) const

Return the name of this entity with the model scope world::model1::...::modelN::entityName.

Returns
The scoped name.
virtual const sdf::ElementPtr gazebo::physics::Base::GetSDF ( )
virtual

Get the SDF values for the object.

Returns
The SDF values for the object.

Reimplemented in gazebo::physics::Actor, and gazebo::physics::Model.

unsigned int gazebo::physics::Base::GetType ( ) const

Get the full type definition.

Returns
The full type definition.
const WorldPtr& gazebo::physics::Base::GetWorld ( ) const

Get the World this object is in.

Returns
The World this object is part of.
bool gazebo::physics::Base::HasType ( const EntityType _t) const

Returns true if this object's type definition has the given type.

Parameters
[in]_tType to check.
Returns
True if this object's type definition has the.
virtual void gazebo::physics::Base::Init ( )
inlinevirtual
bool gazebo::physics::Base::IsSelected ( ) const

True if the entity is selected by the user.

Returns
True if the entity is selected.
virtual void gazebo::physics::Base::Load ( sdf::ElementPtr  _sdf)
virtual
bool gazebo::physics::Base::operator== ( const Base _ent) const

Returns true if the entities are the same.

Checks only the name.

Parameters
[in]_entBase object to compare with.
Returns
True if the entities are the same.
void gazebo::physics::Base::Print ( const std::string &  _prefix)

Print this object to screen via gzmsg.

Parameters
[in]_prefixUsually a set of spaces.
virtual void gazebo::physics::Base::RemoveChild ( unsigned int  _id)
virtual

Remove a child from this entity.

Parameters
[in]_idID of the child to remove.
void gazebo::physics::Base::RemoveChild ( const std::string &  _name)

Remove a child by name.

Parameters
[in]_nameName of the child.
void gazebo::physics::Base::RemoveChildren ( )

Remove all children.

virtual void gazebo::physics::Base::Reset ( )
virtual
virtual void gazebo::physics::Base::Reset ( Base::EntityType  _resetType)
virtual

Calls recursive Reset on one of the Base::EntityType's.

Parameters
[in]_resetTypeThe type of reset operation
virtual void gazebo::physics::Base::SetName ( const std::string &  _name)
virtual

Set the name of the entity.

Parameters
[in]_nameNew name.

Reimplemented in gazebo::physics::Entity.

void gazebo::physics::Base::SetParent ( BasePtr  _parent)

Set the parent.

Parameters
[in]_parentParent object.
void gazebo::physics::Base::SetSaveable ( bool  _v)

Set whether the object should be "saved", when the user selects to save the world to xml.

Parameters
[in]_vSet to True if the object should be saved.
virtual bool gazebo::physics::Base::SetSelected ( bool  _show)
virtual

Set whether this entity has been selected by the user through the gui.

Parameters
[in]_showTrue to set this entity as selected.

Reimplemented in gazebo::physics::Link.

void gazebo::physics::Base::SetWorld ( const WorldPtr _newWorld)

Set the world this object belongs to.

This will also set the world for all children.

Parameters
[in]_newWorldThe new World this object is part of.
virtual void gazebo::physics::Base::Update ( )
inlinevirtual
virtual void gazebo::physics::Base::UpdateParameters ( sdf::ElementPtr  _sdf)
virtual

Update the parameters using new sdf values.

Parameters
[in]_sdfUpdate the object's parameters based on SDF values.

Reimplemented in gazebo::physics::Joint, gazebo::physics::Actor, gazebo::physics::Link, gazebo::physics::Model, gazebo::physics::Entity, and gazebo::physics::Collision.

Member Data Documentation

Base_V gazebo::physics::Base::children
protected

Children of this entity.

Base_V::iterator gazebo::physics::Base::childrenEnd
protected

End of the children vector.

BasePtr gazebo::physics::Base::parent
protected

Parent of this entity.

sdf::ElementPtr gazebo::physics::Base::sdf
protected

The SDF values for this object.

WorldPtr gazebo::physics::Base::world
protected

Pointer to the world.


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