Overview

ALRedBallDetection is a module which can detect red ball based on color saturation.
The output value is written in ALMemory in the redBallDetected microEvent.
It contains an array of tags, with the following format.
[ [time_info], [ball_info], [camera_info] ]

Tag time_info = [timestamp_seconds, timestamp_microseconds]
The time Stamp when image was take.

Tag ball_info = [u, v, centerX, centerY, radius, score]
u and v are the average u and v components in the YUV color space
centerX and centerY are the angular coordinates in camera angles.
radius is the ball radius in pixel and score is 1.0 if red ball detected and 0.0 else.

Tag camera_info = [x, y, z, wx, wy, wz] in NAO_SPACE (see motion documentation)

Subscribe to this module with a minimum of 60ms period.


Methods inherited from ALModule

void exit ()

Exits and unregisters the module.

string version ()

Returns the version of the module.

Returns

A string containing the version of the module.

bool ping ()

Just a ping. Always returns true

Returns

returns true

vector<string> getMethodList ()

Retrieves the module's method list.

Returns

An array of method names.

AL::ALValue getMethodHelp (const string& methodName)

Retrieves a method's description.

methodName

The name of the method.

Returns

A structure containing the method's description.

AL::ALValue getModuleHelp ()

Retrieves the module's description.

Returns

A structure describing the module.

string getBrokerName ()

Gets the name of the parent broker.

Returns

The name of the parent broker.

string getUsage (const string& name)

Gets the method usage string. This summarise how to use the method.

name

The name of the method.

Returns

A string that summarises the usage of the method.


Methods inherited from ALExtractor

void subscribe (const string& name, const int& period, const float& precision)

Subscribes to the extractor. This causes the extractor to start writing information to memory using the keys described by getOutputNames(). These can be accessed in memory using ALMemory.getData("keyName"). In many cases you can avoid calling subscribe on the extractor by just calling ALMemory.subscribeToEvent() supplying a callback method. This will automatically subscribe to the extractor for you.

name

Name of the module which subscribes.

period

Refresh period (in milliseconds) if relevant.

precision

Precision of the extractor if relevant.

void subscribe (const string& name)

Subscribes to the extractor. This causes the extractor to start writing information to memory using the keys described by getOutputNames(). These can be accessed in memory using ALMemory.getData("keyName"). In many cases you can avoid calling subscribe on the extractor by just calling ALMemory.subscribeToEvent() supplying a callback method. This will automatically subscribe to the extractor for you.

name

Name of the module which subscribes.

void unsubscribe (const string& name)

Unsubscribes from the extractor.

name

Name of the module which had subscribed.

void updatePeriod (const string& name, const int& period)

Updates the period if relevant.

name

Name of the module which has subscribed.

period

Refresh period (in milliseconds).

void updatePrecision (const string& name, const float& precision)

Updates the precision if relevant.

name

Name of the module which has subscribed.

precision

Precision of the extractor.

int getCurrentPeriod ()

Gets the current period.

Returns

Refresh period (in milliseconds).

float getCurrentPrecision ()

Gets the current precision.

Returns

Precision of the extractor.

int getMyPeriod (const string& name)

Gets the period for a specific subscription.

name

Name of the module which has subscribed.

Returns

Refresh period (in milliseconds).

float getMyPrecision (const string& name)

Gets the precision for a specific subscription.

name

name of the module which has subscribed

Returns

precision of the extractor

AL::ALValue getSubscribersInfo ()

Gets the parameters given by the module.

Returns

Array of names and parameters of all subscribers.

vector<string> getOutputNames ()

Get the list of values updated in ALMemory.

Returns

Array of values updated by this extractor in ALMemory


Copyright © 2010 Aldebaran Robotics - All rights reserved