ARGoS
3
A parallel, multi-engine simulator for swarm robotics
|
Go to the documentation of this file.
8 #include <argos3/core/simulator/space/space.h>
9 #include <argos3/core/simulator/entity/composable_entity.h>
25 const std::string& str_id) :
53 if(t_tree.NoChildren()) {
58 for(it = it.begin(&t_tree); it != it.end(); ++it) {
59 std::string strAnchorId;
70 if(it->Value() ==
"sensor") {
77 else if(it->Value() ==
"ring") {
92 cRingStartAngleRadians,
112 for(
size_t i = 0; i <
m_tSensors.size(); ++i) {
122 for(
size_t i = 0; i <
m_tSensors.size(); ++i) {
148 for(
UInt32 i = 0; i < un_num_sensors; ++i) {
149 cAngle = c_start_angle + i * cSensorSpacing;
151 cOffset.
Set(f_radius, 0.0f);
The namespace containing all the ARGoS related code.
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
const SAnchor & GetAnchor(const std::string &str_id) const
Returns the wanted anchor as a const reference.
It defines the basic type CRadians, used to store an angle value in radians.
Basic class for an entity that contains other entities.
The exception that wraps all errors in ARGoS.
CEntity & GetComponent(const std::string &str_component)
Returns the component with the passed string label.
void Enable()
Enables the entity.
CRadians & SignedNormalize()
Normalizes the value in the range [-PI:PI].
REGISTER_STANDARD_SPACE_OPERATIONS_ON_ENTITY(CEntity)
This entity is a link to a body in the physics engine.
void AddSensor(const CVector2 &c_offset, ESensorType e_type, SAnchor &s_anchor)
void Set(Real f_x, Real f_y)
Sets the vector contents from Cartesian coordinates.
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
#define THROW_ARGOSEXCEPTION_NESTED(message, nested)
This macro throws an ARGoS exception with the passed message and nesting the passed exception.
ticpp::Iterator< ticpp::Element > TConfigurationNodeIterator
The iterator for the ARGoS configuration XML node.
#define THROW_ARGOSEXCEPTION(message)
This macro throws an ARGoS exception with the passed message.
An anchor related to the body of an entity.
SSensor::TList m_tSensors
The list of sensors.
ESensorType ParseType(const std::string &str_type) const
CComposableEntity & GetParent()
Returns this entity's parent.
virtual ~CGroundSensorEquippedEntity()
unsigned int UInt32
32-bit unsigned integer.
void GetNodeAttributeOrDefault(TConfigurationNode &t_node, const std::string &str_attribute, T &t_buffer, const T &t_default)
Returns the value of a node's attribute, or the passed default value.
void Disable()
Disables the entity.
void GetNodeAttribute(TConfigurationNode &t_node, const std::string &str_attribute, T &t_buffer)
Returns the value of a node's attribute.
It defines the basic type CDegrees, used to store an angle value in degrees.
CRadians ToRadians(const CDegrees &c_degrees)
Converts CDegrees to CRadians.
CVector2 & Rotate(const CRadians &c_angle)
Rotates this vector by the wanted angle.
static const CRadians TWO_PI
Set to PI * 2.
float Real
Collects all ARGoS code.
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
void AddSensorRing(const CVector2 &c_center, Real f_radius, const CRadians &c_start_angle, ESensorType e_type, UInt32 un_num_sensors, SAnchor &s_anchor)
CGroundSensorEquippedEntity(CComposableEntity *pc_parent)