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

# ALMovementDetection API

NAOqi Vision - Overview | API

Namespace : AL

    #include <alproxies/almovementdetectionproxy.h>

## Method list

class `ALMovementDetectionProxy`

- 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:
  - `ALMovementDetectionProxy::resetDetection`
- And has the following specific methods if 3d camera available:
  - `ALMovementDetectionProxy::getDepthSensitivity`
  - `ALMovementDetectionProxy::setDepthSensitivity`
- Otherwise, on SoftBank Robotics robots without 3d camera, this module has the following specific methods:
  - `ALMovementDetectionProxy::getColorSensitivity`
  - `ALMovementDetectionProxy::setColorSensitivity`

## Events lists

- `MovementDetection/MovementDetected()`
- `MovementDetection/NoMovement()`

## ALMemory Keys list

- `MovementDetection/MovementInfo`

## Methods

void `ALMovementDetectionProxy::``resetDetection`()

  Resets to zero the values of the previously seen depth images, which resets the detection of movement. For example, this function is automatically called when the robot just moved, in order to avoid false positives that could be induced by the robot’s movements.

float `ALMovementDetectionProxy::``getColorSensitivity`()

  2d sensor only

  Gets the value of the color sensitivity (between 0 and 1) used for the detection of movement with the RGB camera.

void `ALMovementDetectionProxy::``setColorSensitivity`(const float& sensitivity)

  2d sensor only

  Sets the value of the color sensitivity (between 0 and 1) used for the detection of movement with the RGB camera. The lower this sensivity is, the higher the variation of color value of a pixel, between two frames, must be to be detected as movement.

float `ALMovementDetectionProxy::``getDepthSensitivity`()

  3d sensor only

  Gets the value of the depth sensitivity (in meters) used for the detection of movement with a depth camera.

void `ALMovementDetectionProxy::``setDepthSensitivity`(const float& sensitivity)

  3d sensor only

  Sets the value of the depth sensitivity (in meters) used for the detection of movement with a depth camera. The variation of depth of a pixel, between two frames, must be higher than this sensitivity to be detected as movement.

## Events

Event: `"MovementDetection/MovementDetected"`
callback(std::string eventName, std::string subscriberIdentifier)

  Raised each time some movement has been detected in the current camera frame (RGB or depth).

Event: `"MovementDetection/NoMovement"`
callback(std::string eventName, std::string subscriberIdentifier)

  Raised when no movement has been detected in the current camera frame (RGB or depth).

## ALMemory Keys

AL::ALValue `MovementDetection/MovementInfo`

  Contains the information about the latest detected movement. Please refer to ALMovementDetection for details.

Glossary Site map Index Support Contact Legal Notices