ALRecharge API

Overview | API


juju Pepper only

Namespace : AL

#include <alproxies/alnotificationmanagerproxy.h>

Methods

AL::ALValue ALRechargeProxy::lookForStation()

Tries to locate the charging station. This is a blocking call.

The robot looks for its charging station all around him and localizes it.

360 ° search process: the robot scans 180° in front of him, then 2 times, the robot rotates on itself through 120° and scans.

The Status is set to Idle right before this method returns.

Returns:[bool isFound, [float x, float y, float theta]] where isFound is True if the charging station has been successfully localized. Its position is then given in FRAME_WORLD in the second array (x,y,theta).
bool ALRechargeProxy::moveInFrontOfStation()

Makes the robot go in front of its charging station. This is a blocking call.

The robot goes 0.6m in front of its charging station to prepare docking using ALTracker.

If the charging station has not been found already, this method will return false. The Status is set to Idle right before this method returns.

Returns:True if the robot successfully went at the desired position in front of its charging station.
bool ALRechargeProxy::dockOnStation()

Makes the robot dock onto its charging station. This is a blocking call.

The robot performs a U-turn and enters its charging station in a backward motion.

If the charging station has not been found already, or if the charging station is not close to its desired position in front of the robot (0.6m), this method will return False.

Upon success, this method forbids all motion moves while the robot is on the charging station. The Status is set to Idle right before this method returns.

Returns:True if the robot successfully docked on its charging station..
void ALRechargeProxy::goToStation()

Makes the robot go onto its charging station.

This method calls successfully ALRechargeProxy::lookForStation(), ALRechargeProxy::moveInFrontOfStation() and ALRechargeProxy::dockOnStation() without interruption. This is a non blocking call.

This behavior can be monitored using ALRechargeProxy::getStatus().

Upon success, this method forbids all motion moves while the robot is on the charging station.

void ALRechargeProxy::leaveStation()

If the robot is on the charging station, this method makes the robot go just in front of it (0.6m). Upon success, this function allows all motion moves. The Status is set to Idle right before this method returns.

int ALRechargeProxy::getStatus()

Get the current Status of the recharge manager module.

Returns:Int representing the status according to the following table.
std::vector<float> ALRechargeProxy::getStationPosition()

Get the current charging pose2D used by the recharge module.

Returns:Pose2D (x, y, theta) of the charging station in FRAME_WORLD
void ALRechargeProxy::stopAll()

Request to stop the current behavior. This will stop the Tracker and all ongoing moves. This resets the Status to Idle.

Events

Event: "ALRecharge/StatusChanged"
callback(std::string eventName, int status, std::string subscriberIdentifier)

Raised when the ALRecharge Status changes.

Parameters:
  • eventName (std::string) – “ALRecharge/StatusChanged”
  • status – new Status.
  • subscriberIdentifier (std::string) –
Event: "ALRecharge/StationDetected"
callback(std::string eventName, AL::ALValue plugged, std::string subscriberIdentifier)

Raised when the robot detects its charging station with a confidence index higher than 0.5.

Parameters:
  • eventName (std::string) – “ALRecharge/StationDetected”
  • plugged – data needed by ALTracker for charging station tracking.
  • subscriberIdentifier (std::string) –
Event: "ALRecharge/StationNotFound"
callback(std::string eventName, std::string subscriberIdentifier)

Raised when the robot has not found the charging station. It then stops the search.

Event: "ALRecharge/ConnectedToChargingStation"
callback(std::string eventName, std::string subscriberIdentifier)

Raised when the robot is correctly docked onto the charging station.

Event: "ALRecharge/DockingSuccess"
callback(std::string eventName, std::string subscriberIdentifier)

Raised when the robot has successfully docked onto the charging station.

Event: "ALRecharge/DockingFailed"
callback(std::string eventName, std::string subscriberIdentifier)

Raised when the robot failed to dock onto the charging station during the final step.

Event: "ALRecharge/LeaveSuccess"
callback(std::string eventName, std::string subscriberIdentifier)

Raised when the robot correctly left its pod.

Event: "ALRecharge/LeaveFailed"
callback(std::string eventName, std::string subscriberIdentifier)

Raised when the robot failed to leave its pod due to an obstacle in the way.

Event: "ALRecharge/SearchStopped"
callback(std::string eventName, std::string subscriberIdentifier)

Raised when the robot stops the search and goes back to idle status.

Event: "ALRecharge/MoveFailed"
callback(std::string eventName, std::string subscriberIdentifier)

Raised when the robot interrupts its operation because a safety rule prevents the usage of ALMotion module.


Status

Value Meaning
0 Idle
1 Looking for its charging station
2 Going in front of its charging station
3 Docking onto its charging station
4 Currently docked on its charging station