Class PowerSensorRPCClient
java.lang.Object
com.viam.sdk.core.resource.Resource
com.viam.sdk.core.component.Component
com.viam.sdk.core.component.powersensor.PowerSensor
com.viam.sdk.core.component.powersensor.PowerSensorRPCClient
-
Nested Class Summary
Nested classes/interfaces inherited from class com.viam.sdk.core.resource.Resource
Resource.Reconfigurable, Resource.Stoppable -
Field Summary
Fields inherited from class com.viam.sdk.core.component.powersensor.PowerSensor
SUBTYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.protobuf.StructSend/Receive arbitrary commands to the ResourcegetCurrent(Optional<com.google.protobuf.Struct> extra) Return the current of a specified device and whether it is AC or DC.doubleReturn the power reading in watts.getReadings(Optional<com.google.protobuf.Struct> extra) Get the measurements or readings that this power sensor provides.getVoltage(Optional<com.google.protobuf.Struct> extra) Return the voltage reading of a specified device and whether it is AC or DC.Methods inherited from class com.viam.sdk.core.component.powersensor.PowerSensor
fromRobot, namedMethods inherited from class com.viam.sdk.core.component.Component
getGeometriesMethods inherited from class com.viam.sdk.core.resource.Resource
close, createStatus, getName, getSubtype, named
-
Constructor Details
-
PowerSensorRPCClient
-
-
Method Details
-
doCommand
Description copied from class:ResourceSend/Receive arbitrary commands to the Resource -
getVoltage
Description copied from class:PowerSensorReturn the voltage reading of a specified device and whether it is AC or DC.- Specified by:
getVoltagein classPowerSensor- 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
Description copied from class:PowerSensorReturn the current of a specified device and whether it is AC or DC.- Specified by:
getCurrentin classPowerSensor- 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
Description copied from class:PowerSensorReturn the power reading in watts.- Specified by:
getPowerin classPowerSensor- Returns:
- the power reading in watts
-
getReadings
Description copied from class:PowerSensorGet 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.- Specified by:
getReadingsin classPowerSensor- 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).
-