kheperamotors.cpp
36 m_kheperaResource = actualResourceNameForMultirobot(ConfigurationHelper::getString(params, prefix + "khepera", m_kheperaResource));
37 m_neuronsIteratorResource = actualResourceNameForMultirobot(ConfigurationHelper::getString(params, prefix + "neuronsIterator", m_neuronsIteratorResource));
66 d.describeString("khepera").def("robot").help("The name of the resource associated with the Khepera robot to use (default is \"robot\")");
67 d.describeString("neuronsIterator").def("neuronsIterator").help("The name of the resource associated with the neural network iterator (default is \"neuronsIterator\")");
83 KheperaWheelVelocityMotor::KheperaWheelVelocityMotor(ConfigurationParameters& params, QString prefix) :
110 Descriptor d = addTypeDescription(type, "The motor controlling the velocity of the wheels of the khepera robot");
128 // Computing desired wheel velocities. When appying noise we don't check boundaries, so robots could go a bit faster than their maximum speed
130 const double v1 = (maxSpeed1 - minSpeed1) * applyNoise(m_neuronsIterator->getOutput(), 0.0, -1.0) + minSpeed1;
132 const double v2 = (maxSpeed2 - minSpeed2) * applyNoise(m_neuronsIterator->getOutput(), 0.0, -1.0) + minSpeed2;
142 void KheperaWheelVelocityMotor::resourceChanged(QString resourceName, ResourceChangeType changeType)
void usableResources(QStringList resources)
double applyNoise(double v, double minValue, double maxValue) const
Adds noise to the value.
Definition: neuroninterfaces.cpp:96
virtual void save(ConfigurationParameters ¶ms, QString prefix)
Saves current parameters into the given ConfigurationParameters object.
Definition: kheperamotors.cpp:95
virtual void update()
Performs the motor update. This also modifies the activation of input neurons.
Definition: kheperamotors.cpp:113
static void describe(QString type)
Describes all the parameters for this sensor.
Definition: kheperamotors.cpp:59
static QString getString(ConfigurationParameters ¶ms, QString paramPath, QString def=QString())
void save(ConfigurationParameters ¶ms, QString prefix)
Save the parameters into the ConfigurationParameters.
Definition: neuroninterfaces.cpp:201
QString m_kheperaResource
The name of the resource associated with the khepera robot.
Definition: kheperamotors.h:104
void setSpeeds(QVector< double > speeds)
virtual int size()
Returns the number of neurons required by this motor.
Definition: kheperamotors.cpp:137
void checkAllNeededResourcesExist()
Checks whether all resources we need are existing and throws an exception if they aren't...
Definition: neuroninterfaces.cpp:231
virtual void save(ConfigurationParameters ¶ms, QString prefix)
Saves the parameters of the sensor into the ConfigurationParameters object.
Definition: kheperamotors.cpp:48
void resetNeededResourcesCheck()
Resets the check on needed resources so that the next call to checkAllNeededResourcesExist() will per...
Definition: neuroninterfaces.cpp:246
virtual void resourceChanged(QString resourceName, ResourceChangeType changeType)
The function called when a resource used here is changed.
Definition: kheperamotors.cpp:70
virtual bool nextNeuron()=0
Go to the next neuron of the current block.
virtual bool setCurrentBlock(QString blockName)=0
Set the current blocks of neurons to iterate.
KheperaWheelVelocityMotor(ConfigurationParameters ¶ms, QString prefix)
Constructor.
Definition: kheperamotors.cpp:83
QString m_neuronsIteratorResource
The name of th resource associated with the neural network iterator.
Definition: kheperamotors.h:110
WheelMotorController * wheelsController()
virtual void resourceChanged(QString name, ResourceChangeType changeType)
void getSpeedLimits(QVector< double > &minSpeeds, QVector< double > &maxSpeeds) const
static void info(QString msg)
KheperaMotor(ConfigurationParameters ¶ms, QString prefix)
Constructor.
Definition: kheperamotors.cpp:30
bool startObjectParameters(QString groupPath, QString typeName, ParameterSettable *object)
static void describe(QString type)
Generates a description of this class and its parameters.
Definition: kheperamotors.cpp:104
static Descriptor addTypeDescription(QString type, QString shortHelp, QString longHelp=QString(""))
QString actualResourceNameForMultirobot(QString resourceName) const
Returns the actual resource name to use.
Definition: neuroninterfaces.cpp:251
virtual void setGraphicProperties(QString label, double minValue, double maxValue, QColor color)=0
Set the graphic properties for the current neuron (in case it will be visualized on a GUI) ...
static void describe(QString type)
Describe all the parameter for configuring the Motor.
Definition: neuroninterfaces.cpp:214
void createParameter(QString groupPath, QString parameter)
ResourceChangeType