The episodicMemory module maintains as associative memory of images: More...
The episodicMemory module maintains as associative memory of images:
Since images are streamed continuously, the module reads an image with a pre-set but definable frequency. However, the recall is triggered by the input of a gaze command, typically produced by the attentionSelection module. In addition, before reading the module checks to ensure that the iCub head is not in motion so that the eyes are fixating on something. A configuration option - offline - allows this check to be switched off.
The frequency at which images are read and the threshold defining whether or not an input image adequately matches a stored image are both provided as module parameters, set in the episodicMemory configuration file. The thresold can also be set interactively via the episodicMemory port.
The episodicMemory module has the following inputs:
The episodicMemory has the following outputs:
YARP.
Command Line Parameters
The following key-value pairs can be specified as command-line parameters by prefixing -- to the key (e.g. --from file.ini. The value part can be changed to suit your needs; the default values are shown below.
from episodicMemory.ini context episodicMemory/conf $ICUB_ROOT/icub/app to the configuration filename episodicMemory robot icub Configuration File Parameters
The following key-value pairs can be specified as parameters in the configuration file (they can also be specified as command-line parameters if you so wish). The value part can be changed to suit your needs; the default values are shown below.
imageInPort /image:i imageIdInPort /imageId:i actionInPort /action:i headPort /head:i recalledImageOutPort /recalledImage:o retrievedImageOutPort /retrievedImage:o imageIdOutPort /imageId:o database episodicDatabase path ~/iCub/app/episodicMemory threshold 0.75 frequency 2 offline 0 The database parameter specifies the name of the directory in which the database of images is stored. This directory must be created before running the module.
The path parameter specifies the full path to the database directory. This is where the where the database of image files is stored.
The threshold parameter determines which, if any, of the stored images are recalled: images which match the input image with a value that equals or exceeds the threshold are recalled and if more than one image exceeds the threshold, the image with the highest match is recalled.
For example, if the configuration file episodicMemory.ini is located in C:/iCub/app/episodicMemory/conf and the database is C:/iCub/app/episodicMemory/episodicDatabase then
episodicMemory module must be invoked with --context episodicMemory/conf episodicMemory.ini must contain "path C:/iCub/app/episodicMemory" C:/iCub/app/episodicMemory/episodicDatabase must exist.None
Input ports
/episodicMemory This port is used to change the parameters of the module at run time or stop the module. help
quit
set thr <n> ... set the threshold for image recall (where <n> is a real number in the range 0-1)
Note that the name of this port mirrors whatever is provided by the --name parameter value The port is attached to the terminal so that you can type in commands and receive replies. The port can be used by other modules but also interactively by a user through the yarp rpc directive, viz.: yarp rpc /episodicMemory This opens a connection from a terminal to the port and allows the user to then type in commands and receive replies.
/episodicMemory/image:i/episodicMemory/imageId:i/episodicMemory/action:i/episodicMemory/head:i /icub/head/state:o to get the gaze values.Output ports
/episodicMemory /episodicMemory/recalledImage:o/episodicMemory/retrievedImage:o/episodicMemory/imageId:oThe functional specification only names the ports to be used to communicate with the module but doesn't say anything about the data transmitted on the ports. This is defined by the following code.
I/O Port Types & Naming
BufferedPort<ImageOf<PixelRgb> > imageInPort;BufferedPort<VectorOf<double> > imageIdInPort; // image_id BufferedPort<VectorOf<double> > actionInPort; // azimuth, elevation 'a' 0 0 BufferedPort<ImageOf<PixelRgb> > recalledImageOutPort;BufferedPort<ImageOf<PixelRgb> > retrievedImageOutPort;BufferedPort<VectorOf<double> > imageIdOutPort; // image_id, match_value, azimuth, elevation, previous_image_id, match_value, azimuth, elevation BufferedPort<Vector> headPort;Note that the format of the actionInPort is exactly that defined by the /pos port of the controlGaze2 module.
episodicDatabase (see above)
None
episodicMemory.ini (see above)
Linux and Windows
episodicMemory --context episodicMemory/conf --from episodicMemory.ini
Copyright (C) 2009 RobotCub Consortium
CopyPolicy: Released under the terms of the GNU GPL v2.0.
This file can be edited at src/episodicMemory/include/iCub/episodicMemoryModule.h
1.7.1