7 #include <argos3/core/simulator/simulator.h>
8 #include <argos3/core/simulator/entity/embodied_entity.h>
9 #include <argos3/core/simulator/entity/composable_entity.h>
19 m_pcEmbodiedEntity(nullptr),
93 "positioning",
"default",
94 "Carlo Pinciroli [ilpincy@gmail.com]",
96 "A generic positioning sensor.",
98 "This sensor returns the current position and orientation of a robot. This sensor\n"
99 "can be used with any robot, since it accesses only the body component. In\n"
100 "controllers, you must include the ci_positioning_sensor.h header.\n\n"
102 "This sensor is enabled by default.\n\n"
104 "REQUIRED XML CONFIGURATION\n\n"
107 " <my_controller ...>\n"
111 " <positioning implementation=\"default\" />\n"
115 " </my_controller>\n"
117 " </controllers>\n\n"
119 "OPTIONAL XML CONFIGURATION\n\n"
121 "It is possible to add uniform noise to the sensor, thus matching the\n"
122 "characteristics of a real robot better. You can add noise through the\n"
123 "attributes 'pos_noise_range', 'angle_noise_range', and 'axis_noise_range'.\n"
124 "Attribute 'pos_noise_range' regulates the noise range on the position returned\n"
125 "by the sensor. Attribute 'angle_noise_range' sets the noise range on the angle\n"
126 "(values expressed in degrees). Attribute 'axis_noise_range' sets the noise for\n"
127 "the rotation axis. Angle and axis are used to calculate a quaternion, which is\n"
128 "the actual returned value for rotation.\n\n"
132 " <my_controller ...>\n"
136 " <positioning implementation=\"default\"\n"
137 " pos_noise_range=\"-0.1:0.2\"\n"
138 " angle_noise_range=\"-10.5:13.7\"\n"
139 " axis_noise_range=\"-0.3:0.4\" />\n"
143 " </my_controller>\n"
145 " </controllers>\n\n"
147 "OPTIONAL XML CONFIGURATION\n\n"
#define THROW_ARGOSEXCEPTION_NESTED(message, nested)
This macro throws an ARGoS exception with the passed message and nesting the passed exception.
The namespace containing all the ARGoS related code.
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.
REGISTER_SENSOR(CEPuckProximityDefaultSensor, "epuck_proximity", "default", "Danesh Tarapore [daneshtarapore@gmail.com]", "1.0", "The E-Puck proximity sensor.", "This sensor accesses the epuck proximity sensor. For a complete description\n" "of its usage, refer to the ci_epuck_proximity_sensor.h interface. For the XML\n" "configuration, refer to the default proximity sensor.\n", "Usable")
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
virtual void Enable()
Enables updating of sensor information in the event loop.
virtual void Init(TConfigurationNode &t_node)
Initializes the sensor from the XML configuration tree.
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.
const SAnchor & GetOriginAnchor() const
Returns a const reference to the origin anchor associated to this entity.
CQuaternion Orientation
The orientation of the anchor wrt the global coordinate system.
CVector3 Position
The position of the anchor wrt the global coordinate system.
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 ZERO
Set to zero radians.
void ToAngleAxis(CRadians &c_angle, CVector3 &c_vector) const
CQuaternion & FromAngleAxis(const CRadians &c_angle, const CVector3 &c_vector)
static CRNG * CreateRNG(const std::string &str_category)
Creates a new RNG inside the given category.
CRadians Uniform(const CRange< CRadians > &c_range)
Returns a random value from a uniform distribution.
virtual void Update()
Updates the state of the entity associated to this sensor, if the sensor is currently enabled.
CPositioningDefaultSensor()
CRange< CRadians > m_cAngleNoiseRange
Noise range on angle.
CEmbodiedEntity * m_pcEmbodiedEntity
Reference to embodied entity associated to this sensor.
CRange< Real > m_cAxisNoiseRange
Noise range on axis.
bool m_bAddNoise
Whether to add noise or not.
virtual void SetRobot(CComposableEntity &c_entity)
Sets the entity associated to this sensor.
virtual void Init(TConfigurationNode &t_tree)
Initializes the sensor from the XML configuration tree.
virtual void Reset()
Resets the sensor to the state it had just after Init().
CRange< Real > m_cPosNoiseRange
Noise range on position.
CRandom::CRNG * m_pcRNG
Random number generator.