Represents a physical sensing device that can provide measurement readings.
Readonly
The name of the resource.
Send/Receive arbitrary commands to the resource.
The command to execute.
import { Struct } from '@viamrobotics/sdk';const result = await resource.doCommand( Struct.fromJson({ myCommand: { key: 'value' }, })); Copy
import { Struct } from '@viamrobotics/sdk';const result = await resource.doCommand( Struct.fromJson({ myCommand: { key: 'value' }, }));
Return the readings of a sensor.
Optional
const sensor = new VIAM.SensorClient(machine, 'my_sensor');// Get the readings of a sensor.const readings = await sensor.getReadings(); Copy
const sensor = new VIAM.SensorClient(machine, 'my_sensor');// Get the readings of a sensor.const readings = await sensor.getReadings();
For more information, see Sensor API.
Represents a physical sensing device that can provide measurement readings.