Overview

This module contains different vision functionalities, like picture taking, video recording, white balance setting, etc ... Picture and videos are both saved in /home/nao/naoqi/share/naoqi/vision.

Methods

int isItDark ()

Tell if it is dark around.

Returns

[0;4] outdoor - [5;100] indoor bright - [101;127] shadowed place

int backlighting ()

Indicates if we might be in backlighting conditions.

Returns

range from 0(no backlight) to 100

void halfPress ()

Prepare camera for shooting (like the auto-focus on standard and digital cameras)

void takePicture ()

Shoot 3 successives pictures and place them in the /home/nao/naoqi/share/naoqi/vision folder. If halfPress has not been called before, it will take longer between click and shoot.

void takePictureRegularly (const float& secondsBetweenTwoShots, const string& pathAndNameRoot, const bool& overwriteImage, const string& imageRecordFormat, const int& resolution)

Shoot regularly a picture to follow Nao's evolution in his environment

secondsBetweenTwoShots

how many seconds between two pictures?

pathAndNameRoot

path and the root of the name for the picture

overwriteImage

do we need to overwrite the picture, or do we add a timestamp to the name?

imageRecordFormat

such as jpeg, bmp, png, etc.

resolution

resolution for the image (e.g. kQQVGA, kQVGA)

void logTPRInstanceInfo (const int& instanceNumber)

Print in the logger the info for an instance of takePictureRegurarly()

instanceNumber

number of the instance we want to get info on

void stopTPR (const string& pathAndNameRoot, const string& imageRecordFormat)

Stop an instance of takePictureRegularly()

pathAndNameRoot

path and name root of the file we want to stop recording

imageRecordFormat

formats of the file we want to stop recording

void setWhiteBalance (const int& camera)

Set white balance by using Nao's white hands as reference.

camera

Camera we want to set white balance to : [0] top - [1] bottom - [2] both

void startVideoRecord (const string& videoName)

Start recording a video. The .avi video is stored on the robot in the /home/nao/naoqi/share/naoqi/vision folder. The record should be stopped by calling stopVideoRecord(). Resolution: 320*240, MJPG format, frame rate ~10-15 fps. Please note that only one record at a time can be made.

videoName

Name of the video file to be recorded.

void startVideoRecord_adv (const string& videoName, const float& framerate, const string& format, const int& resIndex, const int& numFrames)

Start recording a video, with advanced options. Please note that only one record at a time can be made.

videoName

Name of the video file to be recorded.

framerate

Record frame rate [0.1-50.0]. Warning: MJPG format requires framerate greater than 2.0.

format

ARV = raw YUV422 format; IYUV = raw avi, MJPG = compressed avi.

resIndex

Resolution index. 0 = 160*120, 1 = 320*240, 2 = 640*480

numFrames

Number of frames to record. If less than 0, it records until stopVideoRecord() is called.

AL::ALValue stopVideoRecord ()

Stop a video record that was launched with startVideoRecord() or startVideoRecord_adv(). The function returns the number of frames that were recorded, as well as the video absolute file name.

Returns

Array of two elements [numRecordedFrames, recordAbsolutePath]

bool isVideoRecording ()

Returns

True/False


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.


Copyright © 2010 Aldebaran Robotics - All rights reserved