ARGoS 3
A parallel, multi-engine simulator for swarm robotics
prototype_link_entity.h
Go to the documentation of this file.
1
8#ifndef PROTOTYPE_LINK_ENTITY_H
9#define PROTOTYPE_LINK_ENTITY_H
10
11namespace argos {
12 class CPrototypeLinkEntity;
13}
14
15#include <argos3/core/simulator/entity/embodied_entity.h>
16#include <argos3/core/utility/math/convex_hull.h>
17#include <argos3/core/utility/math/quaternion.h>
18#include <argos3/core/utility/math/vector3.h>
19
20#include <unordered_map>
21
22namespace argos {
23
25
26 public:
27
29
30 using TVector = std::vector<CPrototypeLinkEntity*>;
31 using TVectorIterator = std::vector<CPrototypeLinkEntity*>::iterator;
32 using TVectorConstIterator = std::vector<CPrototypeLinkEntity*>::const_iterator;
33
34 public:
41
42 public:
43
45
47
48 virtual void Init(TConfigurationNode& t_tree);
49
50 virtual std::string GetTypeDescription() const {
51 return "link";
52 }
53
55 return m_eGeometry;
56 }
57
58 const CVector3& GetExtents() const {
59 return m_cExtents;
60 }
61
62 const std::vector<CVector3>& GetConvexHullPoints() const {
64 "CPrototypeLinkEntity::GetConvexHullPoints(), id=\"" <<
65 GetContext() << GetId() <<
66 "\": is not a convex hull.");
67 return m_vecConvexHullPoints;
68 }
69
70 const std::vector<CConvexHull::SFace>& GetConvexHullFaces() const {
72 "CPrototypeLinkEntity::GetConvexHullFaces(), id=\"" <<
73 GetContext() << GetId() <<
74 "\": is not a convex hull.");
75 return m_vecConvexHullFaces;
76 }
77
78 Real GetMass() const {
79 return m_fMass;
80 }
81
83 return *m_psAnchor;
84 }
85
86 const SAnchor& GetAnchor() const {
87 return *m_psAnchor;
88 }
89
90 private:
91
92 EGeometry m_eGeometry;
93 CVector3 m_cExtents;
94 Real m_fMass;
95 SAnchor* m_psAnchor;
96
97 std::vector<CVector3> m_vecConvexHullPoints;
98 std::vector<CConvexHull::SFace> m_vecConvexHullFaces;
99 };
100
101}
102
103#endif
float Real
Collects all ARGoS code.
Definition datatypes.h:39
#define ARGOS_ASSERT(condition, message)
When code is compiled in debug, this macro throws an ARGoS exception with the passed message if the s...
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 std::string & GetId() const
Returns the id of this entity.
Definition entity.h:157
std::string GetContext() const
Returns the context of this entity.
Definition entity.cpp:79
An anchor related to the body of an entity.
A 3D vector class.
Definition vector3.h:31
CPrototypeLinkEntity(CComposableEntity *pc_parent)
const std::vector< CVector3 > & GetConvexHullPoints() const
const CVector3 & GetExtents() const
std::vector< CPrototypeLinkEntity * >::const_iterator TVectorConstIterator
const SAnchor & GetAnchor() const
std::vector< CPrototypeLinkEntity * >::iterator TVectorIterator
const std::vector< CConvexHull::SFace > & GetConvexHullFaces() const
virtual std::string GetTypeDescription() const
Returns a string label for this class.
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
std::vector< CPrototypeLinkEntity * > TVector