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

# ALEngagementZones API

NAOqi People Perception - Overview | API

Namespace : AL

    #include <alproxies/alengagementzonesproxy.h>

## Method list

class `ALEngagementZonesProxy`

- As any module, this module inherits methods from ALModule API.
- It also inherits methods from ALExtractor API.
- It also has the following specific methods:
  - `ALEngagementZonesProxy::computeEngagementZone`
  - `ALEngagementZonesProxy::getFirstLimitDistance`
  - `ALEngagementZonesProxy::getLimitAngle`
  - `ALEngagementZonesProxy::getSecondLimitDistance`
  - `ALEngagementZonesProxy::setFirstLimitDistance`
  - `ALEngagementZonesProxy::setLimitAngle`
  - `ALEngagementZonesProxy::setSecondLimitDistance`

## Event list

- `EngagementZones/LimitAngleUpdated()`
- `EngagementZones/FirstLimitDistanceUpdated()`
- `EngagementZones/SecondLimitDistanceUpdated()`

EngagementZones and PeoplePerception:

- `EngagementZones/PeopleInZonesUpdated()`
- `EngagementZones/PersonApproached()`
- `EngagementZones/PersonMovedAway()`
- `EngagementZones/PersonEnteredZone1()`
- `EngagementZones/PersonEnteredZone2()`
- `EngagementZones/PersonEnteredZone3()`

EngagementZones and MovementDetection:

- `EngagementZones/MovementsInZonesUpdated()`

## ALMemory Key list

EngagementZones and PeoplePerception:

- `PeoplePerception/Person/<ID>/EngagementZone`
- `EngagementZones/PeopleInZone1`
- `EngagementZones/PeopleInZone2`
- `EngagementZones/PeopleInZone3`

EngagementZones and MovementDetection:

- `EngagementZones/LastMovementsInZone1`
- `EngagementZones/LastMovementsInZone2`
- `EngagementZones/LastMovementsInZone3`

## Methods

int `ALEngagementZonesProxy::``computeEngagementZone`()

  There are two overloads of this function:

  - ALEngagementZonesProxy::computeEngagementZone(x,y,z), using the 3D coordinates of the object in FRAME_ROBOT.
  - ALEngagementZonesProxy::computeEngagementZone(xAngle,yAngle,distance,cameraPositionRobot), using the angular coordinates of the object in the image, its distance from the camera, and the camera position in FRAME_ROBOT.

int `ALEngagementZonesProxy::``computeEngagementZone`(const float& x, const float& y, const float& z)

  Parameters: | x – X coordinate of the object in FRAME_ROBOT. y – Y coordinate of the object in FRAME_ROBOT. z – Z coordinate of the object in FRAME_ROBOT.
  Returns: | The corresponding Engagement Zone.

int `ALEngagementZonesProxy::``computeEngagementZone`(const float& xAngle, const float& yAngle, const float& distance, const AL::ALValue& cameraPositionRobot)

  Parameters: | xAngle – horizontal angular coordinate of the object in the image (in radians). yAngle – vertical angular coordinate of the object in the image (in radians). distance – distance of the object from the camera. cameraPositionRobot – position of the camera in FRAME_ROBOT as a Position6D.
  Returns: | The corresponding Engagement Zone.

float `ALEngagementZonesProxy::``getFirstLimitDistance`()

  Returns: | The current value of FirstDistance (in meters). The default value is 1.5m. Please refer to the diagram in ALEngagementZones for details.

float `ALEngagementZonesProxy::``getLimitAngle`()

  Returns: | The current value of LimitAngle (in degrees). The default value is 90 degrees. Please refer to the diagram in ALEngagementZones for details.

float `ALEngagementZonesProxy::``getSecondLimitDistance`()

  Returns: | The current value of SecondDistance (in meters). The default value is 2.5m. Please refer to the diagram in ALEngagementZones for details.

bool `ALEngagementZonesProxy::``setFirstLimitDistance`(const float& distance)

  Sets the value of FirstDistance. Please refer to the diagram in ALEngagementZones for details. Calling this method will trigger the event `EngagementZones/FirstLimitDistanceUpdated()`.

  Parameters: | distance – Value of the new FirstDistance (in meters). It must be positive and smaller than the current value of SecondDistance.
  Returns: | true if the update succeeded.

bool `ALEngagementZonesProxy::``setLimitAngle`(const float& angle)

  Sets the value of LimitAngle. Please refer to the diagram in ALEngagementZones for details. Calling this method will trigger the event `EngagementZones/LimitAngleUpdated()`.

  Parameters: | distance – Value of the new LimitAngle (in degrees). It must be between 0 and 180 degrees.
  Returns: | true if the update succeeded.

bool `ALEngagementZonesProxy::``setSecondLimitDistance`(const float& distance)

  Sets the value of SecondDistance. Please refer to the diagram in ALEngagementZones for details. Calling this method will trigger the event `EngagementZones/SecondLimitDistanceUpdated()`.

  Parameters: | distance – Value of the new FirstDistance (in meters). It must be positive and bigger than the current value of FirstDistance.
  Returns: | true if the update succeeded.

## Events

Event: `"EngagementZones/LimitAngleUpdated"`
callback(std::string eventName, float angle, std::string subscriberIdentifier)

  Raised when the limit angle value has changed.

  Parameters: | eventName (std::string) – “EngagementZones/LimitAngleUpdated” angle – New value in radians. subscriberIdentifier (std::string) –

Event: `"EngagementZones/FirstLimitDistanceUpdated"`
callback(std::string eventName, float distance, std::string subscriberIdentifier)

  Raised when the first limit distance value has changed.

  Parameters: | eventName (std::string) – “EngagementZones/FirstLimitDistanceUpdated” distance – New value in meters. subscriberIdentifier (std::string) –

Event: `"EngagementZones/SecondLimitDistanceUpdated"`
callback(std::string eventName, float distance, std::string subscriberIdentifier)

  Raised when the second limit distance value has changed.

  Parameters: | eventName (std::string) – “EngagementZones/SecondLimitDistanceUpdated” distance – New value in meters. subscriberIdentifier (std::string) –

Event: `"EngagementZones/PeopleInZonesUpdated"`
callback(std::string eventName, std::string subscriberIdentifier)

  Raised when the memory keys containing the list of people IDs in each zone have been updated.

Event: `"EngagementZones/PersonApproached"`
callback(std::string eventName, int id, std::string subscriberIdentifier)

  Raised when a person just approached the robot (i.e. moved to a closer engagement zone).

  Parameters: | eventName (std::string) – “EngagementZones/PersonApproached” id – ID of the person subscriberIdentifier (std::string) –

Event: `"EngagementZones/PersonMovedAway"`
callback(std::string eventName, int id, std::string subscriberIdentifier)

  Raised when a person just moved away from the robot (i.e. moved to a further engagement zone).

  Parameters: | eventName (std::string) – “EngagementZones/PersonMovedAway” id – ID of the person subscriberIdentifier (std::string) –

Event: `"EngagementZones/PersonEnteredZone1"`
callback(std::string eventName, int id, std::string subscriberIdentifier)

  Raised when a person changed of engagement zone and entered Zone 1.

  Parameters: | eventName (std::string) – “EngagementZones/PersonEnteredZone1” id – ID of the person subscriberIdentifier (std::string) –

Event: `"EngagementZones/PersonEnteredZone2"`
callback(std::string eventName, int id, std::string subscriberIdentifier)

  Parameters: | eventName (std::string) – “EngagementZones/PersonEnteredZone2” id – ID of the person subscriberIdentifier (std::string) –

Event: `"EngagementZones/PersonEnteredZone3"`
callback(std::string eventName, int id, std::string subscriberIdentifier)

  Raised when a person changed of engagement zone and entered Zone 3.

  Parameters: | eventName (std::string) – “EngagementZones/PersonEnteredZone3” id – ID of the person subscriberIdentifier (std::string) –

Event: `"EngagementZones/MovementsInZonesUpdated"`
callback(std::string eventName, std::string subscriberIdentifier)

  Raised when the memory keys containing the list of movements in each zone have been updated.

## ALMemory Keys

int `PeoplePerception/Person/<ID>/EngagementZone`

  Id of the engagement zone of the person (0 if unknown). <ID> is the ID of the person (see ALPeoplePerception API).

AL::ALValue `EngagementZones/PeopleInZone1`

  List of the IDs of the people detected in Zone 1.

AL::ALValue `EngagementZones/PeopleInZone2`

  List of the IDs of the people detected in Zone 2.

AL::ALValue `EngagementZones/PeopleInZone3`

  List of the IDs of the people detected in Zone 3.

AL::ALValue `EngagementZones/LastMovementsInZone1`

  List of the movements detected in Zone 1. The memory key has the same structure as the key MovementDetection/MovementInfo, described in ALMovementDetection

AL::ALValue `EngagementZones/LastMovementsInZone2`

  List of the movements detected in Zone 2. The memory key has the same structure as the key MovementDetection/MovementInfo, described in ALMovementDetection

AL::ALValue `EngagementZones/LastMovementsInZone3`

  List of the movements detected in Zone 3. The memory key has the same structure as the key MovementDetection/MovementInfo, described in ALMovementDetection

Glossary Site map Index Support Contact Legal Notices