ARGoS
3
A parallel, multi-engine simulator for swarm robotics
|
Go to the documentation of this file.
7 #ifndef EMBODIED_ENTITY_H
8 #define EMBODIED_ENTITY_H
11 class CEmbodiedEntity;
14 #include <argos3/core/simulator/entity/entity.h>
15 #include <argos3/core/simulator/space/positional_indices/grid.h>
16 #include <argos3/core/simulator/space/positional_indices/space_hash.h>
17 #include <argos3/core/utility/datatypes/set.h>
18 #include <argos3/core/utility/math/ray3.h>
19 #include <argos3/core/utility/math/quaternion.h>
20 #include <argos3/core/simulator/physics_engine/physics_engine.h>
21 #include <argos3/core/simulator/physics_engine/physics_model.h>
75 const std::string& str_id,
78 bool b_movable =
true);
297 bool b_check_only =
false);
341 const std::string& str_id);
356 class CEmbodiedEntitySpaceHashUpdater :
public CSpaceHashUpdater<CEmbodiedEntity> {
365 SInt32 m_nMinX, m_nMinY, m_nMinZ;
366 SInt32 m_nMaxX, m_nMaxY, m_nMaxZ;
386 SInt32 m_nMinI, m_nMinJ, m_nMinK;
387 SInt32 m_nMaxI, m_nMaxJ, m_nMaxK;
const SAnchor & GetOriginAnchor() const
Returns a const reference to the origin anchor associated to this entity.
CPhysicsModel::TMap m_tPhysicsModelMap
The abstract definition of a space hash.
bool IsAnchorEnabled(const std::string &str_id)
Returns true if the given anchor is enabled, false otherwise.
The namespace containing all the ARGoS related code.
const SAnchor & GetAnchor(const std::string &str_id) const
Returns the wanted anchor as a const reference.
Basic class for an entity that contains other entities.
virtual void AddPhysicsModel(const std::string &str_engine_id, CPhysicsModel &c_physics_model)
Adds a new physics model to this embodied entity.
bool IsMovable() const
Returns true if the entity is movable.
void SetMovable(bool b_movable)
Sets whether this entity is movable or not.
void EnableAnchor(const std::string &str_id)
Enables an anchor.
CSet< CEmbodiedEntity * > TEmbodiedEntitySet
CQuaternion m_cInitOriginOrientation
SAnchor & GetOriginAnchor()
Returns a non-const reference to the origin anchor associated to this entity.
This entity is a link to a body in the physics engine.
virtual bool MoveTo(const CVector3 &c_position, const CQuaternion &c_orientation, bool b_check_only=false)
Moves the entity to the wanted position and orientation.
std::vector< CPhysicsModel * > TVector
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
SAnchor * m_psOriginAnchor
std::map< std::string, SAnchor * > & GetAnchors()
Returns a map of anchors associated to this embodied entity.
Defines the basic cell updater of the space hash.
std::vector< CEmbodiedEntity * > TEmbodiedEntityVector
virtual bool IsCollidingWithSomething() const
Returns true if this entity is colliding with another object.
CPhysicsModel::TVector m_tPhysicsModelVector
CEmbodiedEntityGridUpdater(CGrid< CEmbodiedEntity > &c_grid)
virtual ~CEmbodiedEntity()
Class destructor.
void CalculateBoundingBox()
Calculates the bounding box of this entity.
An anchor related to the body of an entity.
void DisableAnchor(const std::string &str_id)
Disables an anchor.
virtual bool operator()(CEmbodiedEntity &c_entity)
signed int SInt32
32-bit signed integer.
CEmbodiedEntity(CComposableEntity *pc_parent)
Class constructor.
bool operator==(const SAnchor *ps_anchor, const std::string &str_id)
Returns true if the anchor id matches the given id.
CVector3 m_cInitOriginPosition
void RemovePhysicsModel(const std::string &str_engine_id)
Removes a physics model from this embodied entity.
const CPhysicsModel & GetPhysicsModel(size_t un_idx) const
Returns a physics model associated to this entity.
std::map< std::string, SAnchor * > m_mapAnchors
unsigned int UInt32
32-bit unsigned integer.
UInt32 GetPhysicsModelsNum() const
Returns the number of physics models associated to this entity.
SBoundingBox * m_sBoundingBox
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
std::map< std::string, CPhysicsModel * > TMap
SAnchor & AddAnchor(const std::string &str_id, const CVector3 &c_rel_position=CVector3(), const CQuaternion &c_rel_orientation=CQuaternion())
Adds an anchor to the embodied entity.
std::vector< SAnchor * > m_vecEnabledAnchors
virtual void Reset()
Resets the state of the entity to whatever it was after Init() or the standalone constructor was call...
virtual std::string GetTypeDescription() const
Returns a string label for this class.
const SBoundingBox & GetBoundingBox() const
Returns the bounding box of this embodied entity.
Defines a very simple double-linked list that stores unique elements.
std::map< std::string, CEmbodiedEntity * > TEmbodiedEntityMap
std::vector< SAnchor * > & GetEnabledAnchors()
Returns a vector of enabled anchors for fast looping.