Package ftclib.sensor

Class FtcRobotBattery

java.lang.Object
trclib.sensor.TrcRobotBattery
ftclib.sensor.FtcRobotBattery

public class FtcRobotBattery extends TrcRobotBattery
This class extends the TrcRobotBattery which provides a task to monitor the robot battery levels and the methods to access the highest and the lowest battery levels during the monitoring session.
  • Field Details

    • sensor

      private final com.qualcomm.robotcore.hardware.VoltageSensor sensor
  • Constructor Details

    • FtcRobotBattery

      public FtcRobotBattery(com.qualcomm.robotcore.hardware.HardwareMap hardwareMap)
      Constructor: create an instance of the object.
      Parameters:
      hardwareMap - specifies the global hardware map.
    • FtcRobotBattery

      public FtcRobotBattery()
      Constructor: create an instance of the object.
  • Method Details

    • getVoltage

      public double getVoltage()
      This method returns the robot battery voltage.
      Specified by:
      getVoltage in class TrcRobotBattery
      Returns:
      current battery voltage in volts.
    • getCurrent

      public double getCurrent()
      This method returns the robot battery current.
      Specified by:
      getCurrent in class TrcRobotBattery
      Returns:
      current battery current in amps.
    • getPower

      public double getPower()
      This method returns the robot battery power.
      Specified by:
      getPower in class TrcRobotBattery
      Returns:
      current battery power in watts.