7 #include <argos3/core/simulator/simulator.h>
8 #include <argos3/plugins/simulator/entities/wheeled_entity.h>
9 #include <argos3/core/simulator/entity/composable_entity.h>
19 m_pcWheeledEntity(nullptr),
30 THROW_ARGOSEXCEPTION(
"The differential steering sensor can be associated only to a robot with 2 wheels");
98 "differential_steering",
"default",
99 "Carlo Pinciroli [ilpincy@gmail.com]",
101 "A generic differential steering sensor.",
103 "This sensor returns the current position and orientation of a robot. This sensor\n"
104 "can be used with any robot, since it accesses only the body component. In\n"
105 "controllers, you must include the ci_differential_steering_sensor.h header.\n\n"
107 "This sensor is enabled by default.\n\n"
109 "REQUIRED XML CONFIGURATION\n\n"
113 " <my_controller ...>\n"
117 " <differential_steering implementation=\"default\" />\n"
121 " </my_controller>\n"
123 " </controllers>\n\n"
125 "OPTIONAL XML CONFIGURATION\n\n"
127 "It is possible to add uniform noise to the sensor, thus matching the\n"
128 "characteristics of a real robot better. You can add noise through the\n"
129 "attributes 'vel_noise_range' and 'dist_noise_range'.\n"
130 "Attribute 'vel_noise_range' regulates the noise range on the velocity returned\n"
131 "by the sensor. Attribute 'dist_noise_range' sets the noise range on the\n"
132 "distance covered by the wheels.\n\n"
136 " <my_controller ...>\n"
140 " <differential_steering implementation=\"default\"\n"
141 " vel_noise_range=\"-0.1:0.2\"\n"
142 " dist_noise_range=\"-10.5:13.7\" />\n"
146 " </my_controller>\n"
148 " </controllers>\n\n",
#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.
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.
Real Distance(const CVector2 &c_v1, const CVector2 &c_v2)
Computes the distance between the passed vectors.
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.
const std::string & GetId() const
Returns the id of this entity.
void Enable()
Enables the entity.
static Real GetSimulationClockTick()
Returns the simulation clock tick.
The exception that wraps all errors in ARGoS.
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.
Real CoveredDistanceLeftWheel
Real CoveredDistanceRightWheel
CDifferentialSteeringDefaultSensor()
CRandom::CRNG * m_pcRNG
Random number generator.
virtual void Update()
Updates the state of the entity associated to this sensor, if the sensor is currently enabled.
const Real * m_pfWheelVelocities
The wheel velocity taken from the wheeled entity.
virtual void Init(TConfigurationNode &t_tree)
Initializes the sensor from the XML configuration tree.
CRange< Real > m_cVelNoiseRange
Noise range on velocity.
CWheeledEntity * m_pcWheeledEntity
Reference to wheeled entity associated to this sensor.
CRange< Real > m_cDistNoiseRange
Noise range on distance.
virtual void Reset()
Resets the sensor to the state it had just after Init().
bool m_bAddNoise
Whether to add noise or not.
virtual void SetRobot(CComposableEntity &c_entity)
Sets the entity associated to this sensor.
const Real * GetWheelVelocities() const
const CVector3 & GetWheelPosition(size_t un_index) const
size_t GetNumWheels() const