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,
95 cBody.GetAnchor(strAnchorId));
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);
#define THROW_ARGOSEXCEPTION_NESTED(message, nested)
This macro throws an ARGoS exception with the passed message and nesting the passed exception.
#define THROW_ARGOSEXCEPTION(message)
This macro throws an ARGoS exception with the passed message.
unsigned int UInt32
32-bit unsigned integer.
float Real
Collects all ARGoS code.
The namespace containing all the ARGoS related code.
ticpp::Iterator< ticpp::Element > TConfigurationNodeIterator
The iterator for the ARGoS configuration XML node.
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.
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
CRadians ToRadians(const CDegrees &c_degrees)
Converts CDegrees to CRadians.
REGISTER_STANDARD_SPACE_OPERATIONS_ON_ENTITY(CEntity)
void GetNodeAttribute(TConfigurationNode &t_node, const std::string &str_attribute, T &t_buffer)
Returns the value of a node's attribute.
Basic class for an entity that contains other entities.
CEntity & GetComponent(const std::string &str_component)
Returns the component with the passed string label.
This entity is a link to a body in the physics engine.
void Disable()
Disables the entity.
void Enable()
Enables the entity.
CComposableEntity & GetParent()
Returns this entity's parent.
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
An anchor related to the body of an entity.
The exception that wraps all errors in ARGoS.
It defines the basic type CRadians, used to store an angle value in radians.
static const CRadians TWO_PI
Set to PI * 2.
CRadians & SignedNormalize()
Normalizes the value in the range [-PI:PI].
It defines the basic type CDegrees, used to store an angle value in degrees.
CVector2 & Rotate(const CRadians &c_angle)
Rotates this vector by the wanted angle.
void Set(Real f_x, Real f_y)
Sets the vector contents from Cartesian coordinates.
void AddSensor(const CVector2 &c_offset, ESensorType e_type, SAnchor &s_anchor)
CGroundSensorEquippedEntity(CComposableEntity *pc_parent)
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
ESensorType ParseType(const std::string &str_type) const
SSensor::TList m_tSensors
The list of sensors.
void AddSensorRing(const CVector2 &c_center, Real f_radius, const CRadians &c_start_angle, ESensorType e_type, UInt32 un_num_sensors, SAnchor &s_anchor)
virtual ~CGroundSensorEquippedEntity()