# SoftBank Robotics documentation What's new in NAOqi 2.8?

# ALDarknessDetection API

NAOqi Vision - Overview | API

Namespace : AL

    #include <alproxies/aldarknessdetectionproxy.h>

## Method list

class `ALDarknessDetectionProxy`

- As any module, this module inherits methods from ALModule API.
- It also inherits methods from ALExtractor API and ALVisionExtractor API.
- It also has the following specific methods:
  - `ALDarknessDetectionProxy::getDarknessThreshold`
  - `ALDarknessDetectionProxy::setDarknessThreshold`

## Events lists

- `DarknessDetection/DarknessDetected()`

## ALMemory Keys list

- `DarknessDetection/DarknessValue`

## Methods

int `ALDarknessDetectionProxy::``getDarknessThreshold`()

  Returns: | Current value of the darkness threshold used for raising the event `DarknessDetection/DarknessDetected()`.

void `ALDarknessDetectionProxy::``setDarknessThreshold`(const int& threshold)

  Enables to change the value of the darkness threshold for raising the event `DarknessDetection/DarknessDetected()`.

  This value must be between 0 and 100:

  - if the given value is lower than 0, darkness threshold is set to 0
  - if the given value is greater than 100, darkness threshold is set to 100

## Events

Event: `"DarknessDetection/DarknessDetected"`
callback(std::string eventName, int value, std::string subscriberIdentifier)

  Raised when the darkness value just became greater than the darkness threshold. As long as the darkness value stays over the threshold, the event is not raised another time.

  Parameters: | eventName (std::string) – “DarknessDetection/DarknessDetected” value – the darkness value measured subscriberIdentifier (std::string) –

## ALMemory Keys

int `DarknessDetection/DarknessValue`

  Value of the darkness measured for each frame.

Glossary Site map Index Support Contact Legal Notices