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
-
Method Summary
Modifier and TypeMethodDescriptioncom.google.protobuf.Struct
Send/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.double
Return 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, named
Methods inherited from class com.viam.sdk.core.component.Component
getGeometries
Methods inherited from class com.viam.sdk.core.resource.Resource
close, createStatus, getName, getSubtype, named
-
Constructor Details
-
PowerSensorRPCClient
-
-
Method Details
-
doCommand
Description copied from class:Resource
Send/Receive arbitrary commands to the Resource -
getVoltage
Description copied from class:PowerSensor
Return the voltage reading of a specified device and whether it is AC or DC.- Specified by:
getVoltage
in 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:PowerSensor
Return the current of a specified device and whether it is AC or DC.- Specified by:
getCurrent
in 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:PowerSensor
Return the power reading in watts.- Specified by:
getPower
in classPowerSensor
- Returns:
- the power reading in watts
-
getReadings
Description copied from class:PowerSensor
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.- Specified by:
getReadings
in 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).
-