epucksensors.cpp
39 m_epuckResource = actualResourceNameForMultirobot(ConfigurationHelper::getString(params, prefix + "epuck", m_epuckResource));
40 m_neuronsIteratorResource = actualResourceNameForMultirobot(ConfigurationHelper::getString(params, prefix + "neuronsIterator", m_neuronsIteratorResource));
69 d.describeString("epuck").def("robot").help("the name of the resource associated with the e-puck robot to use (default is \"robot\")");
70 d.describeString("neuronsIterator").def("neuronsIterator").help("the name of the resource associated with the neural network iterator (default is \"neuronsIterator\")");
86 EpuckProximityIRSensor::EpuckProximityIRSensor(ConfigurationParameters& params, QString prefix) :
113 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");
126 m_neuronsIterator->setInput(applyNoise(m_robot->proximityIRSensorController()->activation(i), 0.0, 1.0));
135 void EpuckProximityIRSensor::resourceChanged(QString resourceName, ResourceChangeType changeType)
190 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.");
204 const wVector sensorPosition = m_robot->matrix().transformVector(m_robot->groundIRSensorController()->sensors()[i].getPosition());
245 EpuckLinearCameraSensor::EpuckLinearCameraSensor(ConfigurationParameters& params, QString prefix) :
282 Descriptor d = addTypeDescription(type, "The linear camera sensor of the e-puck robot", "This is a linear camera with configurable aperture");
283 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)");
284 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)");
286 d.describeBool("ignoreWalls").def(false).help("whether to perceive walls or not (default is false)");
318 void EpuckLinearCameraSensor::resourceChanged(QString resourceName, ResourceChangeType changeType)
342 m_camera = new LinearCamera(m_robot, mtr, toRad(m_aperture), m_numReceptors, std::numeric_limits<double>::infinity(), Qt::black);
353 m_neuronsIterator->setGraphicProperties("lr" + QString::number(i % m_numReceptors), 0.0, 1.0, Qt::red);
356 m_neuronsIterator->setGraphicProperties("lg" + QString::number(i % m_numReceptors), 0.0, 1.0, Qt::red);
359 m_neuronsIterator->setGraphicProperties("lb" + QString::number(i % m_numReceptors), 0.0, 1.0, Qt::red);
366 EpuckSampledProximityIRSensor::EpuckSampledProximityIRSensor(ConfigurationParameters& params, QString prefix) :
377 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()));
380 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()));
383 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()));
413 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");
414 d.describeString("roundSamples").def("round.sam").help("The name of the file with samples for big round objects");
415 d.describeString("smallSamples").def("small.sam").help("The name of the file with samples for small round objects");
416 d.describeString("wallSamples").def("wall.sam").help("The name of the file with samples for walls");
433 // Cycling through the list of objects. We first need to get the current position and orientation of the robot
437 // Computing angle and distance. We don't need to remove the robot to which this sensor belongs because
443 if (!obj->computeDistanceAndOrientationFromRobot(*(m_arena->getRobotWrapper(m_epuckResource)), distance, angle)) {
461 //Logger::warning("The sampled infrared sensor only works with Small Cylinders, Big Cylinders, Walls and other Robots");