23 #ifndef _GAZEBO_PHYSICS_BASE_HH_
24 #define _GAZEBO_PHYSICS_BASE_HH_
26 #include <boost/enable_shared_from_this.hpp>
88 COLLISION = 0x00000008,
99 BALL_JOINT = 0x00000080,
101 HINGE2_JOINT = 0x00000100,
103 HINGE_JOINT = 0x00000200,
105 SLIDER_JOINT = 0x00000400,
107 SCREW_JOINT = 0x00000800,
109 UNIVERSAL_JOINT = 0x00001000,
111 GEARBOX_JOINT = 0x00002000,
116 BOX_SHAPE = 0x00020000,
118 CYLINDER_SHAPE = 0x00040000,
120 HEIGHTMAP_SHAPE = 0x00080000,
122 MAP_SHAPE = 0x00100000,
124 MULTIRAY_SHAPE = 0x00200000,
126 RAY_SHAPE = 0x00400000,
128 PLANE_SHAPE = 0x00800000,
130 SPHERE_SHAPE = 0x01000000,
132 MESH_SHAPE = 0x02000000,
134 POLYLINE_SHAPE = 0x04000000,
137 SENSOR_COLLISION = 0x10000000
145 public:
virtual ~
Base();
149 public:
virtual void Load(sdf::ElementPtr _sdf);
152 public:
virtual void Fini();
158 public:
virtual void Reset();
170 public:
virtual void UpdateParameters(sdf::ElementPtr _sdf);
174 public:
virtual void SetName(
const std::string &_name);
178 public: std::string GetName()
const;
182 public: uint32_t GetId()
const;
187 public:
void SetSaveable(
bool _v);
192 public:
bool GetSaveable()
const;
196 public:
int GetParentId()
const;
200 public:
void SetParent(
BasePtr _parent);
204 public:
BasePtr GetParent()
const;
208 public:
void AddChild(
BasePtr _child);
212 public:
virtual void RemoveChild(
unsigned int _id);
215 public:
void RemoveChildren();
219 public:
unsigned int GetChildCount()
const;
226 public:
BasePtr GetById(
unsigned int _id)
const;
232 public:
BasePtr GetByName(
const std::string &_name);
237 public:
BasePtr GetChild(
unsigned int _i)
const;
242 public:
BasePtr GetChild(
const std::string &_name);
246 public:
void RemoveChild(
const std::string &_name);
251 public:
void AddType(EntityType _type);
257 public:
bool HasType(
const EntityType &_t)
const;
261 public:
unsigned int GetType()
const;
269 public: std::string GetScopedName(
bool _prependWorldName =
false)
const;
273 public:
void Print(
const std::string &_prefix);
278 public:
virtual bool SetSelected(
bool _show);
282 public:
bool IsSelected()
const;
288 public:
bool operator ==(
const Base &_ent)
const;
293 public:
void SetWorld(
const WorldPtr &_newWorld);
297 public:
const WorldPtr &GetWorld()
const;
301 public:
virtual const sdf::ElementPtr GetSDF();
306 protected:
void ComputeScopedName();
309 protected: sdf::ElementPtr
sdf;
321 private:
bool saveable;
324 private: uint32_t id;
327 private:
unsigned int type;
330 private:
bool selected;
333 private: std::string name;
336 private: std::string scopedName;
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:66
Base_V children
Children of this entity.
Definition: Base.hh:315
sdf::ElementPtr sdf
The SDF values for this object.
Definition: Base.hh:309
WorldPtr world
Pointer to the world.
Definition: Base.hh:318
virtual void Update()
Update the object.
Definition: Base.hh:165
BasePtr parent
Parent of this entity.
Definition: Base.hh:312
default namespace for gazebo
virtual void Init()
Initialize the object.
Definition: Base.hh:155
Base class for most physics classes.
Definition: Base.hh:74
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:78
Base class for all physics objects in Gazebo.
Definition: Entity.hh:56
EntityType
Unique identifiers for all entity types.
Definition: Base.hh:78
static std::string EntityTypename[]
String names for the different entity types.
Definition: Base.hh:44
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48
std::vector< BasePtr > Base_V
Definition: PhysicsTypes.hh:162