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);
257 public:
void AddType(EntityType _type);
263 public:
bool HasType(
const EntityType &_t)
const;
267 public:
unsigned int GetType()
const;
271 public: std::string TypeStr()
const;
279 public: std::string GetScopedName(
bool _prependWorldName =
false)
const;
291 public:
void Print(
const std::string &_prefix);
296 public:
virtual bool SetSelected(
bool _show);
300 public:
bool IsSelected()
const;
306 public:
bool operator ==(
const Base &_ent)
const;
311 public:
void SetWorld(
const WorldPtr &_newWorld);
315 public:
const WorldPtr &GetWorld()
const;
319 public:
virtual const sdf::ElementPtr GetSDF();
324 protected:
void ComputeScopedName();
327 protected: sdf::ElementPtr
sdf;
339 private:
bool saveable;
342 private: uint32_t id;
345 private:
unsigned int type;
348 private: std::string typeStr;
351 private:
bool selected;
354 private: std::string name;
357 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:330
virtual void Update()
Update the object.
Definition: Base.hh:171
default namespace for gazebo
A complete URI.
Definition: URI.hh:170
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:333
Base class for all physics objects in Gazebo.
Definition: Entity.hh:58
WorldPtr world
Pointer to the world.
Definition: Base.hh:336
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:327
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:77