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>
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 Set(const Real f_x, const Real f_y, const Real f_z)
Sets the vector contents from Cartesian coordinates.
CLightSensorEquippedEntity(CComposableEntity *pc_parent)
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.
SSensor::TList m_tSensors
The list of sensors.
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].
CVector3 & RotateZ(const CRadians &c_angle)
Rotates this vector wrt the z axis.
REGISTER_STANDARD_SPACE_OPERATIONS_ON_ENTITY(CEntity)
This entity is a link to a body in the physics engine.
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
SSensor(const CVector3 &c_position, const CVector3 &c_direction, Real f_range, SAnchor &s_anchor)
#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.
void AddSensor(const CVector3 &c_position, const CVector3 &c_direction, Real f_range, SAnchor &s_anchor)
CComposableEntity & GetParent()
Returns this entity's parent.
void AddSensorRing(const CVector3 &c_center, Real f_radius, const CRadians &c_start_angle, Real f_range, UInt32 un_num_sensors, SAnchor &s_anchor)
CVector3 & Normalize()
Normalizes this vector.
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.
virtual ~CLightSensorEquippedEntity()
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.