The motor controlling the color of the MarXbot. More...
Public Member Functions | |
MarXbotColorMotor (ConfigurationParameters ¶ms, QString prefix) | |
Constructor. | |
virtual | ~MarXbotColorMotor () |
Destructor. | |
virtual void | save (ConfigurationParameters ¶ms, QString prefix) |
Saves current parameters into the given ConfigurationParameters object. | |
virtual int | size () |
Returns the number of neurons required by this motor. | |
virtual void | update () |
Performs the motor update. | |
Public Member Functions inherited from MarXbotMotor | |
MarXbotMotor (ConfigurationParameters ¶ms, QString prefix) | |
Constructor. | |
virtual | ~MarXbotMotor () |
Destructor. | |
Public Member Functions inherited from Motor | |
Motor (ConfigurationParameters ¶ms, QString prefix) | |
Constructor and Configure. | |
~Motor () | |
Destructor. | |
QString | name () |
Return the name of the Sensor. | |
void | save (ConfigurationParameters ¶ms, QString prefix) |
Save the parameters into the ConfigurationParameters. | |
void | setName (QString name) |
Use this method for changing the name of the Sensor. | |
Public Member Functions inherited from ParameterSettableInConstructor | |
ParameterSettableInConstructor (ConfigurationParameters &, QString) | |
void | addObserver (RuntimeParameterObserver *obs) |
T | getRuntimeParameter (QString paramName) |
virtual ParameterSettableUI * | getUIManager () |
ParameterSettable () | |
virtual void | postConfigureInitialization () |
void | removeObserver (RuntimeParameterObserver *obs) |
void | setRuntimeParameter (QString paramName, T newvalue) |
QString | typeName () const |
Public Member Functions inherited from ParameterSettable | |
void | addObserver (RuntimeParameterObserver *obs) |
T | getRuntimeParameter (QString paramName) |
void | removeObserver (RuntimeParameterObserver *obs) |
void | setRuntimeParameter (QString paramName, T newvalue) |
QString | typeName () const |
Public Member Functions inherited from ConcurrentResourcesUser | |
void | addUsableResource (QString resource) |
void | addUsableResources (QStringList resources) |
void | declareResource (QString name, T *resource, QString lockBuddy="") |
void | deleteResource (QString name) |
T * | getResource (QString name, bool *resourceExists=NULL) |
bool | hasResource (QString name) const |
void | removeAllUsableResources () |
void | removeUsableResource (QString resource) |
void | removeUsableResources (QStringList resources) |
virtual void | shareResourcesWith (ResourcesUser *buddy) |
void | usableResources (QStringList resources) |
bool | usedResourcesExist (QStringList *nonExistingResources=NULL) const |
Static Public Member Functions | |
static void | describe (QString type) |
Generates a description of this class and its parameters. | |
Static Public Member Functions inherited from MarXbotMotor | |
static void | describe (QString type) |
Describes all the parameters for this sensor. | |
Static Public Member Functions inherited from Motor | |
static void | describe (QString type) |
Describe all the parameter for configuring the Motor. | |
Static Public Member Functions inherited from ParameterSettableInConstructor | |
static void | describe (QString type) |
static QString | fullParameterDescriptionPath (QString type, QString param) |
static QString | fullSubgroupDescriptionPath (QString type, QString sub) |
Static Public Member Functions inherited from ParameterSettable | |
static void | describe (QString type) |
static QString | fullParameterDescriptionPath (QString type, QString param) |
static QString | fullSubgroupDescriptionPath (QString type, QString sub) |
Additional Inherited Members | |
Public Types inherited from ParameterSettableInConstructor | |
enum | Property |
Public Types inherited from ConcurrentResourcesUser | |
typedef Resource::ResourceChangeType | ResourceChangeType |
Public Attributes inherited from ParameterSettableInConstructor | |
AllowMultiple | |
Default | |
IsList | |
IsMandatory | |
Static Public Attributes inherited from ParameterSettableInConstructor | |
static const double | Infinity |
static const int | MaxInteger |
static const int | MinInteger |
Protected Member Functions inherited from Motor | |
QString | actualResourceNameForMultirobot (QString resourceName) const |
Returns the actual resource name to use. | |
void | checkAllNeededResourcesExist () |
Checks whether all resources we need are existing and throws an exception if they aren't. | |
void | resetNeededResourcesCheck () |
Resets the check on needed resources so that the next call to checkAllNeededResourcesExist() will perform the full check and not the quick one. | |
Static Protected Member Functions inherited from ParameterSettableInConstructor | |
static Descriptor | addTypeDescription (QString type, QString shortHelp, QString longHelp=QString("")) |
static void | setGraphicalEditor (QString type) |
Protected Attributes inherited from MarXbotMotor | |
QString | m_marxbotResource |
The name of the resource associated with the MarXbot robot. | |
QString | m_neuronsIteratorResource |
The name of th resource associated with the neural network iterator. | |
Detailed Description
The motor controlling the color of the MarXbot.
This motor controls the color of a MarXbot robot. The robot can have one of two colors, an "on" color and an "off" color. When the output is above a certain threshold, the color is changed to the "on" color, when it is below a certain threshold, the color is changed to the "off" color. The two thresholds can have different values.
In addition to all parameters defined by the parent class (MarXbotMotor), this class also defines the following parameters:
- onColor: the "on" color. This is a string (see QColor::setNamedColor() for a description of possible formats). The default is "+00FF00"
- offColor: the "off" color. This is a string (see QColor::setNamedColor() for a description of possible formats). The default is "+0000FF"
- onThreshold: the value above which the color is switched to the "on" color. The default value is 0.8
- offThreshold: the value below which the color is switched to the "off" color. The default value is 0.2 We have to use + in place of # for colors because # is the comment in .ini files...
The resources required by this Motor are the same as those of the parent class
Definition at line 217 of file marxbotmotors.h.
Constructor & Destructor Documentation
MarXbotColorMotor | ( | ConfigurationParameters & | params, |
QString | prefix | ||
) |
Constructor.
Creates and configures the motor
- Parameters
-
params the ConfigurationParameters containing the parameters prefix the path prefix to the paramters for this Sensor
Definition at line 164 of file marxbotmotors.cpp.
References ConfigurationParameters::getValue(), and ConfigurationHelper::throwUserConfigError().
|
virtual |
Destructor.
Definition at line 184 of file marxbotmotors.cpp.
Member Function Documentation
|
static |
Generates a description of this class and its parameters.
- Parameters
-
type the string representation of this class name
Definition at line 202 of file marxbotmotors.cpp.
References ParameterSettableInConstructor::addTypeDescription(), ParameterSettable::StringDescriptor::def(), ParameterSettable::RealDescriptor::def(), MarXbotMotor::describe(), ParameterSettable::Descriptor::describeReal(), ParameterSettable::Descriptor::describeString(), ParameterSettable::RealDescriptor::help(), ParameterSettable::StringDescriptor::help(), and ParameterSettable::RealDescriptor::limits().
|
virtual |
Saves current parameters into the given ConfigurationParameters object.
- Parameters
-
params the ConfigurationParameters object in which parameters should be saved prefix the name and path of the group where to save parametrs
Reimplemented from MarXbotMotor.
Definition at line 189 of file marxbotmotors.cpp.
References ConfigurationParameters::createParameter(), MarXbotMotor::save(), and ConfigurationParameters::startObjectParameters().
|
virtual |
Returns the number of neurons required by this motor.
- Returns
- the number of neurons required by this motor
Implements Motor.
Definition at line 234 of file marxbotmotors.cpp.
|
virtual |
Performs the motor update.
Implements Motor.
Definition at line 214 of file marxbotmotors.cpp.
References Motor::checkAllNeededResourcesExist(), NeuronsIterator::getOutput(), Motor::name(), PhyMarXbot::setColor(), and NeuronsIterator::setCurrentBlock().
The documentation for this class was generated from the following files:
- experiments/include/marxbotmotors.h
- experiments/src/marxbotmotors.cpp