Package ftclib.sensor
Class FtcRobotBattery
java.lang.Object
trclib.sensor.TrcRobotBattery
ftclib.sensor.FtcRobotBattery
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 Summary
FieldsModifier and TypeFieldDescriptionprivate final com.qualcomm.robotcore.hardware.VoltageSensor
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor: create an instance of the object.FtcRobotBattery
(com.qualcomm.robotcore.hardware.HardwareMap hardwareMap) Constructor: create an instance of the object. -
Method Summary
Modifier and TypeMethodDescriptiondouble
This method returns the robot battery current.double
getPower()
This method returns the robot battery power.double
This method returns the robot battery voltage.Methods inherited from class trclib.sensor.TrcRobotBattery
getHighestCurrent, getHighestPower, getHighestVoltage, getLowestCurrent, getLowestPower, getLowestVoltage, getTotalEnergy, setEnabled, toString
-
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 classTrcRobotBattery
- Returns:
- current battery voltage in volts.
-
getCurrent
public double getCurrent()This method returns the robot battery current.- Specified by:
getCurrent
in classTrcRobotBattery
- Returns:
- current battery current in amps.
-
getPower
public double getPower()This method returns the robot battery power.- Specified by:
getPower
in classTrcRobotBattery
- Returns:
- current battery power in watts.
-