23 #ifndef _GAZEBO_PHYSICS_BASE_HH_
24 #define _GAZEBO_PHYSICS_BASE_HH_
32 #include <boost/enable_shared_from_this.hpp>
94 COLLISION = 0x00000008,
105 BALL_JOINT = 0x00000080,
107 HINGE2_JOINT = 0x00000100,
109 HINGE_JOINT = 0x00000200,
111 SLIDER_JOINT = 0x00000400,
113 SCREW_JOINT = 0x00000800,
115 UNIVERSAL_JOINT = 0x00001000,
117 GEARBOX_JOINT = 0x00002000,
119 FIXED_JOINT = 0x00004000,
124 BOX_SHAPE = 0x00020000,
126 CYLINDER_SHAPE = 0x00040000,
128 HEIGHTMAP_SHAPE = 0x00080000,
130 MAP_SHAPE = 0x00100000,
132 MULTIRAY_SHAPE = 0x00200000,
134 RAY_SHAPE = 0x00400000,
136 PLANE_SHAPE = 0x00800000,
138 SPHERE_SHAPE = 0x01000000,
140 MESH_SHAPE = 0x02000000,
142 POLYLINE_SHAPE = 0x04000000,
145 SENSOR_COLLISION = 0x10000000
153 public:
virtual ~
Base();
157 public:
virtual void Load(sdf::ElementPtr _sdf);
160 public:
virtual void Fini();
166 public:
virtual void Reset();
178 public:
virtual void UpdateParameters(sdf::ElementPtr _sdf);
182 public:
virtual void SetName(
const std::string &_name);
186 public: std::string GetName()
const;
190 public: uint32_t GetId()
const;
195 public:
void SetSaveable(
bool _v);
200 public:
bool GetSaveable()
const;
204 public:
int GetParentId()
const;
208 public:
void SetParent(
BasePtr _parent);
212 public:
BasePtr GetParent()
const;
216 public:
void AddChild(
BasePtr _child);
220 public:
virtual void RemoveChild(
unsigned int _id);
223 public:
void RemoveChildren();
227 public:
unsigned int GetChildCount()
const;
234 public:
BasePtr GetById(
unsigned int _id)
const;
240 public:
BasePtr GetByName(
const std::string &_name);
245 public:
BasePtr GetChild(
unsigned int _i)
const;
250 public:
BasePtr GetChild(
const std::string &_name);
254 public:
void RemoveChild(
const std::string &_name);
259 public:
void AddType(EntityType _type);
265 public:
bool HasType(
const EntityType &_t)
const;
269 public:
unsigned int GetType()
const;
277 public: std::string GetScopedName(
bool _prependWorldName =
false)
const;
281 public:
void Print(
const std::string &_prefix);
286 public:
virtual bool SetSelected(
bool _show);
290 public:
bool IsSelected()
const;
296 public:
bool operator ==(
const Base &_ent)
const;
301 public:
void SetWorld(
const WorldPtr &_newWorld);
305 public:
const WorldPtr &GetWorld()
const;
309 public:
virtual const sdf::ElementPtr GetSDF();
314 protected:
void ComputeScopedName();
317 protected: sdf::ElementPtr
sdf;
329 private:
bool saveable;
332 private: uint32_t id;
335 private:
unsigned int type;
338 private:
bool selected;
341 private: std::string name;
344 private: std::string scopedName;
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:72
#define GZ_PHYSICS_VISIBLE
Definition: system.hh:259
Base_V children
Children of this entity.
Definition: Base.hh:323
sdf::ElementPtr sdf
The SDF values for this object.
Definition: Base.hh:317
WorldPtr world
Pointer to the world.
Definition: Base.hh:326
virtual void Update()
Update the object.
Definition: Base.hh:173
BasePtr parent
Parent of this entity.
Definition: Base.hh:320
default namespace for gazebo
virtual void Init()
Initialize the object.
Definition: Base.hh:163
Base class for most physics classes.
Definition: Base.hh:80
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:84
Base class for all physics objects in Gazebo.
Definition: Entity.hh:58
EntityType
Unique identifiers for all entity types.
Definition: Base.hh:84
static std::string EntityTypename[]
String names for the different entity types.
Definition: Base.hh:50
std::vector< BasePtr > Base_V
Definition: PhysicsTypes.hh:192