23 #ifndef _GAZEBO_PHYSICS_BASE_HH_ 24 #define _GAZEBO_PHYSICS_BASE_HH_ 32 #include <boost/enable_shared_from_this.hpp> 81 class GZ_PHYSICS_VISIBLE
Base :
public boost::enable_shared_from_this<Base>
95 COLLISION = 0x00000008,
106 BALL_JOINT = 0x00000080,
108 HINGE2_JOINT = 0x00000100,
110 HINGE_JOINT = 0x00000200,
112 SLIDER_JOINT = 0x00000400,
114 SCREW_JOINT = 0x00000800,
116 UNIVERSAL_JOINT = 0x00001000,
118 GEARBOX_JOINT = 0x00002000,
120 FIXED_JOINT = 0x00004000,
125 BOX_SHAPE = 0x00020000,
127 CYLINDER_SHAPE = 0x00040000,
129 HEIGHTMAP_SHAPE = 0x00080000,
131 MAP_SHAPE = 0x00100000,
133 MULTIRAY_SHAPE = 0x00200000,
135 RAY_SHAPE = 0x00400000,
137 PLANE_SHAPE = 0x00800000,
139 SPHERE_SHAPE = 0x01000000,
141 MESH_SHAPE = 0x02000000,
143 POLYLINE_SHAPE = 0x04000000,
146 SENSOR_COLLISION = 0x10000000
154 public:
virtual ~
Base();
158 public:
virtual void Load(sdf::ElementPtr _sdf);
161 public:
virtual void Fini();
167 public:
virtual void Reset();
179 public:
virtual void UpdateParameters(sdf::ElementPtr _sdf);
183 public:
virtual void SetName(
const std::string &_name);
187 public: std::string GetName()
const;
191 public: uint32_t GetId()
const;
196 public:
void SetSaveable(
bool _v);
201 public:
bool GetSaveable()
const;
205 public:
int GetParentId()
const;
209 public:
void SetParent(
BasePtr _parent);
213 public:
BasePtr GetParent()
const;
217 public:
void AddChild(
BasePtr _child);
221 public:
virtual void RemoveChild(
unsigned int _id);
224 public:
void RemoveChildren();
228 public:
unsigned int GetChildCount()
const;
235 public:
BasePtr GetById(
unsigned int _id)
const;
241 public:
BasePtr GetByName(
const std::string &_name);
246 public:
BasePtr GetChild(
unsigned int _i)
const;
251 public:
BasePtr GetChild(
const std::string &_name);
255 public:
void RemoveChild(
const std::string &_name);
270 public:
bool HasType(
const EntityType &_t)
const;
274 public:
unsigned int GetType()
const;
282 public: std::string GetScopedName(
bool _prependWorldName =
false)
const;
286 public:
void Print(
const std::string &_prefix);
291 public:
virtual bool SetSelected(
bool _show);
295 public:
bool IsSelected()
const;
301 public:
bool operator ==(
const Base &_ent)
const;
306 public:
void SetWorld(
const WorldPtr &_newWorld);
310 public:
const WorldPtr &GetWorld()
const;
314 public:
virtual const sdf::ElementPtr GetSDF();
319 protected:
void ComputeScopedName();
322 protected: sdf::ElementPtr
sdf;
334 private:
bool saveable;
337 private: uint32_t id;
340 private:
unsigned int type;
343 private:
bool selected;
346 private: std::string name;
349 private: std::string scopedName;
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:84
Forward declarations for the common classes.
Definition: Animation.hh:33
static std::string EntityTypename[]
String names for the different entity types.
Definition: Base.hh:51
BasePtr parent
Parent of this entity.
Definition: Base.hh:325
virtual void Update()
Update the object.
Definition: Base.hh:174
default namespace for gazebo
Base class for most physics classes.
Definition: Base.hh:81
virtual void Init()
Initialize the object.
Definition: Base.hh:164
Base_V children
Children of this entity.
Definition: Base.hh:328
Base class for all physics objects in Gazebo.
Definition: Entity.hh:58
WorldPtr world
Pointer to the world.
Definition: Base.hh:331
std::vector< BasePtr > Base_V
Definition: PhysicsTypes.hh:192
EntityType
Unique identifiers for all entity types.
Definition: Base.hh:85
sdf::ElementPtr sdf
The SDF values for this object.
Definition: Base.hh:322
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:72