8 #include <argos3/core/simulator/space/space.h>
9 #include <argos3/core/simulator/entity/composable_entity.h>
21 Direction(c_direction),
39 const std::string& str_id) :
67 if(t_tree.NoChildren()) {
72 for(it = it.begin(&t_tree); it != it.end(); ++it) {
73 std::string strAnchorId;
84 if(it->Value() ==
"sensor") {
92 else if(it->Value() ==
"ring") {
106 cRingStartAngleRadians,
126 for(
size_t i = 0; i <
m_tSensors.size(); ++i) {
136 for(
size_t i = 0; i <
m_tSensors.size(); ++i) {
163 for(
UInt32 i = 0; i < un_num_sensors; ++i) {
164 cAngle = c_start_angle + i * cSensorSpacing;
166 cPos.
Set(f_radius, 0.0f, 0.0f);
169 cDir.
Set(f_range, 0.0f, 0.0f);
171 AddSensor(cPos, cDir, f_range, s_anchor);
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.
CVector3 & RotateZ(const CRadians &c_angle)
Rotates this vector wrt the z axis.
void Enable()
Enables the entity.
float Real
Collects all ARGoS code.
#define THROW_ARGOSEXCEPTION(message)
This macro throws an ARGoS exception with the passed message.
CRadians & SignedNormalize()
Normalizes the value in the range [-PI:PI].
void AddSensor(const CVector3 &c_position, const CVector3 &c_direction, Real f_range, SAnchor &s_anchor)
static const CRadians TWO_PI
Set to PI * 2.
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
SSensor(const CVector3 &c_position, const CVector3 &c_direction, Real f_range, SAnchor &s_anchor)
This entity is a link to a body in the physics engine.
#define THROW_ARGOSEXCEPTION_NESTED(message, nested)
This macro throws an ARGoS exception with the passed message and nesting the passed exception...
It defines the basic type CDegrees, used to store an angle value in degrees.
It defines the basic type CRadians, used to store an angle value in radians.
SSensor::TList m_tSensors
The list of sensors.
unsigned int UInt32
32-bit unsigned integer.
void Set(const Real f_x, const Real f_y, const Real f_z)
Sets the vector contents from Cartesian coordinates.
Basic class for an entity that contains other entities.
An anchor related to the body of an entity.
ticpp::Iterator< ticpp::Element > TConfigurationNodeIterator
The iterator for the ARGoS configuration XML node.
void GetNodeAttribute(TConfigurationNode &t_node, const std::string &str_attribute, T &t_buffer)
Returns the value of a node's attribute.
The exception that wraps all errors in ARGoS.
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
void Disable()
Disables the entity.
REGISTER_STANDARD_SPACE_OPERATIONS_ON_ENTITY(CEntity)
const SAnchor & GetAnchor(const std::string &str_id) const
Returns the wanted anchor as a const reference.
CRadians ToRadians(const CDegrees &c_degrees)
Converts CDegrees to CRadians.
virtual ~CLightSensorEquippedEntity()
CComposableEntity & GetParent()
Returns this entity's parent.
The namespace containing all the ARGoS related code.
CLightSensorEquippedEntity(CComposableEntity *pc_parent)
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
CVector3 & Normalize()
Normalizes this vector.
void AddSensorRing(const CVector3 &c_center, Real f_radius, const CRadians &c_start_angle, Real f_range, UInt32 un_num_sensors, SAnchor &s_anchor)
CEntity & GetComponent(const std::string &str_component)
Returns the component with the passed string label.