RobotClient class Viam SDK

gRPC client for a Robot. This class should be used for all interactions with a robot.

Obtain an instance of this client by using the function: RobotClient.atAddress(...)

Constructors

RobotClient.withClient(RobotServiceClient client)
Construct a RobotClient from an existing rpb.RobotServiceClient.

Properties

hashCode int
The hash code for this object.
no setterinherited
isConnected bool
Check if the client is connected to the robot.
no setter
resourceNames List<ResourceName>
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() Future<void>
Close the connection to the Robot. This should be done to release resources on the robot.
getCloudMetadata() Future<CloudMetadata>
Get app-related information about the machine.
getMachineStatus() Future<GetMachineStatusResponse>
GetMachineStatus returns status of the machine and its resources.
getModelsFromModules() Future<List<ModuleModel>>
GetModelsFromModules returns the list of models supported in modules on the machine.
getResource<T>(ResourceName name) → T
Get a connected resource by its ResourceName.
getStream(String name) StreamClient
Get a WebRTC stream client with the given name.
getStreamOptions(String name) Future<List<Resolution>>
Get the stream options for a stream with the given name.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refresh() Future<void>
Refresh the resources of this robot
resetStreamOptions(String name) Future<void>
Reset the options for a stream with the given name.
restartModule({String? moduleId, String? moduleName}) Future<void>
RestartModule restarts a module on the machine. Identify the module by either moduleId (for registry modules) or moduleName (for local modules). Exactly one of the two must be provided.
setStreamOptions(String name, int width, int height) Future<void>
Set the options for a stream with the given name.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

atAddress(String url, RobotClientOptions options) Future<RobotClient>
Connect to a robot at the specified address with the provided options.