Class Battery


  • public class Battery
    extends java.lang.Object
    The robot's battery
    • Constructor Summary

      Constructors 
      Constructor Description
      Battery​(double initialCharge, double capacity)
      Constructor
      Battery​(double minVoltage, double maxVoltage, double capacity)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getBatteryPercentage()
      Get the estimated battery percentage
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Battery

        public Battery​(double minVoltage,
                       double maxVoltage,
                       double capacity)
        Constructor
        Parameters:
        minVoltage - the minimum voltage of the battery in Volts
        maxVoltage - the maximum voltage of the battery in Volts
        capacity - the total capacity of the battery in Amp-hours
      • Battery

        public Battery​(double initialCharge,
                       double capacity)
        Constructor
        Parameters:
        initialCharge - the current percent charge of the battery between 0 and 1
        capacity - the total capacity of the battery in Amp-hours
    • Method Detail

      • getBatteryPercentage

        public double getBatteryPercentage()
        Get the estimated battery percentage
        Returns:
        the battery percentage from 0 to 100 percent