epucksensors.cpp
38 m_epuckResource = actualResourceNameForMultirobot(ConfigurationHelper::getString(params, prefix + "epuck", m_epuckResource));
39 m_neuronsIteratorResource = actualResourceNameForMultirobot(ConfigurationHelper::getString(params, prefix + "neuronsIterator", m_neuronsIteratorResource));
68 d.describeString("epuck").def("robot").help("the name of the resource associated with the e-puck robot to use (default is \"robot\")");
69 d.describeString("neuronsIterator").def("neuronsIterator").help("the name of the resource associated with the neural network iterator (default is \"neuronsIterator\")");
85 EpuckProximityIRSensor::EpuckProximityIRSensor(ConfigurationParameters& params, QString prefix) :
112 Descriptor d = addTypeDescription(type, "The infrared proximity sensors of the e-puck robot", "The infrared proximity sensors of the e-puck robot. These are the very short range IR sensors all around the base");
134 void EpuckProximityIRSensor::resourceChanged(QString resourceName, ResourceChangeType changeType)
186 Descriptor d = addTypeDescription(type, "The infrared ground sensors of the e-puck robot", "The infrared ground sensors of the e-puck robot. These are the three ground sensors in the frontal part of the robot.");
233 EpuckLinearCameraSensor::EpuckLinearCameraSensor(ConfigurationParameters& params, QString prefix) :
268 Descriptor d = addTypeDescription(type, "The linear camera sensor of the e-puck robot", "This is a linear camera with configurable aperture");
269 d.describeInt("numReceptors").def(8).limits(1, MaxInteger).help("The number of receptors of the sensor", "Each receptor returns three values, one for each of the three colors (red, green, blue). This means that the size returned by this sensor is 3 * numReceptors (default is 8)");
270 d.describeReal("aperture").def(360.0f).limits(0.0f, 360.0f).help("The aperture of the camera in degrees", "The real e-puck has a camera with an aperture of 36 degrees, but here you can use any value up to 360° (default is 36)");
303 void EpuckLinearCameraSensor::resourceChanged(QString resourceName, ResourceChangeType changeType)
337 m_neuronsIterator->setGraphicProperties("lr" + QString::number(i % m_numReceptors), 0.0, 1.0, Qt::red);
340 m_neuronsIterator->setGraphicProperties("lg" + QString::number(i % m_numReceptors), 0.0, 1.0, Qt::red);
343 m_neuronsIterator->setGraphicProperties("lb" + QString::number(i % m_numReceptors), 0.0, 1.0, Qt::red);
350 EpuckSampledProximityIRSensor::EpuckSampledProximityIRSensor(ConfigurationParameters& params, QString prefix) :
361 ConfigurationHelper::throwUserConfigError(prefix + "roundSamples", m_roundSamples.filename(), "The file has samples for the wrong number of sensors, expected 8, got " + QString::number(m_roundSamples.numIR()));
364 ConfigurationHelper::throwUserConfigError(prefix + "smallSamples", m_smallSamples.filename(), "The file has samples for the wrong number of sensors, expected 8, got " + QString::number(m_smallSamples.numIR()));
367 ConfigurationHelper::throwUserConfigError(prefix + "wallSamples", m_wallSamples.filename(), "The file has samples for the wrong number of sensors, expected 8, got " + QString::number(m_wallSamples.numIR()));
397 Descriptor d = addTypeDescription(type, "The sampled proximity infrared sensors of the e-puck", "This is the sampled version of the proximity infrared sensors of the e-puck. This sensor only works with objects created using the Arena");
398 d.describeString("roundSamples").def("round.sam").help("The name of the file with samples for big round objects");
399 d.describeString("smallSamples").def("small.sam").help("The name of the file with samples for small round objects");
400 d.describeString("wallSamples").def("wall.sam").help("The name of the file with samples for walls");
417 // Cycling through the list of objects. We first need to get the current position and orientation of the robot
421 // Computing angle and distance. We don't need to remove the robot to which this sensor belongs because
427 if (!obj->computeDistanceAndOrientationFromRobot(*(m_arena->getRobotWrapper(m_epuckResource)), distance, angle)) {
445 Logger::warning("The sampled infrared sensor only works with Small Cylinders, Big Cylinders, Walls and other Robots");