ALNavigation API

Overview | API


Namespace : AL

#include <alproxies/alnavigationproxy.h>

Method list

As any module, this module inherits methods from ALModule API. It also has the following specific methods:

class ALNavigationProxy

Methods

bool ALNavigationProxy::moveTo(const float& x, const float& y, const float& theta)

There are two overloads of this function:

Like ALMotionProxy::moveTo(), makes the robot move to the given pose in the ground plane, relative to FRAME_ROBOT. Unlike ALMotionProxy::moveTo(), the robot stops as soon as it has detected an obstacle in its security area. This is a blocking call.

For now bumpers and sonars are used to detect obstacles.

Parameters:
  • x – Distance along the X axis in meters.
  • y – Distance along the Y axis in meters.
  • theta – Rotation around the Z axis in radians [-3.1415 to 3.1415].
Returns:

True if the robot reached the target, False if the robot was stopped by an obstacle.

bool ALNavigationProxy::moveTo(const float& x, const float& y, const float& theta, const AL::ALValue& moveConfig)

Like ALMotionProxy::moveTo(), makes the robot move to the given pose in the ground plane, relative to FRAME_ROBOT, with custom move configuration. Unlike ALMotionProxy::moveTo(), the robot stops as soon as it has detected an obstacle in its security area. This is a blocking call.

For now bumpers and sonars are used to detect obstacles.

Parameters:
  • x – Distance along the X axis in meters.
  • y – Distance along the Y axis in meters.
  • theta – Rotation around the Z axis in radians [-3.1415 to 3.1415].
  • moveConfig – An ALValue with the custom move configuration.
Returns:

True if the robot reached the target, False if the robot was stopped by an obstacle.

void ALNavigationProxy::setSecurityDistance(const float& distance)

Defines the security distance used by ALNavigationProxy::moveTo().

Parameters:
  • distance – distance in meters. Defines the security area in which any object detection stops the robot. Default value: 0.40 m.

Events

Event: "Status"
callback(std::string eventName, AL::ALValue status, std::string subscriberIdentifier)

Raised when status of the Safe navigator changes.

Parameters:
  • eventName (std::string) – “Status”
  • status – New safe navigator status. Please refer to ALNavigation for details.
  • subscriberIdentifier (std::string) –

Note

This event should be prefixed by “Navigation/SafeNavigator/” when subscribing to it.

Event: "BlockingObstacle"
callback(std::string eventName, std::string subscriberIdentifier)

Raised when there is an obstacle preventing the robot from starting its motion.

Note

This event should be prefixed by “Navigation/SafeNavigator/” when subscribing to it.

Event: "AlreadyAtTarget"
callback(std::string eventName, std::string subscriberIdentifier)

Raised when robot is already at its target.

Note

This event should be prefixed by “Navigation/SafeNavigator/” when subscribing to it.

Event: "DangerousObstacleDetected"
callback(std::string eventName, AL::ALValue position, std::string subscriberIdentifier)

Raised when an obstacle is detected in the security area.

Parameters:
  • eventName (std::string) – “DangerousObstacleDetected”
  • position – Array formatted as [x, y], representing the position of the detected obstacle in FRAME_ROBOT.
  • subscriberIdentifier (std::string) –

Note

This event should be prefixed by “Navigation/SafeNavigator/” when subscribing to it.