7 #include <argos3/core/simulator/entity/embodied_entity.h>
8 #include <argos3/core/simulator/entity/composable_entity.h>
9 #include <argos3/core/simulator/simulator.h>
18 class CProximitySensorImpl :
public CProximityDefaultSensor {
23 if(f_distance < 0.009889556) {
27 return 0.0100527 / (f_distance + 0.000163144);
43 delete m_pcProximityImpl;
51 m_pcProximityImpl->
SetRobot(c_entity);
62 m_pcProximityImpl->
Init(t_tree);
69 m_pcProximityImpl->
Update();
70 for(
size_t i = 0; i < m_pcProximityImpl->
GetReadings().size(); ++i) {
79 m_pcProximityImpl->
Reset();
86 "footbot_proximity",
"default",
87 "Carlo Pinciroli [ilpincy@gmail.com]",
89 "The foot-bot proximity sensor.",
90 "This sensor accesses the foot-bot proximity sensor. For a complete description\n"
91 "of its usage, refer to the ci_footbot_proximity_sensor.h interface. For the XML\n"
92 "configuration, refer to the default proximity sensor.\n",
#define THROW_ARGOSEXCEPTION_NESTED(message, nested)
This macro throws an ARGoS exception with the passed message and nesting the passed exception.
float Real
Collects all ARGoS code.
The namespace containing all the ARGoS related code.
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.
Basic class for an entity that contains other entities.
The exception that wraps all errors in ARGoS.
virtual Real CalculateReading(Real f_distance)
Calculates the proximity reading when the closest occluding object is located as the given distance.
virtual void Init(TConfigurationNode &t_tree)
Initializes the sensor from the XML configuration tree.
virtual ~CFootBotProximityDefaultSensor()
CFootBotProximityDefaultSensor()
virtual void Update()
Updates the state of the entity associated to this sensor, if the sensor is currently enabled.
virtual void Reset()
Resets the sensor to the state it had just after Init().
virtual void SetRobot(CComposableEntity &c_entity)
Sets the entity associated to this sensor.
const std::vector< Real > & GetReadings() const
virtual void SetRobot(CComposableEntity &c_entity)
Sets the entity associated to this sensor.
virtual void Update()
Updates the state of the entity associated to this sensor, if the sensor is currently enabled.
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().