Class PowerSensor

Direct Known Subclasses:
PowerSensorRPCClient

public abstract class PowerSensor extends Component
PowerSensor reports information about voltage, current and power.
  • Field Details

    • SUBTYPE

      public static final Subtype SUBTYPE
  • Constructor Details

    • PowerSensor

      public PowerSensor(String name)
  • Method Details

    • named

      public static Common.ResourceName named(String name)
      Get the ResourceName of the component
      Parameters:
      name - the name of the component
      Returns:
      the component's ResourceName
    • fromRobot

      public static PowerSensor fromRobot(RobotClient robot, String name)
      Get the component with the provided name from the provided robot.
      Parameters:
      robot - the RobotClient
      name - the name of the component
      Returns:
      the component
    • getVoltage

      public abstract Map.Entry<Double,Boolean> getVoltage(Optional<com.google.protobuf.Struct> extra)
      Return the voltage reading of a specified device and whether it is AC or DC.
      Returns:
      the pair where the first double representing the voltage reading in V, the second bool indicating whether the voltage is AC (`true`) or DC (`false`).
    • getCurrent

      public abstract Map.Entry<Double,Boolean> getCurrent(Optional<com.google.protobuf.Struct> extra)
      Return the current of a specified device and whether it is AC or DC.
      Returns:
      the pair where the first double representing the current reading in V, the second bool indicating whether the current is AC (`true`) or DC * (`false`).
    • getPower

      public abstract double getPower(Optional<com.google.protobuf.Struct> extra)
      Return the power reading in watts.
      Returns:
      the power reading in watts
    • getReadings

      public abstract Map<String,Object> getReadings(Optional<com.google.protobuf.Struct> extra)
      Get the measurements or readings that this power sensor provides. If a sensor is not configured correctly or fails to read a piece of data, it will not appear in the readings dictionary.
      Returns:
      The readings for the PowerSensor. Object should be of type Vector3, GeoPoint, Orientation, or any Value type. Includes voltage in volts (float), current in amperes (float), is_ac (bool), and power in watts (float).