Package frclib.sensor
Class FrcRobotBattery
java.lang.Object
trclib.sensor.TrcRobotBattery
frclib.sensor.FrcRobotBattery
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.
-
Constructor Summary
ConstructorsConstructorDescriptionFrcRobotBattery
(int canId, edu.wpi.first.wpilibj.PowerDistribution.ModuleType moduleType) Constructor: Creates an instance of the object.FrcRobotBattery
(FrcPdp pdp) Constructor: Creates 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
-
Constructor Details
-
FrcRobotBattery
Constructor: Creates an instance of the object.- Parameters:
pdp
- specifies the PDP object.
-
FrcRobotBattery
public FrcRobotBattery(int canId, edu.wpi.first.wpilibj.PowerDistribution.ModuleType moduleType) Constructor: Creates an instance of the object.- Parameters:
canId
- specifies the CAN ID of the PDP.
-
-
Method Details
-
getVoltage
public double getVoltage()This method returns the robot battery voltage.- Specified by:
getVoltage
in classTrcRobotBattery
- Returns:
- robot battery voltage in volts.
-
getCurrent
public double getCurrent()This method returns the robot battery current.- Specified by:
getCurrent
in classTrcRobotBattery
- Returns:
- robot battery current in amps.
-
getPower
public double getPower()This method returns the robot battery power.- Specified by:
getPower
in classTrcRobotBattery
- Returns:
- robot battery current in watts.
-