ALBattery API¶
NAOqi Sensors & LEDs - Overview | API
See also
Namespace : AL
#include <alproxies/albatteryproxy.h>
Method list¶
As any module, this module inherits methods from ALModule API. It also has the following specific methods:
-
class
ALBatteryProxy
¶
Event list¶
ALBattery/BatteryLow()
ALBattery/ConnectedToChargingStation()
BatteryTrapIsOpen()
BatteryPowerPluggedChanged()
BatteryChargeCellVoltageMinChanged()
BatteryChargingFlagChanged()
BatteryFullChargedFlagChanged()
BatteryDisChargingFlagChanged()
BatteryChargeChanged()
BatteryEmpty()
BatteryLowDetected()
BatteryNearlyEmpty()
BatteryNotDetected()
Methods¶
Events¶
-
Event:callback(std::string eventName, bool status, std::string subscriberIdentifier)¶
"ALBattery/BatteryLow"
Raised when the battery level is low and will soon need charging.
Parameters: - eventName (std::string) – “ALBattery/BatteryLow”
- status – Always True.
- subscriberIdentifier (std::string) –
-
Event:callback(std::string eventName, bool connected, std::string subscriberIdentifier)¶
"ALBattery/ConnectedToChargingStation"
Pepper Only.
Raised when the robot is connected and disconnected to charging station.
Parameters: - eventName (std::string) – “ALBattery/ConnectedToChargingStation”
- connected – True when the robot is connected, false otherwise.
- subscriberIdentifier (std::string) –
-
Event:callback(std::string eventName, bool open, std::string subscriberIdentifier)¶
"BatteryTrapIsOpen"
Pepper Only.
Raised when the power hatch is opened or closed.
Parameters: - eventName (std::string) – “BatteryTrapIsOpen”
- connected – True when the power hatch is opened, false otherwise.
- subscriberIdentifier (std::string) –
-
Event:callback(std::string eventName, bool plugged, std::string subscriberIdentifier)¶
"BatteryPowerPluggedChanged"
Raised when the charger is plugged and unplugged.
Caution: some battery models do not provide information whether the power is plugged or not. In this case, we determine power plugged state with electric current. Unfortunately when the battery is fully charged, the charger stops supplying current. So this event is not raised when battery is fully charged.
For further details see: Battery Hardware.
Parameters: - eventName (std::string) – “BatteryPowerPluggedChanged”
- plugged – True if plugged-in, false otherwise.
- subscriberIdentifier (std::string) –
-
Event:callback(std::string eventName, int voltage, std::string subscriberIdentifier)¶
"BatteryChargeCellVoltageMinChanged"
Raised when the Minimum cell voltage of the battery changes.
Parameters: - eventName (std::string) – “BatteryChargeCellVoltageMinChanged”
- voltage – The minimum cell voltage.
- subscriberIdentifier (std::string) –
-
Event:callback(std::string eventName, bool charging, std::string subscriberIdentifier)¶
"BatteryChargingFlagChanged"
Raised when the flag “battery is charging” changes.
Parameters: - eventName (std::string) – “BatteryChargingFlagChanged”
- charging – True when the battery is charging, false otherwise.
- subscriberIdentifier (std::string) –
-
Event:callback(std::string eventName, bool fullyCharged, std::string subscriberIdentifier)¶
"BatteryFullChargedFlagChanged"
Raised when the flag “battery is fully charged” changes.
Parameters: - eventName (std::string) – “BatteryFullChargedFlagChanged”
- fullyCharged – True when the battery is fully charged, false otherwise.
- subscriberIdentifier (std::string) –
-
Event:callback(std::string eventName, bool isDischarging, std::string subscriberIdentifier)¶
"BatteryDisChargingFlagChanged"
Raised when the flag “battery is discharging” changes.
Parameters: - eventName (std::string) – “BatteryDisChargingFlagChanged”
- isDischarging – True when the battery is discharging, false otherwise.
- subscriberIdentifier (std::string) –
-
Event:callback(std::string eventName, int percentage, std::string subscriberIdentifier)¶
"BatteryChargeChanged"
Raised when the battery level percentage changes.
Parameters: - eventName (std::string) – “BatteryChargeChanged”
- percentage – The percent of the battery that remains.
- subscriberIdentifier (std::string) –
-
Event:callback(std::string eventName, std::string message, std::string subscriberIdentifier)¶
"BatteryEmpty"
Raised when the battery is empty.
Parameters: - eventName (std::string) – “BatteryEmpty”
- message – System message.
- subscriberIdentifier (std::string) –
-
Event:callback(std::string eventName, bool status, std::string subscriberIdentifier)¶
"BatteryLowDetected"
Raised when the battery level is low.
Parameters: - eventName (std::string) – “BatteryLowDetected”
- status – True if battery level is low.
- subscriberIdentifier (std::string) –
-
Event:callback(std::string eventName, std::string message, std::string subscriberIdentifier)¶
"BatteryNearlyEmpty"
Raised when the battery is nearly empty and needs charging.
Parameters: - eventName (std::string) – “BatteryNearlyEmpty”
- message – System message.
- subscriberIdentifier (std::string) –
-
Event:callback(std::string eventName, bool status, std::string subscriberIdentifier)¶
"BatteryNotDetected"
Raised when the battery is not detected.
Parameters: - eventName (std::string) – “BatteryNotDetected”
- status – True if battery is not detected.
- subscriberIdentifier (std::string) –