18 #ifndef GAZEBO_PHYSICS_BASE_HH_
19 #define GAZEBO_PHYSICS_BASE_HH_
27 #include <boost/enable_shared_from_this.hpp>
77 class GZ_PHYSICS_VISIBLE
Base :
public boost::enable_shared_from_this<Base>
91 COLLISION = 0x00000008,
100 BALL_JOINT = 0x00000080,
102 HINGE2_JOINT = 0x00000100,
104 HINGE_JOINT = 0x00000200,
106 SLIDER_JOINT = 0x00000400,
108 SCREW_JOINT = 0x00000800,
110 UNIVERSAL_JOINT = 0x00001000,
112 GEARBOX_JOINT = 0x00002000,
114 FIXED_JOINT = 0x00004000,
122 BOX_SHAPE = 0x00020000,
124 CYLINDER_SHAPE = 0x00040000,
126 HEIGHTMAP_SHAPE = 0x00080000,
128 MAP_SHAPE = 0x00100000,
130 MULTIRAY_SHAPE = 0x00200000,
132 RAY_SHAPE = 0x00400000,
134 PLANE_SHAPE = 0x00800000,
136 SPHERE_SHAPE = 0x01000000,
138 MESH_SHAPE = 0x02000000,
140 POLYLINE_SHAPE = 0x04000000,
143 SENSOR_COLLISION = 0x10000000
151 public:
virtual ~
Base();
155 public:
virtual void Load(sdf::ElementPtr _sdf);
158 public:
virtual void Fini();
164 public:
virtual void Reset();
176 public:
virtual void UpdateParameters(sdf::ElementPtr _sdf);
180 public:
virtual void SetName(
const std::string &_name);
184 public: std::string GetName()
const;
188 public: uint32_t GetId()
const;
193 public:
void SetSaveable(
bool _v);
198 public:
bool GetSaveable()
const;
202 public:
int GetParentId()
const;
206 public:
void SetParent(
BasePtr _parent);
210 public:
BasePtr GetParent()
const;
214 public:
void AddChild(
BasePtr _child);
218 public:
virtual void RemoveChild(
unsigned int _id);
221 public:
void RemoveChildren();
225 public:
unsigned int GetChildCount()
const;
232 public:
BasePtr GetById(
unsigned int _id)
const;
238 public:
BasePtr GetByName(
const std::string &_name);
243 public:
BasePtr GetChild(
unsigned int _i)
const;
248 public:
BasePtr GetChild(
const std::string &_name);
252 public:
void RemoveChild(
const std::string &_name);
261 public:
void AddType(EntityType _type);
267 public:
bool HasType(
const EntityType &_t)
const;
271 public:
unsigned int GetType()
const;
275 public: std::string TypeStr()
const;
283 public: std::string GetScopedName(
bool _prependWorldName =
false)
const;
295 public:
void Print(
const std::string &_prefix);
300 public:
virtual bool SetSelected(
bool _show);
304 public:
bool IsSelected()
const;
310 public:
bool operator ==(
const Base &_ent)
const;
315 public:
void SetWorld(
const WorldPtr &_newWorld);
319 public:
const WorldPtr &GetWorld()
const;
323 public:
virtual const sdf::ElementPtr GetSDF();
326 protected:
virtual void RegisterIntrospectionItems();
329 protected:
virtual void UnregisterIntrospectionItems();
334 protected:
void ComputeScopedName();
337 protected: sdf::ElementPtr
sdf;
352 private:
bool saveable;
355 private: uint32_t id;
358 private:
unsigned int type;
361 private: std::string typeStr;
364 private:
bool selected;
367 private: std::string name;
370 private: std::string scopedName;
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:89
static std::string EntityTypename[]
String names for the different entity types.
Definition: Base.hh:47
BasePtr parent
Parent of this entity.
Definition: Base.hh:340
virtual void Update()
Update the object.
Definition: Base.hh:171
default namespace for gazebo
A complete URI.
Definition: URI.hh:176
std::vector< common::URI > introspectionItems
All the introspection items regsitered for this.
Definition: Base.hh:349
Base class for most physics classes.
Definition: Base.hh:77
virtual void Init()
Initialize the object.
Definition: Base.hh:161
Base_V children
Children of this entity.
Definition: Base.hh:343
Base class for all physics objects in Gazebo.
Definition: Entity.hh:52
WorldPtr world
Pointer to the world.
Definition: Base.hh:346
std::vector< BasePtr > Base_V
Definition: PhysicsTypes.hh:201
EntityType
Unique identifiers for all entity types.
Definition: Base.hh:81
sdf::ElementPtr sdf
The SDF values for this object.
Definition: Base.hh:337
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:77