positional_entity.h
Go to the documentation of this file.
1 
7 #ifndef POSITIONAL_ENTITY_H
8 #define POSITIONAL_ENTITY_H
9 
10 namespace argos {
11  class CPositionalEntity;
12 }
13 
14 #include <argos3/core/simulator/entity/entity.h>
15 #include <argos3/core/utility/math/vector3.h>
16 #include <argos3/core/utility/math/quaternion.h>
17 
18 namespace argos {
19 
20  class CPositionalEntity : public CEntity {
21 
22  public:
23 
25 
27 
29  const std::string& str_id,
30  const CVector3& c_position = CVector3(),
31  const CQuaternion& c_orientation = CQuaternion());
32 
33  virtual void Init(TConfigurationNode& t_tree);
34  virtual void Reset();
35 
36  inline const CVector3& GetPosition() const {
37  return m_cPosition;
38  }
39 
40  inline const CVector3& GetInitPosition() const {
41  return m_cInitPosition;
42  }
43 
44  inline void SetPosition(const CVector3& c_position) {
45  m_cPosition = c_position;
46  }
47 
48  inline void SetInitPosition(const CVector3& c_position) {
49  m_cInitPosition = c_position;
50  }
51 
52  inline const CQuaternion& GetOrientation() const {
53  return m_cOrientation;
54  }
55 
56  inline const CQuaternion& GetInitOrientation() const {
57  return m_cInitOrientation;
58  }
59 
60  inline void SetOrientation(const CQuaternion c_orientation) {
61  m_cOrientation = c_orientation;
62  }
63 
64  inline void SetInitOrientation(const CQuaternion c_orientation) {
65  m_cInitOrientation = c_orientation;
66  }
67 
68  virtual void MoveTo(const CVector3& c_position,
69  const CQuaternion& c_orientation);
70 
71  virtual std::string GetTypeDescription() const {
72  return "position";
73  }
74 
75  private:
76 
77  CVector3 m_cPosition;
78  CVector3 m_cInitPosition;
79  CQuaternion m_cOrientation;
80  CQuaternion m_cInitOrientation;
81  };
82 }
83 
84 #endif
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
Basic class for an entity that contains other entities.
The basic entity type.
Definition: entity.h:90
const CQuaternion & GetOrientation() const
virtual void Reset()
Resets the state of the entity to whatever it was after Init() or the standalone constructor was call...
const CVector3 & GetInitPosition() const
virtual void MoveTo(const CVector3 &c_position, const CQuaternion &c_orientation)
const CVector3 & GetPosition() const
void SetOrientation(const CQuaternion c_orientation)
virtual std::string GetTypeDescription() const
Returns a string label for this class.
void SetPosition(const CVector3 &c_position)
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
CPositionalEntity(CComposableEntity *pc_parent)
void SetInitPosition(const CVector3 &c_position)
const CQuaternion & GetInitOrientation() const
void SetInitOrientation(const CQuaternion c_orientation)
A 3D vector class.
Definition: vector3.h:31