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>
10#include <argos3/plugins/simulator/entities/proximity_sensor_equipped_entity.h>
58 Real fNoiseLevel = 0.0f;
60 if(fNoiseLevel < 0.0f) {
61 THROW_ARGOSEXCEPTION(
"Can't specify a negative value for the noise level of the proximity sensor");
63 else if(fNoiseLevel > 0.0f) {
98 cScanningRay.
Set(cRayStart,cRayEnd);
148 if(f_distance <= 0.05)
150 value = 298.701f * pow(f_distance,2) - 36.8961f * f_distance + 1.08212f;
160 "epuck_proximity",
"default",
161 "Danesh Tarapore [daneshtarapore@gmail.com]",
163 "The E-Puck proximity sensor.",
165 "This sensor accesses the epuck proximity sensor. For a complete description\n"
166 "of its usage, refer to the ci_epuck_proximity_sensor.h interface. For the XML\n"
167 "configuration, refer to the default proximity sensor.\n",
unsigned int UInt32
32-bit unsigned integer.
float Real
Collects all ARGoS code.
#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.
#define REGISTER_SENSOR(CLASSNAME, LABEL, IMPLEMENTATION, AUTHOR, VERSION, BRIEF_DESCRIPTION, LONG_DESCRIPTION, STATUS)
Registers a new sensor model inside ARGoS.
The namespace containing all the ARGoS related code.
bool GetClosestEmbodiedEntityIntersectedByRay(SEmbodiedEntityIntersectionItem &s_item, const CRay3 &c_ray)
Returns the closest intersection with an embodied entity to the ray start.
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.
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.
An entity that contains a pointer to the user-defined controller.
This entity is a link to a body in the physics engine.
The exception that wraps all errors in ARGoS.
void TruncValue(T &t_value) const
Real GetDistance(Real f_t) const
void Set(const CVector3 &c_start, const CVector3 &c_end)
static CRNG * CreateRNG(const std::string &str_category)
Creates a new RNG inside the given category.
CVector3 & Rotate(const CQuaternion &c_quaternion)
Rotates this vector by the given quaternion.
const TReadings & GetReadings() const
virtual void Init(TConfigurationNode &t_tree)
Initializes the sensor from the XML configuration tree.
bool m_bAddNoise
Whether to add noise or not.
CControllableEntity * m_pcControllableEntity
Reference to controllable entity associated to this sensor.
CRandom::CRNG * m_pcRNG
Random number generator.
CEPuckProximityDefaultSensor()
virtual void SetRobot(CComposableEntity &c_entity)
Sets the entity associated to this sensor.
CSpace & m_cSpace
Reference to the space.
CEmbodiedEntity * m_pcEmbodiedEntity
Reference to embodied entity associated to this sensor.
virtual void Reset()
Resets the sensor to the state it had just after Init().
bool m_bShowRays
Flag to show rays in the simulator.
virtual void Update()
Updates the state of the entity associated to this sensor, if the sensor is currently enabled.
CRange< Real > m_cNoiseRange
Noise range.
CProximitySensorEquippedEntity * m_pcProximityEntity
Reference to proximity sensor equipped entity associated to this sensor.
virtual Real CalculateReading(Real f_distance)
Calculates the proximity reading when the closest occluding object is located as the given distance.