World state store API | Service APIs
World state store API
The world state store service API allows you to retrieve a list of world objects. You can use this list to create custom visualizers to render spatial data related to a machine on the machine’s VISUALIZE tab.
The world state store service supports the following methods:
| Method Name | Description |
|---|---|
ListUUIDs |
List all world state transform UUIDs. |
GetTransform |
Get a world state transform by UUID. |
StreamTransformChanges |
Stream changes to world state transforms. |
DoCommand |
Execute model-specific commands that are not otherwise defined by the service API. |
GetResourceName |
Get the ResourceName for this Resource with the given name. |
Close |
Safely shut down the resource and prevent further use. |
API
ListUUIDs
List all world state transform UUIDs.
Parameters:
extra(Mapping[ str, Any]) (optional): Extra options to pass to the underlying RPC call.timeout( float) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.
Returns:
- (List[ bytes])
Example:
For more information, see the Python SDK Docs.
Parameters:
extra(None) (optional): Additional arguments to the method.callOptions(CallOptions) (optional)
Returns:
- (Promise<string[]>)
Example:
For more information, see the TypeScript SDK Docs.
GetTransform
Get a world state transform by UUID.
Parameters:
uuid( bytes) (required): The UUID of the transform to retrieve.extra(Mapping[ str, Any]) (optional): Extra options to pass to the underlying RPC call.timeout( float) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.
Returns:
Example:
For more information, see the Python SDK Docs.
Parameters:
uuid(string) (required): The UUID of the transform to retrieve.extra(None) (optional): Additional arguments to the method.callOptions(CallOptions) (optional)
Returns:
- (Promise< TransformWithUUID >)
Example:
For more information, see the TypeScript SDK Docs.
StreamTransformChanges
Stream changes to world state transforms.
Parameters:
Returns:
Example:
For more information, see the Python SDK Docs.
Parameters:
extra(None) (optional): Additional arguments to the method.callOptions(CallOptions) (optional)
Returns:
- (AsyncGenerator< TransformChangeEvent, void>)
Example:
For more information, see the TypeScript SDK Docs.
DoCommand
Execute model-specific commands that are not otherwise defined by the service API. Most models do not implement DoCommand. Any available model-specific commands should be covered in the model’s documentation. If you are implementing your own vision service and want to add features that have no corresponding built-in API method, you can implement them with DoCommand.
Parameters:
command(Mapping[ str, ValueTypes]) (required): The command to execute.timeout( float) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.
Returns:
- (Mapping[ str, viam.utils.ValueTypes])
Example:
For more information, see the Python SDK Docs.
Parameters:
command( Struct) (required): The command to execute. Accepts either a Struct or a plain object, which will be converted automatically.callOptions(CallOptions) (optional)
Returns:
- (Promise< JsonValue >)
Example:
For more information, see the TypeScript SDK Docs.
GetResourceName
Get the ResourceName for this Resource with the given name.
Parameters:
name( str) (required): The name of the Resource.
Returns:
- ( viam.proto.common.ResourceName): : The ResourceName of this Resource.
Example:
For more information, see the Python SDK Docs.
Parameters:
- None.
Returns:
- (string): The name of the resource.
Example:
For more information, see the TypeScript SDK Docs.
Close
Safely shut down the resource and prevent further use.
Parameters:
- None.
Returns:
- None.
Example:
For more information, see the Python SDK Docs.