diff --git a/.github/workflows/sdk_protos_map.csv b/.github/workflows/sdk_protos_map.csv index b15c8dbe61..1901f20597 100644 --- a/.github/workflows/sdk_protos_map.csv +++ b/.github/workflows/sdk_protos_map.csv @@ -14,6 +14,7 @@ arm,Stop,,stop,Stop,stop,stop arm,GetGeometries,,get_geometries,Geometries,,getGeometries arm,Reconfigure,,,Reconfigure,, arm,DoCommand,,do_command,DoCommand,doCommand,doCommand +arm,GetStatus,,get_status,,getStatus,getStatus arm,GetResourceName,,get_resource_name,Name,getResourceName,name arm,Close,,close,Close,, @@ -23,6 +24,7 @@ audio_in,GetProperties,,get_properties,Properties,getProperties,getProperties audio_in,GetGeometries,,get_geometries,,, audio_in,Reconfigure,,,Reconfigure,, audio_in,DoCommand,,do_command,DoCommand,doCommand,doCommand +audio_in,GetStatus,,get_status,,getStatus,getStatus audio_in,GetResourceName,,get_resource_name,Name,,name audio_in,Close,,close,Close,, @@ -33,6 +35,7 @@ audio_out,GetProperties,,get_properties,Properties,getProperties,getProperties audio_out,GetGeometries,,get_geometries,,, audio_out,Reconfigure,,,Reconfigure,, audio_out,DoCommand,,do_command,DoCommand,doCommand,doCommand +audio_out,GetStatus,,get_status,,getStatus,getStatus audio_out,GetResourceName,,get_resource_name,Name,,name audio_out,Close,,close,Close,, @@ -48,6 +51,7 @@ base,Stop,Yes,stop,Stop,stop,stop base,GetGeometries,No,get_geometries,Geometries,,getGeometries base,Reconfigure,No,,Reconfigure,, base,DoCommand,Yes,do_command,DoCommand,doCommand,doCommand +base,GetStatus,No,get_status,,getStatus,getStatus base,GetResourceName,No,get_resource_name,Name,getResourceName,name base,Close,No,close,Close,, @@ -73,6 +77,7 @@ board,GPIOPinByName,No,gpio_pin_by_name,GPIOPinByName,, board,GetGeometries,No,get_geometries,,, board,Reconfigure,No,,Reconfigure,, board,DoCommand,Yes,do_command,DoCommand,doCommand,doCommand +board,GetStatus,No,get_status,,getStatus,getStatus board,GetResourceName,No,get_resource_name,Name,getResourceName,name board,Close,No,close,Close,, @@ -80,6 +85,7 @@ board,Close,No,close,Close,, button,Push,Yes,push,Push,push,push button,Reconfigure,No,,Reconfigure,, button,DoCommand,Yes,do_command,DoCommand,doCommand,doCommand +button,GetStatus,No,get_status,,getStatus,getStatus button,GetResourceName,No,get_resource_name,Name,getResourceName,name button,Close,No,close,Close,, @@ -89,6 +95,7 @@ camera,GetPointCloud,,get_point_cloud,NextPointCloud,pointCloud,getPointCloud camera,GetProperties,,get_properties,Properties,properties,getProperties ## TED: Camera in Go SDK doesn't appear to implement (inherit) these: camera,DoCommand,,do_command,DoCommand,doCommand,doCommand +camera,GetStatus,,get_status,,getStatus,getStatus camera,GetGeometries,,get_geometries,Geometries,,getGeometries ## HACK: proto for close, manually mapping: camera,GetResourceName,,get_resource_name,Name,getResourceName,name @@ -102,6 +109,7 @@ encoder,GetGeometries,No,get_geometries,,, ## HACK: No proto for these (and/or inherited in Go SDK), manually mapping: encoder,Reconfigure,No,,Reconfigure,, encoder,DoCommand,Yes,do_command,DoCommand,,doCommand +encoder,GetStatus,No,get_status,,,getStatus encoder,GetResourceName,No,get_resource_name,Name,,name encoder,Close,No,close,Close,, @@ -117,6 +125,7 @@ gantry,IsMoving,,is_moving,IsMoving,isMoving,isMoving gantry,Stop,,stop,Stop,stop,stop gantry,Reconfigure,,,Reconfigure,, gantry,DoCommand,,do_command,DoCommand,doCommand,doCommand +gantry,GetStatus,,get_status,,getStatus,getStatus gantry,GetKinematics,,get_kinematics,Kinematics,, gantry,GetResourceName,,get_resource_name,Name,getResourceName,name gantry,Close,,close,Close,, @@ -125,6 +134,7 @@ gantry,Close,,close,Close,, ## NOTED:Generic Component in Go SDK doesn't appear to implement (inherit) these: generic_component,GetGeometries,No,get_geometries,,,getGeometries generic_component,DoCommand,Yes,do_command,DoCommand,doCommand,doCommand +generic_component,GetStatus,No,get_status,,getStatus,getStatus ## HACK: No proto for close, manually mapping: ## NOTED: Go SDK also missing Close, but we have it in our docs?: generic_component,GetResourceName,No,get_resource_name,Name,getResourceName,name @@ -142,6 +152,7 @@ gripper,GetCurrentInputs,,get_current_inputs,CurrentInputs,,getCurrentInputs gripper,GoToInputs,,go_to_inputs,GoToInputs,,goToInputs gripper,Reconfigure,,,Reconfigure,, gripper,DoCommand,,do_command,DoCommand,doCommand,doCommand +gripper,GetStatus,,get_status,,getStatus,getStatus gripper,GetKinematics,,get_kinematics,Kinematics,getKinematics, gripper,GetResourceName,,get_resource_name,Name,getResourceName,name gripper,Close,,close,Close,, @@ -158,6 +169,7 @@ input_controller,RegisterControlCallback,,register_control_callback,RegisterCont ## HACK: proto for these (and/or inherited in Go SDK), manually mapping: input_controller,Reconfigure,,,Reconfigure,, input_controller,DoCommand,,do_command,DoCommand,, +input_controller,GetStatus,,get_status,,,getStatus input_controller,GetResourceName,,get_resource_name,Name,,name input_controller,Close,,close,Close,, @@ -178,6 +190,7 @@ motor,GetGeometries,No,get_geometries,,, motor,Reconfigure,No,,Reconfigure,, # NOT implemented in other languages motor,DoCommand,,do_command,DoCommand,doCommand,doCommand +motor,GetStatus,No,get_status,,getStatus,getStatus motor,GetResourceName,No,get_resource_name,Name,getResourceName,name motor,Close,No,close,Close,, @@ -196,6 +209,7 @@ movement_sensor,GetGeometries,No,get_geometries,,, movement_sensor,GetReadings,Yes,get_readings,Readings,readings,getReadings movement_sensor,Reconfigure,No,,Reconfigure,, movement_sensor,DoCommand,Yes,do_command,DoCommand,doCommand,doCommand +movement_sensor,GetStatus,No,get_status,,getStatus,getStatus movement_sensor,GetResourceName,No,get_resource_name,Name,getResourceName,name movement_sensor,Close,No,close,Close,, @@ -210,6 +224,7 @@ power_sensor,GetReadings,,get_readings,Readings,readings,getReadings ## HACK: proto for these (and/or inherited in Go SDK), manually mapping: power_sensor,Reconfigure,,,Reconfigure,, power_sensor,DoCommand,,do_command,DoCommand,doCommand,doCommand +power_sensor,GetStatus,,get_status,,getStatus,getStatus power_sensor,GetResourceName,,get_resource_name,Name,getResourceName,name power_sensor,Close,,close,Close,, @@ -221,6 +236,7 @@ sensor,GetGeometries,,get_geometries,,, sensor,Reconfigure,No,,Reconfigure,, # NOT implemented in other languages sensor,DoCommand,,do_command,DoCommand,doCommand,doCommand +sensor,GetStatus,No,get_status,,getStatus,getStatus sensor,GetResourceName,No,get_resource_name,Name,getResourceName,name sensor,Close,No,close,Close,, @@ -235,6 +251,7 @@ servo,GetGeometries,No,get_geometries,,, servo,Reconfigure,No,,Reconfigure,, # NOT implemented in other languages servo,DoCommand,,do_command,DoCommand,doCommand,doCommand +servo,GetStatus,No,get_status,,getStatus,getStatus servo,GetResourceName,No,get_resource_name,Name,getResourceName,name servo,Close,No,close,Close,, @@ -243,6 +260,7 @@ switch,SetPosition,Yes,set_position,SetPosition,,setPosition switch,GetPosition,Yes,get_position,GetPosition,,getPosition switch,GetNumberOfPositions,Yes,get_number_of_positions,GetNumberOfPositions,,getNumberOfPositions switch,DoCommand,Yes,do_command,DoCommand,,doCommand +switch,GetStatus,No,get_status,,,getStatus switch,GetResourceName,No,get_resource_name,Name,,name switch,Close,No,close,Close,, @@ -261,12 +279,14 @@ data_manager,UploadBinaryDataToDatasets,No,,UploadBinaryDataToDatasets,,uploadBi ## HACK: No proto for these (and/or inherited in Go SDK), manually mapping: data_manager,Reconfigure,No,,Reconfigure,, data_manager,DoCommand,No,,DoCommand,,doCommand +data_manager,GetStatus,No,,,,getStatus data_manager,GetResourceName,No,,Name,,name data_manager,Close,No,,Close,, ## Generic Service ## TED:Generic Component in Go SDK doesn't appear to implement (inherit) these: generic_service,DoCommand,,do_command,DoCommand,doCommand,doCommand +generic_service,GetStatus,,get_status,,getStatus,getStatus ## HACK: proto for close, manually mapping: ## TED: Go SDK also missing Close, but we have it in our docs?: generic_service,GetResourceName,,get_resource_name,Name,getResourceName,name @@ -278,6 +298,7 @@ mlmodel,Metadata,,metadata,Metadata,, ## HACK: proto for DoCommand or Close (and/or inherited in Go SDK), manually mapping: mlmodel,Reconfigure,,,Reconfigure,, mlmodel,DoCommand,,,DoCommand,, +mlmodel,GetStatus,,get_status,,, mlmodel,GetResourceName,,get_resource_name,Name,, mlmodel,Close,,close,Close,, @@ -293,6 +314,7 @@ motion,GetPlan,,get_plan,PlanHistory,,getPlan motion,Reconfigure,,,Reconfigure,, motion,FromRobot,,from_robot,,, motion,DoCommand,,do_command,DoCommand,,doCommand +motion,GetStatus,,get_status,,,getStatus motion,GetResourceName,,get_resource_name,Name,,name motion,Close,,close,Close,, @@ -310,6 +332,7 @@ slam,PointCloudMapFull,,,PointCloudMapFull,, ## HACK: proto for these (and/or inherited in Go SDK), manually mapping: slam,Reconfigure,,,Reconfigure,, slam,DoCommand,,do_command,DoCommand,,doCommand +slam,GetStatus,,get_status,,,getStatus slam,GetResourceName,,get_resource_name,Name,,name slam,Close,,close,Close,, @@ -323,6 +346,7 @@ vision,CaptureAllFromCamera,,capture_all_from_camera,CaptureAllFromCamera,,captu ## HACK: proto for these (and/or inherited in Go SDK), manually mapping: vision,Reconfigure,,,Reconfigure,, vision,DoCommand,,do_command,DoCommand,doCommand,doCommand +vision,GetStatus,,get_status,,getStatus,getStatus vision,GetResourceName,,get_resource_name,Name,getResourceName,name vision,GetProperties,,get_properties,GetProperties,properties,getProperties vision,Close,,close,Close,, @@ -332,6 +356,7 @@ world_state_store,ListUUIDs,,list_uuids,,,listUUIDs world_state_store,GetTransform,,get_transform,,,getTransform world_state_store,StreamTransformChanges,,stream_transform_changes,,,streamTransformChanges world_state_store,DoCommand,,do_command,,,doCommand +world_state_store,GetStatus,,get_status,,,getStatus world_state_store,GetResourceName,,get_resource_name,,,name world_state_store,Close,,close,,, @@ -488,6 +513,7 @@ data_sync,StreamingDataCaptureUpload,,streaming_data_capture_upload,,streamingDa discovery,DiscoverResources,,discover_resources,DiscoverResources,discoverResources,discoverResources discovery,GetResourceName,,get_resource_name,Name,getResourceName,name discovery,DoCommand,,do_command,DoCommand,doCommand,doCommand +discovery,GetStatus,,get_status,,getStatus,getStatus discovery,Close,,close,Close,, ## MLTraining diff --git a/.github/workflows/update_sdk_methods.py b/.github/workflows/update_sdk_methods.py index 47778dfcf6..fb0ce26a7c 100755 --- a/.github/workflows/update_sdk_methods.py +++ b/.github/workflows/update_sdk_methods.py @@ -354,7 +354,7 @@ "organization settings page": "/manage/reference/organize/", "image tags": "/data-ai/train/create-dataset/#label-your-images", "API key": "/fleet/cli/#authenticate", - "board model": "/dev/reference/apis/components/board/" + "board model": "/reference/apis/components/board/" } ## Map sdk language to specific code fence formatting syntax for that language: @@ -459,7 +459,7 @@ def get_proto_apis(): ## Link matching text, used in write_markdown(): ## NOTE: Currently does not support formatting for link titles -## (EXAMPLE: bolded DATA tab here: https://docs.viam.com/dev/reference/apis/data-client/#binarydatabyfilter) +## (EXAMPLE: bolded DATA tab here: https://docs.viam.com/reference/apis/data-client/#binarydatabyfilter) def link_description(format_type, full_description, link_text, link_url): ## Supports 'md' link styling or 'html' link styling. @@ -771,7 +771,7 @@ def check_for_unused_methods(methods, type): if not "used" in methods[lang][type][resource][method].keys(): if resource in ["data_sync", "dataset", "data"]: continue - if lang == "python" and method not in ["from_robot", "close", "get_resource_name", "get_geometries", "do_command", "proto", "transform", "updated_fields", "ListUUIDs", "GetTransform", "StreamTransformChanges", "DoCommand"] or \ + if lang == "python" and method not in ["from_robot", "close", "get_resource_name", "get_geometries", "do_command", "proto", "transform", "updated_fields", "ListUUIDs", "GetTransform", "StreamTransformChanges", "DoCommand", "GetStatus"] or \ lang == "go" and method not in ["Reconfigure", "ListTunnels", "Close", "DoCommand", "CurrentPosition", "AddTagsToBinaryDataByFilter", "RemoveTagsFromBinaryDataByFilter"] or \ lang == "flutter" and method not in ["getResources", "getStream", "getStreamOptions", "resetStreamOptions", "setStreamOptions", "Discovery.fromProto", "addCallbacks", "getResource"] or \ lang == "typescript" and method not in ["connect", "disconnect", "dial", "isConnected", "discoverComponents", "createServiceClient", "getRoverRentalRobots", "doCommand"]: @@ -930,31 +930,31 @@ def write_markdown(type, names, methods): if type == 'component': ## Replace underscores, and convert generic_component to just generic: resource_adjusted = resource.replace('generic_component', 'generic').replace('_','-') - proto_anchor_link = '/dev/reference/apis/components/' + resource_adjusted + '/#' + proto_link + proto_anchor_link = '/reference/apis/components/' + resource_adjusted + '/#' + proto_link elif type == 'service' and resource in ['base_remote_control', 'motion', 'slam', 'vision']: - proto_anchor_link = '/dev/reference/apis/services/' + resource.replace('base_remote_control', 'base-rc') + '/#' + proto_link + proto_anchor_link = '/reference/apis/services/' + resource.replace('base_remote_control', 'base-rc') + '/#' + proto_link elif type == 'service' and resource == 'data_manager': - proto_anchor_link = '/dev/reference/apis/services/data/#' + proto_link + proto_anchor_link = '/reference/apis/services/data/#' + proto_link elif type == 'service' and resource == 'discovery': - proto_anchor_link = '/dev/reference/apis/services/discovery/#' + proto_link + proto_anchor_link = '/reference/apis/services/discovery/#' + proto_link elif type == 'service' and resource == 'generic_service': - proto_anchor_link = '/dev/reference/apis/services/generic/#' + proto_link + proto_anchor_link = '/reference/apis/services/generic/#' + proto_link elif type == 'service' and resource == 'audio_in': - proto_anchor_link = '/dev/reference/apis/services/audio-in/#' + proto_link + proto_anchor_link = '/reference/apis/services/audio-in/#' + proto_link elif type == 'service' and resource == 'audio_out': - proto_anchor_link = '/dev/reference/apis/services/audio-out/#' + proto_link + proto_anchor_link = '/reference/apis/services/audio-out/#' + proto_link elif type == 'service' and resource == 'mlmodel': - proto_anchor_link = '/dev/reference/apis/services/ml/#' + proto_link + proto_anchor_link = '/reference/apis/services/ml/#' + proto_link elif type == 'service' and resource == 'world_state_store': - proto_anchor_link = '/dev/reference/apis/services/world-state-store/#' + proto_link + proto_anchor_link = '/reference/apis/services/world-state-store/#' + proto_link elif type == 'app' and resource == 'app': - proto_anchor_link = '/dev/reference/apis/fleet/#' + proto_link + proto_anchor_link = '/reference/apis/fleet/#' + proto_link elif type == 'app' and resource in ["billing", "mltraining"]: - proto_anchor_link = '/dev/reference/apis/' + resource.replace('mltraining','ml-training') + '-client/#' + proto_link + proto_anchor_link = '/reference/apis/' + resource.replace('mltraining','ml-training') + '-client/#' + proto_link elif type == 'app' and resource in ["data", "dataset", "data_sync"]: - proto_anchor_link = '/dev/reference/apis/data-client/#' + proto_link + proto_anchor_link = '/reference/apis/data-client/#' + proto_link elif type == 'robot': - proto_anchor_link = '/dev/reference/apis/' + resource + '/#' + proto_link + proto_anchor_link = '/reference/apis/' + resource + '/#' + proto_link ## Fetch just the first sentence from the proto_override_file (first text string terminated by '.\n'), ignoring hugo ## shortcodes like alerts ('{{%.*%}}.*{{% \[a-b].* %}}'), which precede some override files' (proto descriptions') @@ -965,6 +965,9 @@ def write_markdown(type, names, methods): with open(proto_override_file, 'r') as f: file_contents = f.read().strip() file_contents = regex.sub(r'\{\{\%.*\%\}\}.*\{\{\% \/[a-b].* \%\}\}', '', file_contents, flags=regex.DOTALL) + ## Same, for angle-bracket shortcodes ({{< alert >}}...{{< /alert >}}), which + ## otherwise leak an unclosed shortcode opener into the table description: + file_contents = regex.sub(r'\{\{<.*?>\}\}.*?\{\{< \/[a-b].*? >\}\}', '', file_contents, flags=regex.DOTALL) search_result = file_contents.split('.\n', 1)[0].strip().replace("\n", " ") ## If the proto description contains any MD links, strip them out: diff --git a/static/include/components/apis/generated/arm-table.md b/static/include/components/apis/generated/arm-table.md index e04be683e2..08b2cf9a51 100644 --- a/static/include/components/apis/generated/arm-table.md +++ b/static/include/components/apis/generated/arm-table.md @@ -13,5 +13,6 @@ | [`GetGeometries`](/reference/apis/components/arm/#getgeometries) | Get all the geometries associated with the arm in its current configuration, in the frame of the arm. | | [`Reconfigure`](/reference/apis/components/arm/#reconfigure) | Reconfigure this resource. | | [`DoCommand`](/reference/apis/components/arm/#docommand) | Execute model-specific commands that are not otherwise defined by the component API. | +| [`GetStatus`](/reference/apis/components/arm/#getstatus) | Get the current status of the arm as a map of key-value pairs describing its state. | | [`GetResourceName`](/reference/apis/components/arm/#getresourcename) | Get the `ResourceName` for this arm. | | [`Close`](/reference/apis/components/arm/#close) | Safely shut down the resource and prevent further use. | diff --git a/static/include/components/apis/generated/arm.md b/static/include/components/apis/generated/arm.md index 5f5f150b47..ec3bcfc7ea 100644 --- a/static/include/components/apis/generated/arm.md +++ b/static/include/components/apis/generated/arm.md @@ -161,7 +161,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Parameters:** -- `pose` ([PlainMessage](https://ts.viam.dev/types/PlainMessage.html)) (required): The destination pose for the arm. +- `pose` ([Pose](https://ts.viam.dev/types/Pose.html)) (required): The destination pose for the arm. - `extra` (None) (optional) - `callOptions` (CallOptions) (optional) @@ -597,8 +597,8 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Returns:** -- (Promise): The legacy kinematics data shape or the newer object containing -kinematics data plus a map of URDF mesh file paths to mesh data. +- (Promise): The legacy kinematics data shape or the newer object containing kinematics data plus a +map of URDF mesh file paths to mesh data. **Example:** @@ -608,7 +608,7 @@ const kinematics = await arm.getKinematics(); console.log(kinematics); For more information, see [Arm -API](https://docs.viam.com/reference/apis/components/arm/#getkinematics). +API](https://docs.viam.com/dev/reference/apis/components/arm/#getkinematics). ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/ArmClient.html#getkinematics). @@ -980,8 +980,8 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Parameters:** -- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or - a plain object, which will be converted automatically. +- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or a plain object, + which will be converted automatically. - `callOptions` (CallOptions) (optional) **Returns:** @@ -999,9 +999,7 @@ const result = await resource.doCommand({ // Struct (still supported) import { Struct } from '@viamrobotics/sdk'; -const result = await resource.doCommand( - Struct.fromJson({ myCommand: { key: 'value' } }) -); +const result = await resource.doCommand(Struct.fromJson({ myCommand: { key: 'value' } })); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/ArmClient.html#docommand). @@ -1030,6 +1028,58 @@ For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_s {{% /tab %}} {{< /tabs >}} +### GetStatus + +Get the current status of the arm as a map of key-value pairs describing its state. + +{{< tabs >}} +{{% tab name="Python" %}} + +**Parameters:** + +- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (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](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : The status of the component. + +**Example:** + +```python {class="line-numbers linkable-line-numbers"} +status = await component.get_status() +``` + +For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/arm/client/index.html#viam.components.arm.client.ArmClient.get_status). + +{{% /tab %}} +{{% tab name="TypeScript" %}} + +**Parameters:** + +- `callOptions` (CallOptions) (optional) + +**Returns:** + +- (Promise<[JsonValue](https://ts.viam.dev/types/JsonValue.html)>) + +For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/ArmClient.html#getstatus). + +{{% /tab %}} +{{% tab name="Flutter" %}} + +**Parameters:** + +- None. + +**Returns:** + +- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), dynamic>\> + +For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_sdk/Resource/getStatus.html). + +{{% /tab %}} +{{< /tabs >}} + ### GetResourceName Get the `ResourceName` for this arm. diff --git a/static/include/components/apis/generated/audio_in-table.md b/static/include/components/apis/generated/audio_in-table.md index a93ed3cb94..7eadacac4f 100644 --- a/static/include/components/apis/generated/audio_in-table.md +++ b/static/include/components/apis/generated/audio_in-table.md @@ -6,5 +6,6 @@ | [`GetGeometries`](/reference/apis/components/audio-in/#getgeometries) | Get all the geometries associated with the audio in component in its current configuration, in the frame of the audio in component. | | [`Reconfigure`](/reference/apis/components/audio-in/#reconfigure) | Reconfigure this resource. | | [`DoCommand`](/reference/apis/components/audio-in/#docommand) | Execute model-specific commands that are not otherwise defined by the component API. | +| [`GetStatus`](/reference/apis/components/audio-in/#getstatus) | Get the current status of the audio input component as a map of key-value pairs describing its state. | | [`GetResourceName`](/reference/apis/components/audio-in/#getresourcename) | Get the `ResourceName` for this audio in component. | | [`Close`](/reference/apis/components/audio-in/#close) | Safely shut down the resource and prevent further use. | diff --git a/static/include/components/apis/generated/audio_in.md b/static/include/components/apis/generated/audio_in.md index d44c0f69c3..a416906b79 100644 --- a/static/include/components/apis/generated/audio_in.md +++ b/static/include/components/apis/generated/audio_in.md @@ -285,8 +285,8 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Parameters:** -- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or - a plain object, which will be converted automatically. +- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or a plain object, + which will be converted automatically. - `callOptions` (CallOptions) (optional) **Returns:** @@ -304,9 +304,7 @@ const result = await resource.doCommand({ // Struct (still supported) import { Struct } from '@viamrobotics/sdk'; -const result = await resource.doCommand( - Struct.fromJson({ myCommand: { key: 'value' } }) -); +const result = await resource.doCommand(Struct.fromJson({ myCommand: { key: 'value' } })); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/AudioInClient.html#docommand). @@ -335,6 +333,58 @@ For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_s {{% /tab %}} {{< /tabs >}} +### GetStatus + +Get the current status of the audio input component as a map of key-value pairs describing its state. + +{{< tabs >}} +{{% tab name="Python" %}} + +**Parameters:** + +- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (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](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : The status of the component. + +**Example:** + +```python {class="line-numbers linkable-line-numbers"} +status = await component.get_status() +``` + +For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/audio_in/client/index.html#viam.components.audio_in.client.AudioInClient.get_status). + +{{% /tab %}} +{{% tab name="TypeScript" %}} + +**Parameters:** + +- `callOptions` (CallOptions) (optional) + +**Returns:** + +- (Promise<[JsonValue](https://ts.viam.dev/types/JsonValue.html)>) + +For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/AudioInClient.html#getstatus). + +{{% /tab %}} +{{% tab name="Flutter" %}} + +**Parameters:** + +- None. + +**Returns:** + +- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), dynamic>\> + +For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_sdk/AudioInClient/getStatus.html). + +{{% /tab %}} +{{< /tabs >}} + ### GetResourceName Get the `ResourceName` for this audio in component. diff --git a/static/include/components/apis/generated/audio_out-table.md b/static/include/components/apis/generated/audio_out-table.md index 09b057f6da..81596976b4 100644 --- a/static/include/components/apis/generated/audio_out-table.md +++ b/static/include/components/apis/generated/audio_out-table.md @@ -7,5 +7,6 @@ | [`GetGeometries`](/reference/apis/components/audio-out/#getgeometries) | Get all the geometries associated with the audio out component in its current configuration, in the frame of the audio out component. | | [`Reconfigure`](/reference/apis/components/audio-out/#reconfigure) | Reconfigure this resource. | | [`DoCommand`](/reference/apis/components/audio-out/#docommand) | Execute model-specific commands that are not otherwise defined by the component API. | +| [`GetStatus`](/reference/apis/components/audio-out/#getstatus) | Get the current status of the audio output component as a map of key-value pairs describing its state. | | [`GetResourceName`](/reference/apis/components/audio-out/#getresourcename) | Get the `ResourceName` for this audio out component. | | [`Close`](/reference/apis/components/audio-out/#close) | Safely shut down the resource and prevent further use. | diff --git a/static/include/components/apis/generated/audio_out.md b/static/include/components/apis/generated/audio_out.md index 47f8ef82cb..b6ccf12f55 100644 --- a/static/include/components/apis/generated/audio_out.md +++ b/static/include/components/apis/generated/audio_out.md @@ -38,7 +38,7 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/ - `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries. - `data` [([]byte)](https://pkg.go.dev/builtin#byte) -- `info` [(\*utils.AudioInfo)](https://pkg.go.dev/go.viam.com/rdk/utils#AudioInfo) +- `info` [(*utils.AudioInfo)](https://pkg.go.dev/go.viam.com/rdk/utils#AudioInfo) - `extra` [(map[string]interface{})](https://go.dev/blog/maps): Extra options to pass to the underlying RPC call. **Returns:** @@ -53,8 +53,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Parameters:** - `audioData` (Uint8Array) (required): The audio data to play. -- `audioInfo` ([AudioInfo](https://ts.viam.dev/classes/commonApi.AudioInfo.html)) (optional): Information about the audio format (optional, required - for raw pcm data). +- `audioInfo` ([AudioInfo](https://ts.viam.dev/classes/commonApi.AudioInfo.html)) (optional): Information about the audio format (optional, required for raw pcm data). - `extra` (None) (optional) - `callOptions` (CallOptions) (optional) @@ -100,8 +99,8 @@ Stream audio data in chunks for playback. **Parameters:** -- `chunks` ([AsyncIterator](https://docs.python.org/3/library/collections.abc.html#collections.abc.AsyncIterator)[[bytes](https://docs.python.org/3/library/stdtypes.html#bytes-objects)]) (required): Async iterator of audio data chunks to play. -- `info` (viam.components.audio_out.audio_out.AudioInfo) (optional): Information about the audio data such as codec, sample rate, and channel count. +- `chunks` (AsyncIterator[[bytes](https://docs.python.org/3/library/stdtypes.html#bytes-objects)]) (required): async iterator of audio data chunks to play. +- `info` (viam.components.audio_out.audio_out.AudioInfo) (optional): (optional) information about the audio data such as codec, sample rate, and channel count. - `extra` (Mapping[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), Any]) (optional): Extra options to pass to the underlying RPC call. - `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call. @@ -130,33 +129,14 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/ **Parameters:** - `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries. -- `info` [(\*utils.AudioInfo)](https://pkg.go.dev/go.viam.com/rdk/utils#AudioInfo): Information about the audio data such as codec, sample rate, and channel count. -- `chunks` [(<-chan []byte)](https://pkg.go.dev/builtin#byte): A receive-only channel of audio data chunks. Close the channel to signal end of stream. +- `info` [(*utils.AudioInfo)](https://pkg.go.dev/go.viam.com/rdk/utils#AudioInfo) +- `info` [(*utils.AudioInfo)](https://pkg.go.dev/go.viam.com/rdk/utils#AudioInfo) - `extra` [(map[string]interface{})](https://go.dev/blog/maps): Extra options to pass to the underlying RPC call. **Returns:** - [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred. -**Example:** - -```go {class="line-numbers linkable-line-numbers"} -myAudioOut, err := audioout.FromProvider(machine, "my_audio_out") - -info := &utils.AudioInfo{ - Codec: utils.CodecPCM16, - SampleRateHz: 44100, - NumChannels: 2, -} - -chunks := make(chan []byte, 2) -chunks <- audioChunk1 -chunks <- audioChunk2 -close(chunks) - -err = myAudioOut.PlayStream(context.Background(), info, chunks, nil) -``` - For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/components/audioout#AudioOut). {{% /tab %}} @@ -164,21 +144,22 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Parameters:** -- `audioInfo` ([AudioInfo](https://ts.viam.dev/classes/commonApi.AudioInfo.html)) (required): Information about the audio format (codec, sample rate, channels) that applies to every chunk. -- `chunks` (AsyncIterable\) (required): Async iterable of audio byte chunks to play in order. +- `audioInfo` ([AudioInfo](https://ts.viam.dev/classes/commonApi.AudioInfo.html)) (required): Information about the audio format (codec, sample rate, channels) that + applies to every chunk. +- `chunks` (AsyncIterable) (required): Async iterable of audio byte chunks to play in order. - `extra` (None) (optional) - `callOptions` (CallOptions) (optional) **Returns:** -- (Promise\) +- (Promise) **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const audioOut = new VIAM.AudioOutClient(machine, "my_audio_out"); +const audioOut = new VIAM.AudioOutClient(machine, 'my_audio_out'); const audioInfo = { - codec: "pcm16", + codec: 'pcm16', sampleRateHz: 22050, numChannels: 1, }; @@ -197,26 +178,13 @@ For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/ **Parameters:** -- `audioInfo` [AudioInfo](https://flutter.viam.dev/viam_protos.common.common/AudioInfo-class.html) (required): Information about the audio format (codec, sample rate, channels) that applies to every chunk. -- `audioStream` [Stream](https://api.flutter.dev/flutter/dart-async/Stream-class.html)\<[Uint8List](https://api.flutter.dev/flutter/dart-typed_data/Uint8List-class.html)\> (required): A stream of raw audio byte chunks to play in order. -- `extra` [Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)\<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), dynamic\>? (optional) +- `audioInfo` [AudioInfo](https://flutter.viam.dev/viam_protos.common.common/AudioInfo-class.html) (optional) +- `audioStream` [Stream](https://api.flutter.dev/flutter/dart-async/Stream-class.html)<[Uint8List](https://api.flutter.dev/flutter/dart-typed_data/Uint8List-class.html)> (optional) +- `extra` [Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), dynamic>? (optional) **Returns:** -- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)\<[PlayStreamResponse](https://flutter.viam.dev/viam_protos.component.audioout/PlayStreamResponse-class.html)\> - -**Example:** - -```dart {class="line-numbers linkable-line-numbers"} -final audioOut = AudioOut.fromRobot(robot, 'my_audio_out'); -final audioInfo = AudioInfo() - ..codec = AudioCodec.PCM16 - ..sampleRateHz = 22050 - ..numChannels = 1; - -final stream = Stream.fromIterable(audioChunks); -await audioOut.playStream(audioInfo: audioInfo, audioStream: stream); -``` +- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[PlayStreamResponse](https://flutter.viam.dev/viam_protos.component.audioout/PlayStreamResponse-class.html)> For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_sdk/AudioOutClient/playStream.html). @@ -237,7 +205,7 @@ Get the audio device’s properties. **Returns:** -- ([viam.components.audio_out.audio_out.AudioOut.Properties](https://python.viam.dev/autoapi/viam/components/audio_out/audio_out/index.html#viam.components.audio_out.audio_out.AudioOut.Properties)): : The properties of the audio output device. +- ([viam.components.audio_out.audio_out.AudioOut.Properties](https://python.viam.dev/autoapi/viam/components/audio_out/audio_out/index.html#viam.components.audio_out.audio_out.AudioOut.Properties)): : The properties of the audio output device. **Example:** @@ -278,7 +246,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const audioOut = new VIAM.AudioOutClient(machine, "my_audio_out"); +const audioOut = new VIAM.AudioOutClient(machine, 'my_audio_out'); const properties = await audioOut.getProperties(); ``` @@ -315,7 +283,7 @@ The [motion](/reference/services/motion/) and [navigation](/reference/services/n **Returns:** -- ([List[viam.proto.common.Geometry]](https://python.viam.dev/autoapi/viam/proto/common/index.html#viam.proto.common.Geometry)): : The geometries associated with the Component. +- ([List[viam.proto.common.Geometry]](https://python.viam.dev/autoapi/viam/proto/common/index.html#viam.proto.common.Geometry)): : The geometries associated with the Component. **Example:** @@ -373,7 +341,7 @@ If you are implementing your own arm and want to add features that have no corre **Returns:** -- (Mapping[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : Result of the executed command. +- (Mapping[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : Result of the executed command. **Raises:** @@ -418,8 +386,8 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Parameters:** -- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or - a plain object, which will be converted automatically. +- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or a plain object, + which will be converted automatically. - `callOptions` (CallOptions) (optional) **Returns:** @@ -431,15 +399,13 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r ```ts {class="line-numbers linkable-line-numbers"} // Plain object (recommended) const result = await resource.doCommand({ - myCommand: { key: "value" }, + myCommand: { key: 'value' }, }); // Struct (still supported) -import { Struct } from "@viamrobotics/sdk"; +import { Struct } from '@viamrobotics/sdk'; -const result = await resource.doCommand( - Struct.fromJson({ myCommand: { key: "value" } }), -); +const result = await resource.doCommand(Struct.fromJson({ myCommand: { key: 'value' } })); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/AudioOutClient.html#docommand). @@ -468,6 +434,58 @@ For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_s {{% /tab %}} {{< /tabs >}} +### GetStatus + +Get the current status of the audio output component as a map of key-value pairs describing its state. + +{{< tabs >}} +{{% tab name="Python" %}} + +**Parameters:** + +- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (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](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : The status of the component. + +**Example:** + +```python {class="line-numbers linkable-line-numbers"} +status = await component.get_status() +``` + +For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/audio_out/client/index.html#viam.components.audio_out.client.AudioOutClient.get_status). + +{{% /tab %}} +{{% tab name="TypeScript" %}} + +**Parameters:** + +- `callOptions` (CallOptions) (optional) + +**Returns:** + +- (Promise<[JsonValue](https://ts.viam.dev/types/JsonValue.html)>) + +For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/AudioOutClient.html#getstatus). + +{{% /tab %}} +{{% tab name="Flutter" %}} + +**Parameters:** + +- None. + +**Returns:** + +- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), dynamic>\> + +For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_sdk/AudioOutClient/getStatus.html). + +{{% /tab %}} +{{< /tabs >}} + ### GetResourceName Get the `ResourceName` for this audio out component. @@ -481,7 +499,7 @@ Get the `ResourceName` for this audio out component. **Returns:** -- ([viam.proto.common.ResourceName](https://python.viam.dev/autoapi/viam/proto/common/index.html#viam.proto.common.ResourceName)): : The ResourceName of this Resource. +- ([viam.proto.common.ResourceName](https://python.viam.dev/autoapi/viam/proto/common/index.html#viam.proto.common.ResourceName)): : The ResourceName of this Resource. **Example:** @@ -526,7 +544,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Example:** ```ts {class="line-numbers linkable-line-numbers"} -audio_out.name; +audio_out.name ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/AudioOutClient.html#name). diff --git a/static/include/components/apis/generated/base-table.md b/static/include/components/apis/generated/base-table.md index 3c6f63b566..4b22a204b6 100644 --- a/static/include/components/apis/generated/base-table.md +++ b/static/include/components/apis/generated/base-table.md @@ -11,5 +11,6 @@ | [`GetGeometries`](/reference/apis/components/base/#getgeometries) | Get all the geometries associated with the base in its current configuration, in the frame of the base. | | | [`Reconfigure`](/reference/apis/components/base/#reconfigure) | Reconfigure this resource. | | | [`DoCommand`](/reference/apis/components/base/#docommand) | Execute model-specific commands that are not otherwise defined by the component API. |

| +| [`GetStatus`](/reference/apis/components/base/#getstatus) | Get the current status of the base as a map of key-value pairs describing its state. | | | [`GetResourceName`](/reference/apis/components/base/#getresourcename) | Get the `ResourceName` for this base. | | | [`Close`](/reference/apis/components/base/#close) | Safely shut down the resource and prevent further use. | | diff --git a/static/include/components/apis/generated/base.md b/static/include/components/apis/generated/base.md index 3862244d16..4cc5c7d14a 100644 --- a/static/include/components/apis/generated/base.md +++ b/static/include/components/apis/generated/base.md @@ -311,8 +311,8 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Parameters:** -- `linear` ([PlainMessage](https://ts.viam.dev/types/PlainMessage.html)) (required): Desired linear power percentage from -1 to 1. -- `angular` ([PlainMessage](https://ts.viam.dev/types/PlainMessage.html)) (required): Desired angular power percentage from -1 to 1. +- `linear` ([Vector3](https://ts.viam.dev/types/Vector3.html)) (required): Desired linear power percentage from -1 to 1. +- `angular` ([Vector3](https://ts.viam.dev/types/Vector3.html)) (required): Desired angular power percentage from -1 to 1. - `extra` (None) (optional) - `callOptions` (CallOptions) (optional) @@ -328,25 +328,25 @@ const base = new VIAM.BaseClient(machine, 'my_base'); // Move forward at 75% power await base.setPower( { x: 0, y: 0.75, z: 0 }, // linear power - { x: 0, y: 0, z: 0 } // no rotation + { x: 0, y: 0, z: 0 }, // no rotation ); // Move straight back at 100% power await base.setPower( { x: 0, y: -1, z: 0 }, // linear power - { x: 0, y: 0, z: 0 } // no rotation + { x: 0, y: 0, z: 0 }, // no rotation ); // Turn counter-clockwise at 50% power await base.setPower( { x: 0, y: 0, z: 0 }, // no linear movement - { x: 0, y: 0, z: 0.5 } // rotate around z-axis + { x: 0, y: 0, z: 0.5 }, // rotate around z-axis ); // Turn clockwise at 60% power await base.setPower( { x: 0, y: 0, z: 0 }, // no linear movement - { x: 0, y: 0, z: -0.6 } // rotate around z-axis + { x: 0, y: 0, z: -0.6 }, // rotate around z-axis ); ``` @@ -447,8 +447,8 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Parameters:** -- `linear` ([PlainMessage](https://ts.viam.dev/types/PlainMessage.html)) (required): Desired linear velocity in millimeters per second. -- `angular` ([PlainMessage](https://ts.viam.dev/types/PlainMessage.html)) (required): Desired angular velocity in degrees per second. +- `linear` ([Vector3](https://ts.viam.dev/types/Vector3.html)) (required): Desired linear velocity in millimeters per second. +- `angular` ([Vector3](https://ts.viam.dev/types/Vector3.html)) (required): Desired angular velocity in degrees per second. - `extra` (None) (optional) - `callOptions` (CallOptions) (optional) @@ -464,7 +464,7 @@ const base = new VIAM.BaseClient(machine, 'my_base'); // Move forward at 50mm/s while spinning 15 degrees per second to the left await base.setVelocity( { x: 0, y: 50, z: 0 }, // linear velocity in mm/s - { x: 0, y: 0, z: 15 } // 15 degrees per second counter-clockwise + { x: 0, y: 0, z: 15 }, // 15 degrees per second counter-clockwise ); ``` @@ -974,8 +974,8 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Parameters:** -- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or - a plain object, which will be converted automatically. +- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or a plain object, + which will be converted automatically. - `callOptions` (CallOptions) (optional) **Returns:** @@ -993,9 +993,7 @@ const result = await resource.doCommand({ // Struct (still supported) import { Struct } from '@viamrobotics/sdk'; -const result = await resource.doCommand( - Struct.fromJson({ myCommand: { key: 'value' } }) -); +const result = await resource.doCommand(Struct.fromJson({ myCommand: { key: 'value' } })); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/BaseClient.html#docommand). @@ -1024,6 +1022,58 @@ For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_s {{% /tab %}} {{< /tabs >}} +### GetStatus + +Get the current status of the base as a map of key-value pairs describing its state. + +{{< tabs >}} +{{% tab name="Python" %}} + +**Parameters:** + +- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (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](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : The status of the component. + +**Example:** + +```python {class="line-numbers linkable-line-numbers"} +status = await component.get_status() +``` + +For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/base/client/index.html#viam.components.base.client.BaseClient.get_status). + +{{% /tab %}} +{{% tab name="TypeScript" %}} + +**Parameters:** + +- `callOptions` (CallOptions) (optional) + +**Returns:** + +- (Promise<[JsonValue](https://ts.viam.dev/types/JsonValue.html)>) + +For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/BaseClient.html#getstatus). + +{{% /tab %}} +{{% tab name="Flutter" %}} + +**Parameters:** + +- None. + +**Returns:** + +- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), dynamic>\> + +For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_sdk/Resource/getStatus.html). + +{{% /tab %}} +{{< /tabs >}} + ### GetResourceName Get the `ResourceName` for this base. diff --git a/static/include/components/apis/generated/board-table.md b/static/include/components/apis/generated/board-table.md index 064b370691..2bf40480ca 100644 --- a/static/include/components/apis/generated/board-table.md +++ b/static/include/components/apis/generated/board-table.md @@ -18,5 +18,6 @@ | [`GetGeometries`](/reference/apis/components/board/#getgeometries) | Get all the geometries associated with the board in its current configuration, in the frame of the board. | | | [`Reconfigure`](/reference/apis/components/board/#reconfigure) | Reconfigure this resource. | | | [`DoCommand`](/reference/apis/components/board/#docommand) | Execute model-specific commands that are not otherwise defined by the component API. |

| +| [`GetStatus`](/reference/apis/components/board/#getstatus) | Get the current status of the board as a map of key-value pairs describing its state. | | | [`GetResourceName`](/reference/apis/components/board/#getresourcename) | Get the `ResourceName` for this board. | | | [`Close`](/reference/apis/components/board/#close) | Safely shut down the resource and prevent further use. | | diff --git a/static/include/components/apis/generated/board.md b/static/include/components/apis/generated/board.md index a5317b2e82..ff0749aa48 100644 --- a/static/include/components/apis/generated/board.md +++ b/static/include/components/apis/generated/board.md @@ -63,8 +63,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Parameters:** - `pin` (string) (required): The pin number. -- `high` (boolean) (required): When true, set the given pin to high. When false, set the - given pin to low. +- `high` (boolean) (required): When true, set the given pin to high. When false, set the given pin to low. - `extra` (None) (optional) - `callOptions` (CallOptions) (optional) @@ -615,8 +614,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Parameters:** - `pin` (string) (required): The pin. -- `frequencyHz` (number) (required): The PWM frequency, in hertz. 0 will use the board's - default PWM frequency. +- `frequencyHz` (number) (required): The PWM frequency, in hertz. 0 will use the board's default PWM frequency. - `extra` (None) (optional) - `callOptions` (CallOptions) (optional) @@ -739,9 +737,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c const board = new VIAM.BoardClient(machine, 'my_board'); // Get the number of times this DigitalInterrupt has been interrupted with a tick. -const count = await board.getDigitalInterruptValue( - 'my_example_digital_interrupt' -); +const count = await board.getDigitalInterruptValue('my_example_digital_interrupt'); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/BoardClient.html#getdigitalinterruptvalue). @@ -852,9 +848,7 @@ const board = new VIAM.BoardClient(machine, 'my_board'); // Get the value of the analog signal "my_example_analog_reader" has most // recently measured. -const reading = await board.readAnalogReader( - 'my_example_analog_reader' -); +const reading = await board.readAnalogReader('my_example_analog_reader'); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/BoardClient.html#readanalogreader). @@ -1083,7 +1077,7 @@ const ticks = await board.streamTicks(['8', '11']); for await (const tick of ticks) { console.log( - `Pin ${tick.pinName} changed to ${tick.high ? 'high' : 'low'} at ${tick.time}` + `Pin ${tick.pinName} changed to ${tick.high ? 'high' : 'low'} at ${tick.time}`, ); } ``` @@ -1507,8 +1501,8 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Parameters:** -- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or - a plain object, which will be converted automatically. +- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or a plain object, + which will be converted automatically. - `callOptions` (CallOptions) (optional) **Returns:** @@ -1526,9 +1520,7 @@ const result = await resource.doCommand({ // Struct (still supported) import { Struct } from '@viamrobotics/sdk'; -const result = await resource.doCommand( - Struct.fromJson({ myCommand: { key: 'value' } }) -); +const result = await resource.doCommand(Struct.fromJson({ myCommand: { key: 'value' } })); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/BoardClient.html#docommand). @@ -1557,6 +1549,58 @@ For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_s {{% /tab %}} {{< /tabs >}} +### GetStatus + +Get the current status of the board as a map of key-value pairs describing its state. + +{{< tabs >}} +{{% tab name="Python" %}} + +**Parameters:** + +- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (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](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : The status of the component. + +**Example:** + +```python {class="line-numbers linkable-line-numbers"} +status = await component.get_status() +``` + +For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/board/client/index.html#viam.components.board.client.BoardClient.get_status). + +{{% /tab %}} +{{% tab name="TypeScript" %}} + +**Parameters:** + +- `callOptions` (CallOptions) (optional) + +**Returns:** + +- (Promise<[JsonValue](https://ts.viam.dev/types/JsonValue.html)>) + +For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/BoardClient.html#getstatus). + +{{% /tab %}} +{{% tab name="Flutter" %}} + +**Parameters:** + +- None. + +**Returns:** + +- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), dynamic>\> + +For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_sdk/Resource/getStatus.html). + +{{% /tab %}} +{{< /tabs >}} + ### GetResourceName Get the `ResourceName` for this board. diff --git a/static/include/components/apis/generated/button-table.md b/static/include/components/apis/generated/button-table.md index 4588bcfb61..77dee10bfe 100644 --- a/static/include/components/apis/generated/button-table.md +++ b/static/include/components/apis/generated/button-table.md @@ -4,5 +4,6 @@ | [`Push`](/reference/apis/components/button/#push) | Push the button. |

| | [`Reconfigure`](/reference/apis/components/button/#reconfigure) | Reconfigure this resource. | | | [`DoCommand`](/reference/apis/components/button/#docommand) | Execute model-specific commands that are not otherwise defined by the component API. |

| +| [`GetStatus`](/reference/apis/components/button/#getstatus) | Get the current status of the button as a map of key-value pairs describing its state. | | | [`GetResourceName`](/reference/apis/components/button/#getresourcename) | Get the `ResourceName` for this button. | | | [`Close`](/reference/apis/components/button/#close) | Safely shut down the resource and prevent further use. | | diff --git a/static/include/components/apis/generated/button.md b/static/include/components/apis/generated/button.md index 76ab9f81bd..0d7d501027 100644 --- a/static/include/components/apis/generated/button.md +++ b/static/include/components/apis/generated/button.md @@ -179,8 +179,8 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Parameters:** -- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or - a plain object, which will be converted automatically. +- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or a plain object, + which will be converted automatically. - `callOptions` (CallOptions) (optional) **Returns:** @@ -198,9 +198,7 @@ const result = await resource.doCommand({ // Struct (still supported) import { Struct } from '@viamrobotics/sdk'; -const result = await resource.doCommand( - Struct.fromJson({ myCommand: { key: 'value' } }) -); +const result = await resource.doCommand(Struct.fromJson({ myCommand: { key: 'value' } })); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/ButtonClient.html#docommand). @@ -229,6 +227,58 @@ For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_s {{% /tab %}} {{< /tabs >}} +### GetStatus + +Get the current status of the button as a map of key-value pairs describing its state. + +{{< tabs >}} +{{% tab name="Python" %}} + +**Parameters:** + +- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (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](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : The status of the component. + +**Example:** + +```python {class="line-numbers linkable-line-numbers"} +status = await component.get_status() +``` + +For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/button/client/index.html#viam.components.button.client.ButtonClient.get_status). + +{{% /tab %}} +{{% tab name="TypeScript" %}} + +**Parameters:** + +- `callOptions` (CallOptions) (optional) + +**Returns:** + +- (Promise<[JsonValue](https://ts.viam.dev/types/JsonValue.html)>) + +For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/ButtonClient.html#getstatus). + +{{% /tab %}} +{{% tab name="Flutter" %}} + +**Parameters:** + +- None. + +**Returns:** + +- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), dynamic>\> + +For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_sdk/Resource/getStatus.html). + +{{% /tab %}} +{{< /tabs >}} + ### GetResourceName Get the `ResourceName` for this button. diff --git a/static/include/components/apis/generated/camera-table.md b/static/include/components/apis/generated/camera-table.md index 58c8ecc2f7..e92f736f81 100644 --- a/static/include/components/apis/generated/camera-table.md +++ b/static/include/components/apis/generated/camera-table.md @@ -5,6 +5,7 @@ | [`GetPointCloud`](/reference/apis/components/camera/#getpointcloud) | Get a point cloud from the camera as bytes with a MIME type describing the structure of the data. | | [`GetProperties`](/reference/apis/components/camera/#getproperties) | Get the camera intrinsic parameters and camera distortion, as well as whether the camera supports returning point clouds. | | [`DoCommand`](/reference/apis/components/camera/#docommand) | Execute model-specific commands that are not otherwise defined by the component API. | +| [`GetStatus`](/reference/apis/components/camera/#getstatus) | Get the current status of the camera as a map of key-value pairs describing its state. | | [`GetGeometries`](/reference/apis/components/camera/#getgeometries) | Get all the geometries associated with the camera in its current configuration, in the frame of the camera. | | [`GetResourceName`](/reference/apis/components/camera/#getresourcename) | Get the `ResourceName` for this camera. | | [`Close`](/reference/apis/components/camera/#close) | Safely shut down the resource and prevent further use. | diff --git a/static/include/components/apis/generated/camera.md b/static/include/components/apis/generated/camera.md index a60d9d0147..98f9eefa9f 100644 --- a/static/include/components/apis/generated/camera.md +++ b/static/include/components/apis/generated/camera.md @@ -14,7 +14,7 @@ Multiple images returned from `GetImages()` do not represent a time series of im **Parameters:** -- `filter_source_names` (Sequence[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)]) (optional): The filter_source_names parameter can be used to filter only the images from the specified source names. When unspecified, all images are returned. +- `filter_source_names` ([Sequence[str]](https://python.viam.dev/autoapi/viam/gen/app/data/v1/data_pb2/index.html#viam.gen.app.data.v1.data_pb2.Sequence)) (optional): The filter_source_names parameter can be used to filter only the images from the specified source names. When unspecified, all images are returned. - `extra` (Mapping[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), Any]) (optional): Extra options to pass to the underlying RPC call. - `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call. @@ -65,14 +65,14 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Parameters:** -- `filterSourceNames` (string) (optional): A list of source names to filter the images by. - If empty or undefined, all images will be returned. +- `filterSourceNames` (string) (optional): A list of source names to filter the images by. If empty or + undefined, all images will be returned. - `extra` (None) (optional): Extra parameters to pass to the camera. - `callOptions` (CallOptions) (optional) **Returns:** -- (Promise< { images: { image: Uint8Array; mimeType: string; sourceName: string }[]; metadata: ResponseMetadata; }, >) +- (Promise< { images: { image: Uint8Array; mimeType: string; sourceName: string; }[]; metadata: ResponseMetadata; }, >) **Example:** @@ -178,7 +178,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Returns:** -- (Promise) +- (Promise>) **Example:** @@ -355,8 +355,8 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Parameters:** -- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or - a plain object, which will be converted automatically. +- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or a plain object, + which will be converted automatically. - `callOptions` (CallOptions) (optional) **Returns:** @@ -374,9 +374,7 @@ const result = await resource.doCommand({ // Struct (still supported) import { Struct } from '@viamrobotics/sdk'; -const result = await resource.doCommand( - Struct.fromJson({ myCommand: { key: 'value' } }) -); +const result = await resource.doCommand(Struct.fromJson({ myCommand: { key: 'value' } })); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/CameraClient.html#docommand). @@ -405,6 +403,58 @@ For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_s {{% /tab %}} {{< /tabs >}} +### GetStatus + +Get the current status of the camera as a map of key-value pairs describing its state. + +{{< tabs >}} +{{% tab name="Python" %}} + +**Parameters:** + +- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call. + +**Returns:** + +- (Dict[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), Any]): : The status of the component. + +**Example:** + +```python {class="line-numbers linkable-line-numbers"} +status = await component.get_status() +``` + +For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/camera/client/index.html#viam.components.camera.client.CameraClient.get_status). + +{{% /tab %}} +{{% tab name="TypeScript" %}} + +**Parameters:** + +- `callOptions` (CallOptions) (optional) + +**Returns:** + +- (Promise<[JsonValue](https://ts.viam.dev/types/JsonValue.html)>) + +For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/CameraClient.html#getstatus). + +{{% /tab %}} +{{% tab name="Flutter" %}} + +**Parameters:** + +- None. + +**Returns:** + +- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), dynamic>\> + +For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_sdk/Resource/getStatus.html). + +{{% /tab %}} +{{< /tabs >}} + ### GetGeometries Get all the geometries associated with the camera in its current configuration, in the [frame](/reference/services/frame-system/) of the camera. @@ -420,7 +470,7 @@ The [motion](/reference/services/motion/) and [navigation](/reference/services/n **Returns:** -- ([Sequence[viam.proto.common.Geometry]](https://python.viam.dev/autoapi/viam/proto/common/index.html#viam.proto.common.Geometry)): : The geometries associated with the Component. +- ([Sequence[viam.proto.common.Geometry]](https://python.viam.dev/autoapi/viam/gen/app/data/v1/data_pb2/index.html#viam.gen.app.data.v1.data_pb2.Sequence)): : The geometries associated with the Component. **Example:** diff --git a/static/include/components/apis/generated/encoder-table.md b/static/include/components/apis/generated/encoder-table.md index f4aacec353..5529a83065 100644 --- a/static/include/components/apis/generated/encoder-table.md +++ b/static/include/components/apis/generated/encoder-table.md @@ -7,5 +7,6 @@ | [`GetGeometries`](/reference/apis/components/encoder/#getgeometries) | Get all the geometries associated with the encoder in its current configuration, in the frame of the encoder. | | | [`Reconfigure`](/reference/apis/components/encoder/#reconfigure) | Reconfigure this resource. | | | [`DoCommand`](/reference/apis/components/encoder/#docommand) | Execute model-specific commands that are not otherwise defined by the component API. |

| +| [`GetStatus`](/reference/apis/components/encoder/#getstatus) | Get the current status of the encoder as a map of key-value pairs describing its state. | | | [`GetResourceName`](/reference/apis/components/encoder/#getresourcename) | Get the `ResourceName` for this encoder. | | | [`Close`](/reference/apis/components/encoder/#close) | Safely shut down the resource and prevent further use. | | diff --git a/static/include/components/apis/generated/encoder.md b/static/include/components/apis/generated/encoder.md index 84fbef39ba..df39618249 100644 --- a/static/include/components/apis/generated/encoder.md +++ b/static/include/components/apis/generated/encoder.md @@ -66,8 +66,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Parameters:** -- `positionType` ([PositionType](https://ts.viam.dev/enums/encoderApi.PositionType.html)) (optional): The type of position the encoder returns (ticks or - degrees). +- `positionType` ([PositionType](https://ts.viam.dev/enums/encoderApi.PositionType.html)) (optional): The type of position the encoder returns (ticks or degrees). - `extra` (None) (optional) - `callOptions` (CallOptions) (optional) @@ -82,7 +81,7 @@ const encoder = new VIAM.EncoderClient(machine, 'my_encoder'); // Get the position of the encoder in ticks const [position, posType] = await encoder.getPosition( - EncoderPositionType.POSITION_TYPE_TICKS_COUNT + EncoderPositionType.POSITION_TYPE_TICKS_COUNT, ); console.log('The encoder position is currently', position, posType); ``` @@ -368,8 +367,8 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Parameters:** -- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or - a plain object, which will be converted automatically. +- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or a plain object, + which will be converted automatically. - `callOptions` (CallOptions) (optional) **Returns:** @@ -387,9 +386,7 @@ const result = await resource.doCommand({ // Struct (still supported) import { Struct } from '@viamrobotics/sdk'; -const result = await resource.doCommand( - Struct.fromJson({ myCommand: { key: 'value' } }) -); +const result = await resource.doCommand(Struct.fromJson({ myCommand: { key: 'value' } })); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/EncoderClient.html#docommand). @@ -397,6 +394,45 @@ For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/ {{% /tab %}} {{< /tabs >}} +### GetStatus + +Get the current status of the encoder as a map of key-value pairs describing its state. + +{{< tabs >}} +{{% tab name="Python" %}} + +**Parameters:** + +- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (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](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : The status of the component. + +**Example:** + +```python {class="line-numbers linkable-line-numbers"} +status = await component.get_status() +``` + +For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/encoder/client/index.html#viam.components.encoder.client.EncoderClient.get_status). + +{{% /tab %}} +{{% tab name="TypeScript" %}} + +**Parameters:** + +- `callOptions` (CallOptions) (optional) + +**Returns:** + +- (Promise<[JsonValue](https://ts.viam.dev/types/JsonValue.html)>) + +For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/EncoderClient.html#getstatus). + +{{% /tab %}} +{{< /tabs >}} + ### GetResourceName Get the `ResourceName` for this encoder. diff --git a/static/include/components/apis/generated/gantry-table.md b/static/include/components/apis/generated/gantry-table.md index 70da493e32..3f8a0e9189 100644 --- a/static/include/components/apis/generated/gantry-table.md +++ b/static/include/components/apis/generated/gantry-table.md @@ -10,6 +10,7 @@ | [`Stop`](/reference/apis/components/gantry/#stop) | Stop all motion of the gantry. | | [`Reconfigure`](/reference/apis/components/gantry/#reconfigure) | Reconfigure this resource. | | [`DoCommand`](/reference/apis/components/gantry/#docommand) | Execute model-specific commands that are not otherwise defined by the component API. | +| [`GetStatus`](/reference/apis/components/gantry/#getstatus) | Get the current status of the gantry as a map of key-value pairs describing its state. | | [`GetKinematics`](/reference/apis/components/gantry/#getkinematics) | Get the kinematics information associated with the gantry. | | [`GetResourceName`](/reference/apis/components/gantry/#getresourcename) | Get the `ResourceName` for this gantry. | | [`Close`](/reference/apis/components/gantry/#close) | Safely shut down the resource and prevent further use. | diff --git a/static/include/components/apis/generated/gantry.md b/static/include/components/apis/generated/gantry.md index d484887a3b..0a4723f051 100644 --- a/static/include/components/apis/generated/gantry.md +++ b/static/include/components/apis/generated/gantry.md @@ -167,8 +167,8 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Parameters:** - `positionsMm` (number) (required): The goal positions for each axis of the gantry. -- `speedsMmPerSec` (number) (required): The desired speed for each axis to move to the - respective position in positionsMm. +- `speedsMmPerSec` (number) (required): The desired speed for each axis to move to the respective position in + positionsMm. - `extra` (None) (optional) - `callOptions` (CallOptions) (optional) @@ -370,8 +370,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Returns:** -- (Promise): A bool representing whether the gantry has run the homing sequence -successfully. +- (Promise): A bool representing whether the gantry has run the homing sequence successfully. **Example:** @@ -747,8 +746,8 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Parameters:** -- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or - a plain object, which will be converted automatically. +- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or a plain object, + which will be converted automatically. - `callOptions` (CallOptions) (optional) **Returns:** @@ -766,9 +765,7 @@ const result = await resource.doCommand({ // Struct (still supported) import { Struct } from '@viamrobotics/sdk'; -const result = await resource.doCommand( - Struct.fromJson({ myCommand: { key: 'value' } }) -); +const result = await resource.doCommand(Struct.fromJson({ myCommand: { key: 'value' } })); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/GantryClient.html#docommand). @@ -797,6 +794,58 @@ For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_s {{% /tab %}} {{< /tabs >}} +### GetStatus + +Get the current status of the gantry as a map of key-value pairs describing its state. + +{{< tabs >}} +{{% tab name="Python" %}} + +**Parameters:** + +- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (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](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : The status of the component. + +**Example:** + +```python {class="line-numbers linkable-line-numbers"} +status = await component.get_status() +``` + +For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/gantry/client/index.html#viam.components.gantry.client.GantryClient.get_status). + +{{% /tab %}} +{{% tab name="TypeScript" %}} + +**Parameters:** + +- `callOptions` (CallOptions) (optional) + +**Returns:** + +- (Promise<[JsonValue](https://ts.viam.dev/types/JsonValue.html)>) + +For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/GantryClient.html#getstatus). + +{{% /tab %}} +{{% tab name="Flutter" %}} + +**Parameters:** + +- None. + +**Returns:** + +- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), dynamic>\> + +For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_sdk/Resource/getStatus.html). + +{{% /tab %}} +{{< /tabs >}} + ### GetKinematics Get the kinematics information associated with the gantry. diff --git a/static/include/components/apis/generated/generic_component-table.md b/static/include/components/apis/generated/generic_component-table.md index e47a8ddd57..5b66b2f5ef 100644 --- a/static/include/components/apis/generated/generic_component-table.md +++ b/static/include/components/apis/generated/generic_component-table.md @@ -3,5 +3,6 @@ | ----------- | ----------- | --------------------------- | | [`GetGeometries`](/reference/apis/components/generic/#getgeometries) | Get all the geometries associated with the generic component in its current configuration, in the frame of the generic component. | | | [`DoCommand`](/reference/apis/components/generic/#docommand) | Execute model-specific commands. |

| +| [`GetStatus`](/reference/apis/components/generic/#getstatus) | Get the current status of the generic component as a map of key-value pairs describing its state. | | | [`GetResourceName`](/reference/apis/components/generic/#getresourcename) | Get the `ResourceName` for this generic component. | | | [`Close`](/reference/apis/components/generic/#close) | Safely shut down the resource and prevent further use. | | diff --git a/static/include/components/apis/generated/generic_component.md b/static/include/components/apis/generated/generic_component.md index 5de32e31e6..05dbb63b95 100644 --- a/static/include/components/apis/generated/generic_component.md +++ b/static/include/components/apis/generated/generic_component.md @@ -13,7 +13,7 @@ The [motion](/reference/services/motion/) and [navigation](/reference/services/n **Returns:** -- ([List[viam.proto.common.Geometry]](https://python.viam.dev/autoapi/viam/proto/common/index.html#viam.proto.common.Geometry)): : The geometries associated with the Component. +- ([List[viam.proto.common.Geometry]](https://python.viam.dev/autoapi/viam/proto/common/index.html#viam.proto.common.Geometry)): : The geometries associated with the Component. **Example:** @@ -28,35 +28,6 @@ if geometries: For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/generic/client/index.html#viam.components.generic.client.GenericClient.get_geometries). -{{% /tab %}} -{{% tab name="Go" %}} - -**Parameters:** - -- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries. -- `extra` [(map[string]interface{})](https://go.dev/blog/maps): Extra options to pass to the underlying RPC call. - -**Returns:** - -- [([]spatialmath.Geometry)](https://pkg.go.dev/go.viam.com/rdk/spatialmath#Geometry): The geometries associated with this resource, in any order. -- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred. - -**Example:** - -```go {class="line-numbers linkable-line-numbers"} -myGenericComponent, err := generic.FromProvider(machine, "my_generic_component") - -geometries, err := myGenericComponent.Geometries(context.Background(), nil) - -if len(geometries) > 0 { - // Get the center of the first geometry - elem := geometries[0] - fmt.Println("Pose of the first geometry's center point:", elem.Pose()) -} -``` - -For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/resource#Shaped). - {{% /tab %}} {{% tab name="TypeScript" %}} @@ -72,14 +43,11 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const generic = new VIAM.GenericComponentClient( - machine, - "my_generic_component", -); +const generic = new VIAM.GenericComponentClient(machine, 'my_generic_component'); // Get the geometries of this component const geometries = await generic.getGeometries(); -console.log("Geometries:", geometries); +console.log('Geometries:', geometries); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/GenericComponentClient.html#getgeometries). @@ -103,7 +71,7 @@ Supported by `viam-micro-server`. **Returns:** -- (Mapping[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), Any]): : Result of the executed command. +- (Mapping[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), Any]): : Result of the executed command. **Raises:** @@ -148,8 +116,8 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Parameters:** -- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or - a plain object, which will be converted automatically. +- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or a plain object, + which will be converted automatically. - `callOptions` (CallOptions) (optional) **Returns:** @@ -161,15 +129,13 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r ```ts {class="line-numbers linkable-line-numbers"} // Plain object (recommended) const result = await resource.doCommand({ - myCommand: { key: "value" }, + myCommand: { key: 'value' }, }); // Struct (still supported) -import { Struct } from "@viamrobotics/sdk"; +import { Struct } from '@viamrobotics/sdk'; -const result = await resource.doCommand( - Struct.fromJson({ myCommand: { key: "value" } }), -); +const result = await resource.doCommand(Struct.fromJson({ myCommand: { key: 'value' } })); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/GenericComponentClient.html#docommand). @@ -198,6 +164,58 @@ For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_s {{% /tab %}} {{< /tabs >}} +### GetStatus + +Get the current status of the generic component as a map of key-value pairs describing its state. + +{{< tabs >}} +{{% tab name="Python" %}} + +**Parameters:** + +- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (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](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : The status of the component. + +**Example:** + +```python {class="line-numbers linkable-line-numbers"} +status = await component.get_status() +``` + +For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/generic/client/index.html#viam.components.generic.client.GenericClient.get_status). + +{{% /tab %}} +{{% tab name="TypeScript" %}} + +**Parameters:** + +- `callOptions` (CallOptions) (optional) + +**Returns:** + +- (Promise<[JsonValue](https://ts.viam.dev/types/JsonValue.html)>) + +For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/GenericComponentClient.html#getstatus). + +{{% /tab %}} +{{% tab name="Flutter" %}} + +**Parameters:** + +- None. + +**Returns:** + +- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), dynamic>\> + +For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_sdk/Resource/getStatus.html). + +{{% /tab %}} +{{< /tabs >}} + ### GetResourceName Get the `ResourceName` for this generic component. @@ -211,7 +229,7 @@ Get the `ResourceName` for this generic component. **Returns:** -- ([viam.proto.common.ResourceName](https://python.viam.dev/autoapi/viam/proto/common/index.html#viam.proto.common.ResourceName)): : The ResourceName of this Resource. +- ([viam.proto.common.ResourceName](https://python.viam.dev/autoapi/viam/proto/common/index.html#viam.proto.common.ResourceName)): : The ResourceName of this Resource. **Example:** @@ -256,7 +274,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Example:** ```ts {class="line-numbers linkable-line-numbers"} -generic_component.name; +generic_component.name ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/GenericComponentClient.html#name). diff --git a/static/include/components/apis/generated/gripper-table.md b/static/include/components/apis/generated/gripper-table.md index c31cc6a9ff..6569e73ec2 100644 --- a/static/include/components/apis/generated/gripper-table.md +++ b/static/include/components/apis/generated/gripper-table.md @@ -11,6 +11,7 @@ | [`GoToInputs`](/reference/apis/components/gripper/#gotoinputs) | Move the gripper to the specified joint input values. | | [`Reconfigure`](/reference/apis/components/gripper/#reconfigure) | Reconfigure this resource. | | [`DoCommand`](/reference/apis/components/gripper/#docommand) | Execute model-specific commands that are not otherwise defined by the component API. | +| [`GetStatus`](/reference/apis/components/gripper/#getstatus) | Get the current status of the gripper as a map of key-value pairs describing its state. | | [`GetKinematics`](/reference/apis/components/gripper/#getkinematics) | Get the kinematics information associated with the gripper as the format and byte contents of the kinematics file. | | [`GetResourceName`](/reference/apis/components/gripper/#getresourcename) | Get the `ResourceName` for this gripper. | | [`Close`](/reference/apis/components/gripper/#close) | Safely shut down the resource and prevent further use. | diff --git a/static/include/components/apis/generated/gripper.md b/static/include/components/apis/generated/gripper.md index b351f4cdf2..dd4acfba02 100644 --- a/static/include/components/apis/generated/gripper.md +++ b/static/include/components/apis/generated/gripper.md @@ -63,7 +63,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const gripper = new VIAM.GripperClient(machine, "my_gripper"); +const gripper = new VIAM.GripperClient(machine, 'my_gripper'); // Open the gripper await gripper.open(); @@ -107,7 +107,7 @@ Closes the gripper until it grabs something or closes completely, and returns wh **Returns:** -- ([bool](https://docs.python.org/3/library/stdtypes.html#boolean-type-bool)): : Indicates if the gripper grabbed something. +- ([bool](https://docs.python.org/3/library/stdtypes.html#boolean-type-bool)): : Indicates if the gripper grabbed something. **Example:** @@ -130,7 +130,7 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/ **Returns:** -- [(bool)](https://pkg.go.dev/builtin#bool): True if the gripper grabbed something with non-zero thickness. +- [(bool)](https://pkg.go.dev/builtin#bool): True if the gripper grabbed something with non-zero thickness. - [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred. **Example:** @@ -159,7 +159,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const gripper = new VIAM.GripperClient(machine, "my_gripper"); +const gripper = new VIAM.GripperClient(machine, 'my_gripper'); // Close the gripper to grab await gripper.grab(); @@ -202,7 +202,7 @@ Returns whether the gripper is actively moving (or attempting to move) under its **Returns:** -- ([bool](https://docs.python.org/3/library/stdtypes.html#boolean-type-bool)): : Whether the gripper is moving. +- ([bool](https://docs.python.org/3/library/stdtypes.html#boolean-type-bool)): : Whether the gripper is moving. **Example:** @@ -258,11 +258,11 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const gripper = new VIAM.GripperClient(machine, "my_gripper"); +const gripper = new VIAM.GripperClient(machine, 'my_gripper'); // Check if the gripper is currently moving const moving = await gripper.isMoving(); -console.log("Gripper is moving:", moving); +console.log('Gripper is moving:', moving); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/GripperClient.html#ismoving). @@ -303,7 +303,7 @@ Return if the gripper is holding something. **Returns:** -- ([viam.components.gripper.gripper.Gripper.HoldingStatus](https://python.viam.dev/autoapi/viam/components/gripper/gripper/index.html#viam.components.gripper.gripper.Gripper.HoldingStatus)): : see documentation on HoldingStatus for more information. +- ([viam.components.gripper.gripper.Gripper.HoldingStatus](https://python.viam.dev/autoapi/viam/components/gripper/gripper/index.html#viam.components.gripper.gripper.Gripper.HoldingStatus)): : see documentation on HoldingStatus for more information. **Example:** @@ -416,7 +416,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const gripper = new VIAM.GripperClient(machine, "my_gripper"); +const gripper = new VIAM.GripperClient(machine, 'my_gripper'); // Stop the gripper's current motion await gripper.stop(); @@ -461,7 +461,7 @@ The [motion](/reference/services/motion/) and [navigation](/reference/services/n **Returns:** -- ([List[viam.proto.common.Geometry]](https://python.viam.dev/autoapi/viam/proto/common/index.html#viam.proto.common.Geometry)): : The geometries associated with the Component. +- ([List[viam.proto.common.Geometry]](https://python.viam.dev/autoapi/viam/proto/common/index.html#viam.proto.common.Geometry)): : The geometries associated with the Component. **Example:** @@ -521,11 +521,11 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const gripper = new VIAM.GripperClient(machine, "my_gripper"); +const gripper = new VIAM.GripperClient(machine, 'my_gripper'); // Get the geometries of this component const geometries = await gripper.getGeometries(); -console.log("Geometries:", geometries); +console.log('Geometries:', geometries); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/GripperClient.html#getgeometries). @@ -548,7 +548,7 @@ This method is part of the frame system's `InputEnabled` interface and is releva **Returns:** -- ([List[float]](https://docs.python.org/3/library/stdtypes.html#list)): The current input values of the gripper. +- (List[[float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)]): : The current input values of the gripper. **Example:** @@ -561,29 +561,6 @@ inputs = await my_gripper.get_current_inputs() For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/gripper/client/index.html#viam.components.gripper.client.GripperClient.get_current_inputs). -{{% /tab %}} -{{% tab name="Go" %}} - -**Parameters:** - -- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries. - -**Returns:** - -- [([]referenceframe.Input)](https://pkg.go.dev/go.viam.com/rdk/referenceframe#Input): The current input values of the gripper. -- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred. - -**Example:** - -```go {class="line-numbers linkable-line-numbers"} -myGripper, err := gripper.FromProvider(machine, "my_gripper") - -// Get the current input values of the gripper. -inputs, err := myGripper.CurrentInputs(context.Background()) -``` - -For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/robot/framesystem#InputEnabled). - {{% /tab %}} {{% tab name="TypeScript" %}} @@ -599,11 +576,11 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const gripper = new VIAM.GripperClient(machine, "my_gripper"); +const gripper = new VIAM.GripperClient(machine, 'my_gripper'); // Get the current inputs of the gripper const inputs = await gripper.getCurrentInputs(); -console.log("Current inputs:", inputs); +console.log('Current inputs:', inputs); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/GripperClient.html#getcurrentinputs). @@ -621,7 +598,7 @@ This method is part of the frame system's `InputEnabled` interface and is releva **Parameters:** -- `values` ([List[float]](https://docs.python.org/3/library/stdtypes.html#list)) (required): The input values to move the gripper to. +- `values` (List[[float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)]) (required): The input values to move the gripper to. - `extra` (Mapping[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), Any]) (optional): Extra options to pass to the underlying RPC call. - `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call. @@ -640,35 +617,12 @@ await my_gripper.go_to_inputs([0.5, 0.8]) For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/gripper/client/index.html#viam.components.gripper.client.GripperClient.go_to_inputs). -{{% /tab %}} -{{% tab name="Go" %}} - -**Parameters:** - -- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries. -- `inputSteps` [([][]referenceframe.Input)](https://pkg.go.dev/go.viam.com/rdk/referenceframe#Input): One or more sets of input values to move the gripper through, in order. - -**Returns:** - -- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred. - -**Example:** - -```go {class="line-numbers linkable-line-numbers"} -myGripper, err := gripper.FromProvider(machine, "my_gripper") - -// Move the gripper to specific input values. -err = myGripper.GoToInputs(context.Background(), []referenceframe.Input{0.5}) -``` - -For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/robot/framesystem#InputEnabled). - {{% /tab %}} {{% tab name="TypeScript" %}} **Parameters:** -- `values` (number[]) (required): The input values to move the gripper to. +- `values` (number) (required): The input values to move the gripper to. - `extra` (None) (optional) - `callOptions` (CallOptions) (optional) @@ -679,7 +633,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const gripper = new VIAM.GripperClient(machine, "my_gripper"); +const gripper = new VIAM.GripperClient(machine, 'my_gripper'); // Move the gripper to specific input values await gripper.goToInputs([0.5]); @@ -730,7 +684,7 @@ If you are implementing your own gripper and want to add features that have no c **Returns:** -- (Mapping[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : Result of the executed command. +- (Mapping[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : Result of the executed command. **Raises:** @@ -775,8 +729,8 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Parameters:** -- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or - a plain object, which will be converted automatically. +- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or a plain object, + which will be converted automatically. - `callOptions` (CallOptions) (optional) **Returns:** @@ -788,15 +742,13 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r ```ts {class="line-numbers linkable-line-numbers"} // Plain object (recommended) const result = await resource.doCommand({ - myCommand: { key: "value" }, + myCommand: { key: 'value' }, }); // Struct (still supported) -import { Struct } from "@viamrobotics/sdk"; +import { Struct } from '@viamrobotics/sdk'; -const result = await resource.doCommand( - Struct.fromJson({ myCommand: { key: "value" } }), -); +const result = await resource.doCommand(Struct.fromJson({ myCommand: { key: 'value' } })); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/GripperClient.html#docommand). @@ -825,6 +777,58 @@ For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_s {{% /tab %}} {{< /tabs >}} +### GetStatus + +Get the current status of the gripper as a map of key-value pairs describing its state. + +{{< tabs >}} +{{% tab name="Python" %}} + +**Parameters:** + +- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (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](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : The status of the component. + +**Example:** + +```python {class="line-numbers linkable-line-numbers"} +status = await component.get_status() +``` + +For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/gripper/client/index.html#viam.components.gripper.client.GripperClient.get_status). + +{{% /tab %}} +{{% tab name="TypeScript" %}} + +**Parameters:** + +- `callOptions` (CallOptions) (optional) + +**Returns:** + +- (Promise<[JsonValue](https://ts.viam.dev/types/JsonValue.html)>) + +For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/GripperClient.html#getstatus). + +{{% /tab %}} +{{% tab name="Flutter" %}} + +**Parameters:** + +- None. + +**Returns:** + +- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), dynamic>\> + +For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_sdk/Resource/getStatus.html). + +{{% /tab %}} +{{< /tabs >}} + ### GetKinematics Get the kinematics information associated with the gripper as the format and byte contents of the [kinematics file](/motion-planning/frame-system/overview/). @@ -839,11 +843,11 @@ Get the kinematics information associated with the gripper as the format and byt **Returns:** -- ([viam.components.KinematicsReturn](https://python.viam.dev/autoapi/viam/components/index.html#viam.components.KinematicsReturn)): : A tuple containing two values; the first [0] value represents the format of the - file, either in URDF format (`KinematicsFileFormat.KINEMATICS_FILE_FORMAT_URDF`) or - Viam’s kinematic parameter format (spatial vector algebra) (`KinematicsFileFormat.KINEMATICS_FILE_FORMAT_SVA`), - and the second [1] value represents the byte contents of the file. - If available, a third [2] value provides meshes keyed by URDF filepath. +- ([viam.components.KinematicsReturn](https://python.viam.dev/autoapi/viam/components/index.html#viam.components.KinematicsReturn)): : A tuple containing two values; the first [0] value represents the format of the + file, either in URDF format (`KinematicsFileFormat.KINEMATICS_FILE_FORMAT_URDF`) or + Viam’s kinematic parameter format (spatial vector algebra) (`KinematicsFileFormat.KINEMATICS_FILE_FORMAT_SVA`), + and the second [1] value represents the byte contents of the file. + If available, a third [2] value provides meshes keyed by URDF filepath. **Example:** @@ -912,7 +916,7 @@ Get the `ResourceName` for this gripper. **Returns:** -- ([viam.proto.common.ResourceName](https://python.viam.dev/autoapi/viam/proto/common/index.html#viam.proto.common.ResourceName)): : The ResourceName of this Resource. +- ([viam.proto.common.ResourceName](https://python.viam.dev/autoapi/viam/proto/common/index.html#viam.proto.common.ResourceName)): : The ResourceName of this Resource. **Example:** @@ -957,7 +961,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Example:** ```ts {class="line-numbers linkable-line-numbers"} -gripper.name; +gripper.name ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/GripperClient.html#name). diff --git a/static/include/components/apis/generated/input_controller-table.md b/static/include/components/apis/generated/input_controller-table.md index 6a31e14f3c..4de5ce91aa 100644 --- a/static/include/components/apis/generated/input_controller-table.md +++ b/static/include/components/apis/generated/input_controller-table.md @@ -8,5 +8,6 @@ | [`RegisterControlCallback`](/reference/apis/components/input-controller/#registercontrolcallback) | Defines a callback function to execute whenever one of the EventTypes selected occurs on the given Control. | | [`Reconfigure`](/reference/apis/components/input-controller/#reconfigure) | Reconfigure this resource. | | [`DoCommand`](/reference/apis/components/input-controller/#docommand) | Execute model-specific commands that are not otherwise defined by the component API. | +| [`GetStatus`](/reference/apis/components/input-controller/#getstatus) | Get the current status of the input controller as a map of key-value pairs describing its state. | | [`GetResourceName`](/reference/apis/components/input-controller/#getresourcename) | Get the `ResourceName` for this input controller. | | [`Close`](/reference/apis/components/input-controller/#close) | Safely shut down the resource and prevent further use. | diff --git a/static/include/components/apis/generated/input_controller.md b/static/include/components/apis/generated/input_controller.md index c7c53551be..dd210c24f0 100644 --- a/static/include/components/apis/generated/input_controller.md +++ b/static/include/components/apis/generated/input_controller.md @@ -128,10 +128,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const controller = new VIAM.InputControllerClient( - machine, - 'my_controller' -); +const controller = new VIAM.InputControllerClient(machine, 'my_controller'); // Get the most recent Event for each Control const recentEvents = await controller.getEvents(); @@ -202,7 +199,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Parameters:** -- `event` ([PlainMessage](https://ts.viam.dev/types/PlainMessage.html)) (required) +- `event` ([InputControllerEvent](https://ts.viam.dev/types/InputControllerEvent.html)) (required) - `extra` (None) (optional) - `callOptions` (CallOptions) (optional) @@ -213,10 +210,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const controller = new VIAM.InputControllerClient( - machine, - 'my_controller' -); +const controller = new VIAM.InputControllerClient(machine, 'my_controller'); // Create a "Button is Pressed" event for the control BUTTON_START const buttonPressEvent = new VIAM.InputControllerEvent({ @@ -469,6 +463,45 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r {{% /tab %}} {{< /tabs >}} +### GetStatus + +Get the current status of the input controller as a map of key-value pairs describing its state. + +{{< tabs >}} +{{% tab name="Python" %}} + +**Parameters:** + +- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (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](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : The status of the component. + +**Example:** + +```python {class="line-numbers linkable-line-numbers"} +status = await component.get_status() +``` + +For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/input/client/index.html#viam.components.input.client.ControllerClient.get_status). + +{{% /tab %}} +{{% tab name="TypeScript" %}} + +**Parameters:** + +- `callOptions` (CallOptions) (optional) + +**Returns:** + +- (Promise<[JsonValue](https://ts.viam.dev/types/JsonValue.html)>) + +For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/InputControllerClient.html#getstatus). + +{{% /tab %}} +{{< /tabs >}} + ### GetResourceName Get the `ResourceName` for this input controller. diff --git a/static/include/components/apis/generated/motor-table.md b/static/include/components/apis/generated/motor-table.md index d26a28643a..fcb52dbc69 100644 --- a/static/include/components/apis/generated/motor-table.md +++ b/static/include/components/apis/generated/motor-table.md @@ -14,5 +14,6 @@ | [`GetGeometries`](/reference/apis/components/motor/#getgeometries) | Get all the geometries associated with the motor in its current configuration, in the frame of the motor. | | | [`Reconfigure`](/reference/apis/components/motor/#reconfigure) | Reconfigure this resource. | | | [`DoCommand`](/reference/apis/components/motor/#docommand) | Execute model-specific commands that are not otherwise defined by the component API. | +| [`GetStatus`](/reference/apis/components/motor/#getstatus) | Get the current status of the motor as a map of key-value pairs describing its state. | | | [`GetResourceName`](/reference/apis/components/motor/#getresourcename) | Get the `ResourceName` for this motor. | | | [`Close`](/reference/apis/components/motor/#close) | Safely shut down the resource and prevent further use. | | diff --git a/static/include/components/apis/generated/motor.md b/static/include/components/apis/generated/motor.md index dcdfc2993e..dc22d92224 100644 --- a/static/include/components/apis/generated/motor.md +++ b/static/include/components/apis/generated/motor.md @@ -58,8 +58,8 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Parameters:** -- `power` (number) (required): A value between -1 and 1 where negative values indicate a - backwards direction and positive values a forward direction. +- `power` (number) (required): A value between -1 and 1 where negative values indicate a backwards direction + and positive values a forward direction. - `extra` (None) (optional) - `callOptions` (CallOptions) (optional) @@ -261,10 +261,10 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Parameters:** - `rpm` (number) (required): Speed in revolutions per minute. -- `revolutions` (number) (required): Number of revolutions relative to the motor's starting - position. If this value is 0, this will run the motor at the given rpm - indefinitely. If this value is nonzero, this will block until the number - of revolutions has been completed or another operation comes in. +- `revolutions` (number) (required): Number of revolutions relative to the motor's starting position. If this + value is 0, this will run the motor at the given rpm indefinitely. If this value is nonzero, + this will block until the number of revolutions has been completed or another operation comes + in. - `extra` (None) (optional) - `callOptions` (CallOptions) (optional) @@ -368,8 +368,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Parameters:** - `rpm` (number) (required): Speed in revolutions per minute. -- `positionRevolutions` (number) (required): Number of revolutions relative to the motor's - home position. +- `positionRevolutions` (number) (required): Number of revolutions relative to the motor's home position. - `extra` (None) (optional) - `callOptions` (CallOptions) (optional) @@ -1148,8 +1147,8 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Parameters:** -- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or - a plain object, which will be converted automatically. +- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or a plain object, + which will be converted automatically. - `callOptions` (CallOptions) (optional) **Returns:** @@ -1167,9 +1166,7 @@ const result = await resource.doCommand({ // Struct (still supported) import { Struct } from '@viamrobotics/sdk'; -const result = await resource.doCommand( - Struct.fromJson({ myCommand: { key: 'value' } }) -); +const result = await resource.doCommand(Struct.fromJson({ myCommand: { key: 'value' } })); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/MotorClient.html#docommand). @@ -1198,6 +1195,58 @@ For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_s {{% /tab %}} {{< /tabs >}} +### GetStatus + +Get the current status of the motor as a map of key-value pairs describing its state. + +{{< tabs >}} +{{% tab name="Python" %}} + +**Parameters:** + +- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (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](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : The status of the component. + +**Example:** + +```python {class="line-numbers linkable-line-numbers"} +status = await component.get_status() +``` + +For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/motor/client/index.html#viam.components.motor.client.MotorClient.get_status). + +{{% /tab %}} +{{% tab name="TypeScript" %}} + +**Parameters:** + +- `callOptions` (CallOptions) (optional) + +**Returns:** + +- (Promise<[JsonValue](https://ts.viam.dev/types/JsonValue.html)>) + +For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/MotorClient.html#getstatus). + +{{% /tab %}} +{{% tab name="Flutter" %}} + +**Parameters:** + +- None. + +**Returns:** + +- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), dynamic>\> + +For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_sdk/Resource/getStatus.html). + +{{% /tab %}} +{{< /tabs >}} + ### GetResourceName Get the `ResourceName` for this motor. diff --git a/static/include/components/apis/generated/movement_sensor.md b/static/include/components/apis/generated/movement_sensor.md index 7588942d45..49a2da89c6 100644 --- a/static/include/components/apis/generated/movement_sensor.md +++ b/static/include/components/apis/generated/movement_sensor.md @@ -66,10 +66,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const movementSensor = new VIAM.MovementSensorClient( - machine, - 'my_movement_sensor' -); +const movementSensor = new VIAM.MovementSensorClient(machine, 'my_movement_sensor'); const linearVelocity = await movementSensor.getLinearVelocity(); ``` @@ -171,10 +168,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const movementSensor = new VIAM.MovementSensorClient( - machine, - 'my_movement_sensor' -); +const movementSensor = new VIAM.MovementSensorClient(machine, 'my_movement_sensor'); const angularVelocity = await movementSensor.getAngularVelocity(); ``` @@ -270,10 +264,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const movementSensor = new VIAM.MovementSensorClient( - machine, - 'my_movement_sensor' -); +const movementSensor = new VIAM.MovementSensorClient(machine, 'my_movement_sensor'); const compassHeading = await movementSensor.getCompassHeading(); ``` @@ -377,10 +368,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const movementSensor = new VIAM.MovementSensorClient( - machine, - 'my_movement_sensor' -); +const movementSensor = new VIAM.MovementSensorClient(machine, 'my_movement_sensor'); const orientation = await movementSensor.getOrientation(); ``` @@ -478,10 +466,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const movementSensor = new VIAM.MovementSensorClient( - machine, - 'my_movement_sensor' -); +const movementSensor = new VIAM.MovementSensorClient(machine, 'my_movement_sensor'); const position = await movementSensor.getPosition(); ``` @@ -577,10 +562,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const movementSensor = new VIAM.MovementSensorClient( - machine, - 'my_movement_sensor' -); +const movementSensor = new VIAM.MovementSensorClient(machine, 'my_movement_sensor'); const properties = await movementSensor.getProperties(); ``` @@ -690,10 +672,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const movementSensor = new VIAM.MovementSensorClient( - machine, - 'my_movement_sensor' -); +const movementSensor = new VIAM.MovementSensorClient(machine, 'my_movement_sensor'); const accuracy = await movementSensor.getAccuracy(); ``` @@ -792,12 +771,8 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const movementSensor = new VIAM.MovementSensorClient( - machine, - 'my_movement_sensor' -); -const linearAcceleration = - await movementSensor.getLinearAcceleration(); +const movementSensor = new VIAM.MovementSensorClient(machine, 'my_movement_sensor'); +const linearAcceleration = await movementSensor.getLinearAcceleration(); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/MovementSensorClient.html#getlinearacceleration). @@ -925,10 +900,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const movementSensor = new VIAM.MovementSensorClient( - machine, - 'my_movement_sensor' -); +const movementSensor = new VIAM.MovementSensorClient(machine, 'my_movement_sensor'); const readings = await movementSensor.getReadings(); ``` @@ -1042,8 +1014,8 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Parameters:** -- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or - a plain object, which will be converted automatically. +- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or a plain object, + which will be converted automatically. - `callOptions` (CallOptions) (optional) **Returns:** @@ -1061,9 +1033,7 @@ const result = await resource.doCommand({ // Struct (still supported) import { Struct } from '@viamrobotics/sdk'; -const result = await resource.doCommand( - Struct.fromJson({ myCommand: { key: 'value' } }) -); +const result = await resource.doCommand(Struct.fromJson({ myCommand: { key: 'value' } })); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/MovementSensorClient.html#docommand). @@ -1092,6 +1062,58 @@ For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_s {{% /tab %}} {{< /tabs >}} +### GetStatus + +Get the current status of the movement sensor as a map of key-value pairs describing its state. + +{{< tabs >}} +{{% tab name="Python" %}} + +**Parameters:** + +- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (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](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : The status of the component. + +**Example:** + +```python {class="line-numbers linkable-line-numbers"} +status = await component.get_status() +``` + +For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/movement_sensor/client/index.html#viam.components.movement_sensor.client.MovementSensorClient.get_status). + +{{% /tab %}} +{{% tab name="TypeScript" %}} + +**Parameters:** + +- `callOptions` (CallOptions) (optional) + +**Returns:** + +- (Promise<[JsonValue](https://ts.viam.dev/types/JsonValue.html)>) + +For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/MovementSensorClient.html#getstatus). + +{{% /tab %}} +{{% tab name="Flutter" %}} + +**Parameters:** + +- None. + +**Returns:** + +- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), dynamic>\> + +For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_sdk/Resource/getStatus.html). + +{{% /tab %}} +{{< /tabs >}} + ### GetResourceName Get the `ResourceName` for this movement sensor. diff --git a/static/include/components/apis/generated/power_sensor-table.md b/static/include/components/apis/generated/power_sensor-table.md index 76cb68ca31..e6514c50a9 100644 --- a/static/include/components/apis/generated/power_sensor-table.md +++ b/static/include/components/apis/generated/power_sensor-table.md @@ -7,5 +7,6 @@ | [`GetReadings`](/reference/apis/components/power-sensor/#getreadings) | Get the measurements or readings that this power sensor provides. | | [`Reconfigure`](/reference/apis/components/power-sensor/#reconfigure) | Reconfigure this resource. | | [`DoCommand`](/reference/apis/components/power-sensor/#docommand) | Execute model-specific commands that are not otherwise defined by the component API. | +| [`GetStatus`](/reference/apis/components/power-sensor/#getstatus) | Get the current status of the power sensor as a map of key-value pairs describing its state. | | [`GetResourceName`](/reference/apis/components/power-sensor/#getresourcename) | Get the `ResourceName` for this power sensor. | | [`Close`](/reference/apis/components/power-sensor/#close) | Safely shut down the resource and prevent further use. | diff --git a/static/include/components/apis/generated/power_sensor.md b/static/include/components/apis/generated/power_sensor.md index 3ad1c1b293..99226091c3 100644 --- a/static/include/components/apis/generated/power_sensor.md +++ b/static/include/components/apis/generated/power_sensor.md @@ -65,10 +65,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const powerSensor = new VIAM.PowerSensorClient( - machine, - 'my_power_sensor' -); +const powerSensor = new VIAM.PowerSensorClient(machine, 'my_power_sensor'); const [voltage, isAc] = await powerSensor.getVoltage(); ``` @@ -165,10 +162,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const powerSensor = new VIAM.PowerSensorClient( - machine, - 'my_power_sensor' -); +const powerSensor = new VIAM.PowerSensorClient(machine, 'my_power_sensor'); const [current, isAc] = await powerSensor.getCurrent(); ``` @@ -263,10 +257,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/c **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const powerSensor = new VIAM.PowerSensorClient( - machine, - 'my_power_sensor' -); +const powerSensor = new VIAM.PowerSensorClient(machine, 'my_power_sensor'); const power = await powerSensor.getPower(); ``` @@ -360,10 +351,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const powerSensor = new VIAM.PowerSensorClient( - machine, - 'my_power_sensor' -); +const powerSensor = new VIAM.PowerSensorClient(machine, 'my_power_sensor'); const readings = await powerSensor.getReadings(); ``` @@ -476,8 +464,8 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Parameters:** -- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or - a plain object, which will be converted automatically. +- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or a plain object, + which will be converted automatically. - `callOptions` (CallOptions) (optional) **Returns:** @@ -495,9 +483,7 @@ const result = await resource.doCommand({ // Struct (still supported) import { Struct } from '@viamrobotics/sdk'; -const result = await resource.doCommand( - Struct.fromJson({ myCommand: { key: 'value' } }) -); +const result = await resource.doCommand(Struct.fromJson({ myCommand: { key: 'value' } })); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/PowerSensorClient.html#docommand). @@ -526,6 +512,58 @@ For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_s {{% /tab %}} {{< /tabs >}} +### GetStatus + +Get the current status of the power sensor as a map of key-value pairs describing its state. + +{{< tabs >}} +{{% tab name="Python" %}} + +**Parameters:** + +- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (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](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : The status of the component. + +**Example:** + +```python {class="line-numbers linkable-line-numbers"} +status = await component.get_status() +``` + +For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/power_sensor/client/index.html#viam.components.power_sensor.client.PowerSensorClient.get_status). + +{{% /tab %}} +{{% tab name="TypeScript" %}} + +**Parameters:** + +- `callOptions` (CallOptions) (optional) + +**Returns:** + +- (Promise<[JsonValue](https://ts.viam.dev/types/JsonValue.html)>) + +For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/PowerSensorClient.html#getstatus). + +{{% /tab %}} +{{% tab name="Flutter" %}} + +**Parameters:** + +- None. + +**Returns:** + +- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), dynamic>\> + +For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_sdk/Resource/getStatus.html). + +{{% /tab %}} +{{< /tabs >}} + ### GetResourceName Get the `ResourceName` for this power sensor. diff --git a/static/include/components/apis/generated/sensor-table.md b/static/include/components/apis/generated/sensor-table.md index 875d5758a6..cf855087a4 100644 --- a/static/include/components/apis/generated/sensor-table.md +++ b/static/include/components/apis/generated/sensor-table.md @@ -5,5 +5,6 @@ | [`GetGeometries`](/reference/apis/components/sensor/#getgeometries) | Get all the geometries associated with the sensor in its current configuration, in the frame of the sensor. | | [`Reconfigure`](/reference/apis/components/sensor/#reconfigure) | Reconfigure this resource. | | | [`DoCommand`](/reference/apis/components/sensor/#docommand) | Execute model-specific commands that are not otherwise defined by the component API. | +| [`GetStatus`](/reference/apis/components/sensor/#getstatus) | Get the current status of the sensor as a map of key-value pairs describing its state. | | | [`GetResourceName`](/reference/apis/components/sensor/#getresourcename) | Get the `ResourceName` for this sensor. | | | [`Close`](/reference/apis/components/sensor/#close) | Safely shut down the resource and prevent further use. | | diff --git a/static/include/components/apis/generated/sensor.md b/static/include/components/apis/generated/sensor.md index a0ae79ba95..c9fbd6809b 100644 --- a/static/include/components/apis/generated/sensor.md +++ b/static/include/components/apis/generated/sensor.md @@ -211,8 +211,8 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Parameters:** -- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or - a plain object, which will be converted automatically. +- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or a plain object, + which will be converted automatically. - `callOptions` (CallOptions) (optional) **Returns:** @@ -230,9 +230,7 @@ const result = await resource.doCommand({ // Struct (still supported) import { Struct } from '@viamrobotics/sdk'; -const result = await resource.doCommand( - Struct.fromJson({ myCommand: { key: 'value' } }) -); +const result = await resource.doCommand(Struct.fromJson({ myCommand: { key: 'value' } })); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/SensorClient.html#docommand). @@ -261,6 +259,58 @@ For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_s {{% /tab %}} {{< /tabs >}} +### GetStatus + +Get the current status of the sensor as a map of key-value pairs describing its state. + +{{< tabs >}} +{{% tab name="Python" %}} + +**Parameters:** + +- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (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](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : The status of the component. + +**Example:** + +```python {class="line-numbers linkable-line-numbers"} +status = await component.get_status() +``` + +For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/sensor/client/index.html#viam.components.sensor.client.SensorClient.get_status). + +{{% /tab %}} +{{% tab name="TypeScript" %}} + +**Parameters:** + +- `callOptions` (CallOptions) (optional) + +**Returns:** + +- (Promise<[JsonValue](https://ts.viam.dev/types/JsonValue.html)>) + +For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/SensorClient.html#getstatus). + +{{% /tab %}} +{{% tab name="Flutter" %}} + +**Parameters:** + +- None. + +**Returns:** + +- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), dynamic>\> + +For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_sdk/Resource/getStatus.html). + +{{% /tab %}} +{{< /tabs >}} + ### GetResourceName Get the `ResourceName` for this sensor. diff --git a/static/include/components/apis/generated/servo-table.md b/static/include/components/apis/generated/servo-table.md index 5a8e497685..7e5b32ecea 100644 --- a/static/include/components/apis/generated/servo-table.md +++ b/static/include/components/apis/generated/servo-table.md @@ -8,5 +8,6 @@ | [`GetGeometries`](/reference/apis/components/servo/#getgeometries) | Get all the geometries associated with the servo in its current configuration, in the frame of the servo. | | | [`Reconfigure`](/reference/apis/components/servo/#reconfigure) | Reconfigure this resource. | | | [`DoCommand`](/reference/apis/components/servo/#docommand) | Execute model-specific commands that are not otherwise defined by the component API. | +| [`GetStatus`](/reference/apis/components/servo/#getstatus) | Get the current status of the servo as a map of key-value pairs describing its state. | | | [`GetResourceName`](/reference/apis/components/servo/#getresourcename) | Get the `ResourceName` for this servo. | | | [`Close`](/reference/apis/components/servo/#close) | Safely shut down the resource and prevent further use. | | diff --git a/static/include/components/apis/generated/servo.md b/static/include/components/apis/generated/servo.md index 2618844845..d3b575008c 100644 --- a/static/include/components/apis/generated/servo.md +++ b/static/include/components/apis/generated/servo.md @@ -546,8 +546,8 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Parameters:** -- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or - a plain object, which will be converted automatically. +- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or a plain object, + which will be converted automatically. - `callOptions` (CallOptions) (optional) **Returns:** @@ -565,9 +565,7 @@ const result = await resource.doCommand({ // Struct (still supported) import { Struct } from '@viamrobotics/sdk'; -const result = await resource.doCommand( - Struct.fromJson({ myCommand: { key: 'value' } }) -); +const result = await resource.doCommand(Struct.fromJson({ myCommand: { key: 'value' } })); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/ServoClient.html#docommand). @@ -596,6 +594,58 @@ For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_s {{% /tab %}} {{< /tabs >}} +### GetStatus + +Get the current status of the servo as a map of key-value pairs describing its state. + +{{< tabs >}} +{{% tab name="Python" %}} + +**Parameters:** + +- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (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](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : The status of the component. + +**Example:** + +```python {class="line-numbers linkable-line-numbers"} +status = await component.get_status() +``` + +For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/servo/client/index.html#viam.components.servo.client.ServoClient.get_status). + +{{% /tab %}} +{{% tab name="TypeScript" %}} + +**Parameters:** + +- `callOptions` (CallOptions) (optional) + +**Returns:** + +- (Promise<[JsonValue](https://ts.viam.dev/types/JsonValue.html)>) + +For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/ServoClient.html#getstatus). + +{{% /tab %}} +{{% tab name="Flutter" %}} + +**Parameters:** + +- None. + +**Returns:** + +- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), dynamic>\> + +For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_sdk/Resource/getStatus.html). + +{{% /tab %}} +{{< /tabs >}} + ### GetResourceName Get the `ResourceName` for this servo. diff --git a/static/include/components/apis/generated/switch-table.md b/static/include/components/apis/generated/switch-table.md index 0ba389e99d..073a67a6dd 100644 --- a/static/include/components/apis/generated/switch-table.md +++ b/static/include/components/apis/generated/switch-table.md @@ -5,5 +5,6 @@ | [`GetPosition`](/reference/apis/components/switch/#getposition) | Return the current position of the switch. |

| | [`GetNumberOfPositions`](/reference/apis/components/switch/#getnumberofpositions) | Return the number of valid positions for this switch. |

| | [`DoCommand`](/reference/apis/components/switch/#docommand) | Execute model-specific commands that are not otherwise defined by the component API. |

| +| [`GetStatus`](/reference/apis/components/switch/#getstatus) | Get the current status of the switch as a map of key-value pairs describing its state. | | | [`GetResourceName`](/reference/apis/components/switch/#getresourcename) | Get the `ResourceName` for this servo. | | | [`Close`](/reference/apis/components/switch/#close) | Safely shut down the resource and prevent further use. | | diff --git a/static/include/components/apis/generated/switch.md b/static/include/components/apis/generated/switch.md index af857c5020..d831800a4d 100644 --- a/static/include/components/apis/generated/switch.md +++ b/static/include/components/apis/generated/switch.md @@ -320,8 +320,8 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Parameters:** -- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or - a plain object, which will be converted automatically. +- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or a plain object, + which will be converted automatically. - `callOptions` (CallOptions) (optional) **Returns:** @@ -339,9 +339,7 @@ const result = await resource.doCommand({ // Struct (still supported) import { Struct } from '@viamrobotics/sdk'; -const result = await resource.doCommand( - Struct.fromJson({ myCommand: { key: 'value' } }) -); +const result = await resource.doCommand(Struct.fromJson({ myCommand: { key: 'value' } })); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/SwitchClient.html#docommand). @@ -349,6 +347,45 @@ For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/ {{% /tab %}} {{< /tabs >}} +### GetStatus + +Get the current status of the switch as a map of key-value pairs describing its state. + +{{< tabs >}} +{{% tab name="Python" %}} + +**Parameters:** + +- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (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](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : The status of the component. + +**Example:** + +```python {class="line-numbers linkable-line-numbers"} +status = await component.get_status() +``` + +For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/components/switch/client/index.html#viam.components.switch.client.SwitchClient.get_status). + +{{% /tab %}} +{{% tab name="TypeScript" %}} + +**Parameters:** + +- `callOptions` (CallOptions) (optional) + +**Returns:** + +- (Promise<[JsonValue](https://ts.viam.dev/types/JsonValue.html)>) + +For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/SwitchClient.html#getstatus). + +{{% /tab %}} +{{< /tabs >}} + ### GetResourceName Get the `ResourceName` for this servo. diff --git a/static/include/components/apis/overrides/protos/arm.GetStatus.md b/static/include/components/apis/overrides/protos/arm.GetStatus.md new file mode 100644 index 0000000000..631b97e7d3 --- /dev/null +++ b/static/include/components/apis/overrides/protos/arm.GetStatus.md @@ -0,0 +1 @@ +Get the current status of the arm as a map of key-value pairs describing its state. diff --git a/static/include/components/apis/overrides/protos/audio_in.GetStatus.md b/static/include/components/apis/overrides/protos/audio_in.GetStatus.md new file mode 100644 index 0000000000..02d9935434 --- /dev/null +++ b/static/include/components/apis/overrides/protos/audio_in.GetStatus.md @@ -0,0 +1 @@ +Get the current status of the audio input component as a map of key-value pairs describing its state. diff --git a/static/include/components/apis/overrides/protos/audio_out.GetStatus.md b/static/include/components/apis/overrides/protos/audio_out.GetStatus.md new file mode 100644 index 0000000000..2dd4aeecd0 --- /dev/null +++ b/static/include/components/apis/overrides/protos/audio_out.GetStatus.md @@ -0,0 +1 @@ +Get the current status of the audio output component as a map of key-value pairs describing its state. diff --git a/static/include/components/apis/overrides/protos/base.GetStatus.md b/static/include/components/apis/overrides/protos/base.GetStatus.md new file mode 100644 index 0000000000..76846edd26 --- /dev/null +++ b/static/include/components/apis/overrides/protos/base.GetStatus.md @@ -0,0 +1 @@ +Get the current status of the base as a map of key-value pairs describing its state. diff --git a/static/include/components/apis/overrides/protos/board.GetStatus.md b/static/include/components/apis/overrides/protos/board.GetStatus.md new file mode 100644 index 0000000000..2369d8e3a3 --- /dev/null +++ b/static/include/components/apis/overrides/protos/board.GetStatus.md @@ -0,0 +1 @@ +Get the current status of the board as a map of key-value pairs describing its state. diff --git a/static/include/components/apis/overrides/protos/button.GetStatus.md b/static/include/components/apis/overrides/protos/button.GetStatus.md new file mode 100644 index 0000000000..39cd274523 --- /dev/null +++ b/static/include/components/apis/overrides/protos/button.GetStatus.md @@ -0,0 +1 @@ +Get the current status of the button as a map of key-value pairs describing its state. diff --git a/static/include/components/apis/overrides/protos/camera.GetStatus.md b/static/include/components/apis/overrides/protos/camera.GetStatus.md new file mode 100644 index 0000000000..85c0d3bb92 --- /dev/null +++ b/static/include/components/apis/overrides/protos/camera.GetStatus.md @@ -0,0 +1 @@ +Get the current status of the camera as a map of key-value pairs describing its state. diff --git a/static/include/components/apis/overrides/protos/encoder.GetStatus.md b/static/include/components/apis/overrides/protos/encoder.GetStatus.md new file mode 100644 index 0000000000..cb23989cdb --- /dev/null +++ b/static/include/components/apis/overrides/protos/encoder.GetStatus.md @@ -0,0 +1 @@ +Get the current status of the encoder as a map of key-value pairs describing its state. diff --git a/static/include/components/apis/overrides/protos/gantry.GetStatus.md b/static/include/components/apis/overrides/protos/gantry.GetStatus.md new file mode 100644 index 0000000000..c27e73e20f --- /dev/null +++ b/static/include/components/apis/overrides/protos/gantry.GetStatus.md @@ -0,0 +1 @@ +Get the current status of the gantry as a map of key-value pairs describing its state. diff --git a/static/include/components/apis/overrides/protos/generic_component.GetStatus.md b/static/include/components/apis/overrides/protos/generic_component.GetStatus.md new file mode 100644 index 0000000000..eef7887a17 --- /dev/null +++ b/static/include/components/apis/overrides/protos/generic_component.GetStatus.md @@ -0,0 +1 @@ +Get the current status of the generic component as a map of key-value pairs describing its state. diff --git a/static/include/components/apis/overrides/protos/gripper.GetStatus.md b/static/include/components/apis/overrides/protos/gripper.GetStatus.md new file mode 100644 index 0000000000..588da13583 --- /dev/null +++ b/static/include/components/apis/overrides/protos/gripper.GetStatus.md @@ -0,0 +1 @@ +Get the current status of the gripper as a map of key-value pairs describing its state. diff --git a/static/include/components/apis/overrides/protos/input_controller.GetStatus.md b/static/include/components/apis/overrides/protos/input_controller.GetStatus.md new file mode 100644 index 0000000000..6b2c227a5e --- /dev/null +++ b/static/include/components/apis/overrides/protos/input_controller.GetStatus.md @@ -0,0 +1 @@ +Get the current status of the input controller as a map of key-value pairs describing its state. diff --git a/static/include/components/apis/overrides/protos/motor.GetStatus.md b/static/include/components/apis/overrides/protos/motor.GetStatus.md new file mode 100644 index 0000000000..d81ff528fc --- /dev/null +++ b/static/include/components/apis/overrides/protos/motor.GetStatus.md @@ -0,0 +1 @@ +Get the current status of the motor as a map of key-value pairs describing its state. diff --git a/static/include/components/apis/overrides/protos/movement_sensor.GetStatus.md b/static/include/components/apis/overrides/protos/movement_sensor.GetStatus.md new file mode 100644 index 0000000000..9f331de67c --- /dev/null +++ b/static/include/components/apis/overrides/protos/movement_sensor.GetStatus.md @@ -0,0 +1 @@ +Get the current status of the movement sensor as a map of key-value pairs describing its state. diff --git a/static/include/components/apis/overrides/protos/power_sensor.GetStatus.md b/static/include/components/apis/overrides/protos/power_sensor.GetStatus.md new file mode 100644 index 0000000000..808a55598c --- /dev/null +++ b/static/include/components/apis/overrides/protos/power_sensor.GetStatus.md @@ -0,0 +1 @@ +Get the current status of the power sensor as a map of key-value pairs describing its state. diff --git a/static/include/components/apis/overrides/protos/sensor.GetStatus.md b/static/include/components/apis/overrides/protos/sensor.GetStatus.md new file mode 100644 index 0000000000..d7fab14638 --- /dev/null +++ b/static/include/components/apis/overrides/protos/sensor.GetStatus.md @@ -0,0 +1 @@ +Get the current status of the sensor as a map of key-value pairs describing its state. diff --git a/static/include/components/apis/overrides/protos/servo.GetStatus.md b/static/include/components/apis/overrides/protos/servo.GetStatus.md new file mode 100644 index 0000000000..9c9d3fafca --- /dev/null +++ b/static/include/components/apis/overrides/protos/servo.GetStatus.md @@ -0,0 +1 @@ +Get the current status of the servo as a map of key-value pairs describing its state. diff --git a/static/include/components/apis/overrides/protos/switch.GetStatus.md b/static/include/components/apis/overrides/protos/switch.GetStatus.md new file mode 100644 index 0000000000..dcc7949a3a --- /dev/null +++ b/static/include/components/apis/overrides/protos/switch.GetStatus.md @@ -0,0 +1 @@ +Get the current status of the switch as a map of key-value pairs describing its state. diff --git a/static/include/services/apis/generated/data_manager-table.md b/static/include/services/apis/generated/data_manager-table.md index 293850af59..ed08a2db27 100644 --- a/static/include/services/apis/generated/data_manager-table.md +++ b/static/include/services/apis/generated/data_manager-table.md @@ -5,5 +5,6 @@ | [`UploadBinaryDataToDatasets`](/reference/apis/services/data/#uploadbinarydatatodatasets) | Upload Binary data to the specified datasets. | | | [`Reconfigure`](/reference/apis/services/data/#reconfigure) | Reconfigure this resource. | | | [`DoCommand`](/reference/apis/services/data/#docommand) | Execute model-specific commands that are not otherwise defined by the service API. | | +| [`GetStatus`](/reference/apis/services/data/#getstatus) | Get the current status of the data management service as a map of key-value pairs describing its state. | | | [`GetResourceName`](/reference/apis/services/data/#getresourcename) | Get the `ResourceName` for this instance of the service. | | | [`Close`](/reference/apis/services/data/#close) | Safely shut down the resource and prevent further use. | | diff --git a/static/include/services/apis/generated/data_manager.md b/static/include/services/apis/generated/data_manager.md index ff8a005137..247a471889 100644 --- a/static/include/services/apis/generated/data_manager.md +++ b/static/include/services/apis/generated/data_manager.md @@ -45,10 +45,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/s **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const dataManager = new VIAM.DataManagerClient( - machine, - 'my_data_manager' -); +const dataManager = new VIAM.DataManagerClient(machine, 'my_data_manager'); await dataManager.sync(); ``` @@ -98,15 +95,12 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/s **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const dataManager = new VIAM.DataManagerClient( - machine, - 'my_data_manager' -); +const dataManager = new VIAM.DataManagerClient(machine, 'my_data_manager'); await dataManager.uploadBinaryDataToDatasets( new Uint8Array([1, 2, 3]), ['tag1', 'tag2'], ['datasetId1', 'datasetId2'], - MimeType.MIME_TYPE_JPEG + MimeType.MIME_TYPE_JPEG, ); ``` @@ -174,8 +168,8 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Parameters:** -- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or - a plain object, which will be converted automatically. +- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or a plain object, + which will be converted automatically. - `callOptions` (CallOptions) (optional) **Returns:** @@ -193,9 +187,7 @@ const result = await resource.doCommand({ // Struct (still supported) import { Struct } from '@viamrobotics/sdk'; -const result = await resource.doCommand( - Struct.fromJson({ myCommand: { key: 'value' } }) -); +const result = await resource.doCommand(Struct.fromJson({ myCommand: { key: 'value' } })); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/DataManagerClient.html#docommand). @@ -203,6 +195,33 @@ For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/ {{% /tab %}} {{< /tabs >}} +### GetStatus + +Get the current status of the data management service as a map of key-value pairs describing its state. + +{{< tabs >}} +{{% tab name="TypeScript" %}} + +**Parameters:** + +- `callOptions` (CallOptions) (optional): Call options for the command. + +**Returns:** + +- (Promise<[JsonValue](https://ts.viam.dev/types/JsonValue.html)>) + +**Example:** + +```ts {class="line-numbers linkable-line-numbers"} +const dataManager = new VIAM.DataManagerClient(machine, 'my_data_manager'); +await dataManager.doCommand(new Struct({ cmd: 'test', data1: 500 })); +``` + +For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/DataManagerClient.html#getstatus). + +{{% /tab %}} +{{< /tabs >}} + ### GetResourceName Get the `ResourceName` for this instance of the service. diff --git a/static/include/services/apis/generated/discovery-table.md b/static/include/services/apis/generated/discovery-table.md index cbbd494341..66c73bbc40 100644 --- a/static/include/services/apis/generated/discovery-table.md +++ b/static/include/services/apis/generated/discovery-table.md @@ -4,4 +4,5 @@ | [`DiscoverResources`](/reference/apis/services/discovery/#discoverresources) | Get a list of component configs of all resources available to configure on a machine based on the hardware that is connected to or part of the machine. | | [`GetResourceName`](/reference/apis/services/discovery/#getresourcename) | Get the `ResourceName` for this instance of the service. | | [`DoCommand`](/reference/apis/services/discovery/#docommand) | Execute model-specific commands. | +| [`GetStatus`](/reference/apis/services/discovery/#getstatus) | Get the current status of the discovery service as a map of key-value pairs describing its state. | | [`Close`](/reference/apis/services/discovery/#close) | Safely shut down the resource and prevent further use. | diff --git a/static/include/services/apis/generated/discovery.md b/static/include/services/apis/generated/discovery.md index 66b94b6193..60a97bcc8f 100644 --- a/static/include/services/apis/generated/discovery.md +++ b/static/include/services/apis/generated/discovery.md @@ -236,8 +236,8 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Parameters:** -- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or - a plain object, which will be converted automatically. +- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or a plain object, + which will be converted automatically. - `callOptions` (CallOptions) (optional) **Returns:** @@ -255,9 +255,7 @@ const result = await resource.doCommand({ // Struct (still supported) import { Struct } from '@viamrobotics/sdk'; -const result = await resource.doCommand( - Struct.fromJson({ myCommand: { key: 'value' } }) -); +const result = await resource.doCommand(Struct.fromJson({ myCommand: { key: 'value' } })); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/DiscoveryClient.html#docommand). @@ -286,6 +284,58 @@ For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_s {{% /tab %}} {{< /tabs >}} +### GetStatus + +Get the current status of the discovery service as a map of key-value pairs describing its state. + +{{< tabs >}} +{{% tab name="Python" %}} + +**Parameters:** + +- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (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](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : The status of the service. + +**Example:** + +```python {class="line-numbers linkable-line-numbers"} +status = await service.get_status() +``` + +For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/services/discovery/client/index.html#viam.services.discovery.client.DiscoveryClient.get_status). + +{{% /tab %}} +{{% tab name="TypeScript" %}} + +**Parameters:** + +- `callOptions` (CallOptions) (optional) + +**Returns:** + +- (Promise<[JsonValue](https://ts.viam.dev/types/JsonValue.html)>) + +For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/DiscoveryClient.html#getstatus). + +{{% /tab %}} +{{% tab name="Flutter" %}} + +**Parameters:** + +- None. + +**Returns:** + +- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), dynamic>\> + +For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_sdk/DiscoveryClient/getStatus.html). + +{{% /tab %}} +{{< /tabs >}} + ### Close Safely shut down the resource and prevent further use. diff --git a/static/include/services/apis/generated/generic_service-table.md b/static/include/services/apis/generated/generic_service-table.md index 7f858cf2ea..8463198aaa 100644 --- a/static/include/services/apis/generated/generic_service-table.md +++ b/static/include/services/apis/generated/generic_service-table.md @@ -2,5 +2,6 @@ | Method Name | Description | | ----------- | ----------- | | [`DoCommand`](/reference/apis/services/generic/#docommand) | Execute model-specific commands. | +| [`GetStatus`](/reference/apis/services/generic/#getstatus) | Get the current status of the generic service as a map of key-value pairs describing its state. | | [`GetResourceName`](/reference/apis/services/generic/#getresourcename) | Get the `ResourceName` for this instance of the generic service. | | [`Close`](/reference/apis/services/generic/#close) | Safely shut down the resource and prevent further use. | diff --git a/static/include/services/apis/generated/generic_service.md b/static/include/services/apis/generated/generic_service.md index 2e4a9a5c96..1d61b0b6bb 100644 --- a/static/include/services/apis/generated/generic_service.md +++ b/static/include/services/apis/generated/generic_service.md @@ -59,8 +59,8 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Parameters:** -- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or - a plain object, which will be converted automatically. +- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or a plain object, + which will be converted automatically. - `callOptions` (CallOptions) (optional) **Returns:** @@ -78,9 +78,7 @@ const result = await resource.doCommand({ // Struct (still supported) import { Struct } from '@viamrobotics/sdk'; -const result = await resource.doCommand( - Struct.fromJson({ myCommand: { key: 'value' } }) -); +const result = await resource.doCommand(Struct.fromJson({ myCommand: { key: 'value' } })); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/GenericServiceClient.html#docommand). @@ -109,6 +107,58 @@ For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_s {{% /tab %}} {{< /tabs >}} +### GetStatus + +Get the current status of the generic service as a map of key-value pairs describing its state. + +{{< tabs >}} +{{% tab name="Python" %}} + +**Parameters:** + +- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (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](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : The status of the service. + +**Example:** + +```python {class="line-numbers linkable-line-numbers"} +status = await service.get_status() +``` + +For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/services/generic/client/index.html#viam.services.generic.client.GenericClient.get_status). + +{{% /tab %}} +{{% tab name="TypeScript" %}} + +**Parameters:** + +- `callOptions` (CallOptions) (optional) + +**Returns:** + +- (Promise<[JsonValue](https://ts.viam.dev/types/JsonValue.html)>) + +For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/GenericServiceClient.html#getstatus). + +{{% /tab %}} +{{% tab name="Flutter" %}} + +**Parameters:** + +- None. + +**Returns:** + +- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), dynamic>\> + +For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_sdk/GenericServiceClient/getStatus.html). + +{{% /tab %}} +{{< /tabs >}} + ### GetResourceName Get the `ResourceName` for this instance of the generic service. diff --git a/static/include/services/apis/generated/mlmodel-table.md b/static/include/services/apis/generated/mlmodel-table.md index 5e4a343741..9ec86976bc 100644 --- a/static/include/services/apis/generated/mlmodel-table.md +++ b/static/include/services/apis/generated/mlmodel-table.md @@ -5,5 +5,6 @@ | [`Metadata`](/reference/apis/services/ml/#metadata) | Get the metadata: name, data type, expected tensor/array shape, inputs, and outputs associated with the ML model. | | [`Reconfigure`](/reference/apis/services/ml/#reconfigure) | Reconfigure this resource. | | [`DoCommand`](/reference/apis/services/ml/#docommand) | Execute model-specific commands that are not otherwise defined by the service API. | +| [`GetStatus`](/reference/apis/services/ml/#getstatus) | Get the current status of the ML model service as a map of key-value pairs describing its state. | | [`GetResourceName`](/reference/apis/services/ml/#getresourcename) | Get the `ResourceName` for this instance of the ML model service. | | [`Close`](/reference/apis/services/ml/#close) | Safely shut down the resource and prevent further use. | diff --git a/static/include/services/apis/generated/mlmodel.md b/static/include/services/apis/generated/mlmodel.md index a1928fe182..c09d7afbc1 100644 --- a/static/include/services/apis/generated/mlmodel.md +++ b/static/include/services/apis/generated/mlmodel.md @@ -180,6 +180,32 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r {{% /tab %}} {{< /tabs >}} +### GetStatus + +Get the current status of the ML model service as a map of key-value pairs describing its state. + +{{< tabs >}} +{{% tab name="Python" %}} + +**Parameters:** + +- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (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](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : The status of the service. + +**Example:** + +```python {class="line-numbers linkable-line-numbers"} +status = await service.get_status() +``` + +For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/services/mlmodel/client/index.html#viam.services.mlmodel.client.MLModelClient.get_status). + +{{% /tab %}} +{{< /tabs >}} + ### GetResourceName Get the `ResourceName` for this instance of the ML model service. diff --git a/static/include/services/apis/generated/motion-table.md b/static/include/services/apis/generated/motion-table.md index dfa35cfc38..0c9f86c47f 100644 --- a/static/include/services/apis/generated/motion-table.md +++ b/static/include/services/apis/generated/motion-table.md @@ -11,5 +11,6 @@ | [`Reconfigure`](/reference/apis/services/motion/#reconfigure) | Reconfigure this resource. | | [`FromRobot`](/reference/apis/services/motion/#fromrobot) | Get the resource from the provided machine. | | [`DoCommand`](/reference/apis/services/motion/#docommand) | Execute model-specific commands that are not otherwise defined by the service API. | +| [`GetStatus`](/reference/apis/services/motion/#getstatus) | Get the current status of the motion service as a map of key-value pairs describing its state. | | [`GetResourceName`](/reference/apis/services/motion/#getresourcename) | Get the `ResourceName` for this instance of the motion service. | | [`Close`](/reference/apis/services/motion/#close) | Safely shut down the resource and prevent further use. | diff --git a/static/include/services/apis/generated/motion.md b/static/include/services/apis/generated/motion.md index d9fbeb0403..5448f1f496 100644 --- a/static/include/services/apis/generated/motion.md +++ b/static/include/services/apis/generated/motion.md @@ -16,7 +16,7 @@ The motion service takes the volumes associated with all configured machine comp **Parameters:** - `component_name` ([str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The `ResourceName` of the piece of the robot that should arrive at the destination. Note that `move` moves the distal end of the component to the destination. For example, when moving a robotic arm, the piece that will arrive at the destination is the end effector attachment point, not the base of the arm. -- `destination` ([viam.proto.common.PoseInFrame](https://python.viam.dev/autoapi/viam/proto/common/index.html#viam.proto.common.PoseInFrame)) (required): Describes where the `component_name` frame should be moved to. Can be any pose, from the perspective of any component whose location is configured as a [`frame`](/motion-planning/frame-system/). +- `destination` ([viam.proto.common.PoseInFrame](https://python.viam.dev/autoapi/viam/proto/common/index.html#viam.proto.common.PoseInFrame)) (required): Describes where the `component_name` frame should be moved to. Can be any pose, from the perspective of any component whose location is configured as a [`frame`](/reference/services/frame-system/). - `world_state` ([viam.proto.common.WorldState](https://python.viam.dev/autoapi/viam/proto/common/index.html#viam.proto.common.WorldState)) (optional): Data structure specifying information about the world around the machine. Used to augment the motion solving process. `world_state` includes obstacles and transforms: @@ -110,13 +110,12 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/s **Parameters:** -- `destination` ([PlainMessage](https://ts.viam.dev/types/PlainMessage.html)) (required): Destination to move to, which can a pose in the - reference frame of any frame in the robot's frame system. -- `componentName` (string) (required): Component on the robot to move to the specified - destination. -- `worldState` ([PlainMessage](https://ts.viam.dev/types/PlainMessage.html)) (optional): Avoid obstacles by specifying their geometries in the - world state. Augment the frame system of the robot by specifying - additional transforms to add to it for the duration of the Move. +- `destination` ([PoseInFrame](https://ts.viam.dev/types/PoseInFrame.html)) (required): Destination to move to, which can a pose in the reference frame of any + frame in the robot's frame system. +- `componentName` (string) (required): Component on the robot to move to the specified destination. +- `worldState` ([PlainMessage](https://ts.viam.dev/types/PlainMessage.html)) (optional): Avoid obstacles by specifying their geometries in the world state. Augment + the frame system of the robot by specifying additional transforms to add to it for the + duration of the Move. - `constraints` ([PlainMessage](https://ts.viam.dev/types/PlainMessage.html)) (optional): Constrain the way the robot will move. - `extra` (None) (optional) - `callOptions` (CallOptions) (optional) @@ -208,7 +207,7 @@ The configuration you want to set across this machine for this motion service. T - `plan_deviation_m` [(float)](https://docs.python.org/3/library/functions.html#float): The distance in meters that the machine can deviate from the motion plan. By default this is set to 2.6 m which is an appropriate value for outdoor usage. When you use the `MoveOnMap()` method from the **CONTROL** tab, the default is overwritten to 0.5 m for testing. - `linear_m_per_sec` [(float)](https://docs.python.org/3/library/functions.html#float): Linear velocity this machine should target when moving. - `angular_degs_per_sec` [(float)](https://docs.python.org/3/library/functions.html#float): Angular velocity this machine should target when turning. -- `obstacles` ([Sequence[viam.proto.common.Geometry]](https://python.viam.dev/autoapi/viam/gen/common/v1/common_pb2/index.html#viam.gen.common.v1.common_pb2.Geometry)) (optional): Obstacles, specified in the SLAM frame coordinate system, to be considered when planning the motion of the component. +- `obstacles` ([Sequence[viam.proto.common.Geometry]](https://python.viam.dev/autoapi/viam/gen/app/data/v1/data_pb2/index.html#viam.gen.app.data.v1.data_pb2.Sequence)) (optional): Obstacles, specified in the SLAM frame coordinate system, to be considered when planning the motion of the component. - `extra` (Mapping[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), Any]) (optional): Extra options to pass to the underlying RPC call. - `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call. @@ -300,12 +299,10 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/s **Parameters:** -- `destination` ([PlainMessage](https://ts.viam.dev/types/PlainMessage.html)) (required): Specify a destination to, which can be any `Pose` with - respect to the SLAM map's origin. -- `componentName` (string) (required): Component on the robot to move to the specified - destination. -- `slamServiceName` (string) (required): Name of the `SLAM` service from which the SLAM map - is requested. +- `destination` ([Pose](https://ts.viam.dev/types/Pose.html)) (required): Specify a destination to, which can be any `Pose` with respect to the SLAM + map's origin. +- `componentName` (string) (required): Component on the robot to move to the specified destination. +- `slamServiceName` (string) (required): Name of the `SLAM` service from which the SLAM map is requested. - `motionConfig` ([PlainMessage](https://ts.viam.dev/types/PlainMessage.html)) (optional) - `obstacles` ([PlainMessage](https://ts.viam.dev/types/PlainMessage.html)) (optional): Optional obstacles to be considered for motion planning. - `extra` (None) (optional) @@ -335,11 +332,7 @@ const baseName = 'my_base'; const slamServiceName = 'my_slam_service'; // Move the base to Y=10 (location of 0,10,0) relative to map origin -const executionId = await motion.moveOnMap( - myPose, - baseName, - slamServiceName -); +const executionId = await motion.moveOnMap(myPose, baseName, slamServiceName); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/MotionClient.html#moveonmap). @@ -392,7 +385,7 @@ Translation in obstacles is not supported by the [navigation service](/reference - `component_name` ([str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The `ResourceName` of the base to move. - `destination` ([viam.proto.common.GeoPoint](https://python.viam.dev/autoapi/viam/components/movement_sensor/index.html#viam.components.movement_sensor.GeoPoint)) (required): The location of the component's destination, represented in geographic notation as a [GeoPoint](https://python.viam.dev/autoapi/viam/components/movement_sensor/index.html#viam.components.movement_sensor.GeoPoint) _(lat, lng)_. - `movement_sensor_name` ([str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The `ResourceName` of the [movement sensor](/reference/components/movement-sensor/) that you want to use to check the machine's location. -- `obstacles` ([Sequence[viam.proto.common.GeoGeometry]](https://python.viam.dev/autoapi/viam/gen/common/v1/common_pb2/index.html#viam.gen.common.v1.common_pb2.GeoGeometry)) (optional): Obstacles to consider when planning the motion of the component, with each represented as a `GeoGeometry`.
  • Default: `None`
+- `obstacles` ([Sequence[viam.proto.common.GeoGeometry]](https://python.viam.dev/autoapi/viam/gen/app/data/v1/data_pb2/index.html#viam.gen.app.data.v1.data_pb2.Sequence)) (optional): Obstacles to consider when planning the motion of the component, with each represented as a `GeoGeometry`.
  • Default: `None`
- `heading` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (optional): The compass heading, in degrees, that the machine's movement sensor should report at the `destination` point.
  • Range: `[0-360)` `0`: North, `90`: East, `180`: South, `270`: West
  • Default: `None`
- `configuration` ([viam.proto.service.motion.MotionConfiguration](https://python.viam.dev/autoapi/viam/gen/service/motion/v1/motion_pb2/index.html#viam.gen.service.motion.v1.motion_pb2.MotionConfiguration)) (optional): The configuration you want to set across this machine for this motion service. This parameter and each of its fields are optional. @@ -403,7 +396,7 @@ The configuration you want to set across this machine for this motion service. T - `plan_deviation_m` [(float)](https://docs.python.org/3/library/functions.html#float): The distance in meters that the machine can deviate from the motion plan. - `linear_m_per_sec` [(float)](https://docs.python.org/3/library/functions.html#float): Linear velocity this machine should target when moving. - `angular_degs_per_sec` [(float)](https://docs.python.org/3/library/functions.html#float): Angular velocity this machine should target when turning. -- `bounding_regions` ([Sequence[viam.proto.common.GeoGeometry]](https://python.viam.dev/autoapi/viam/gen/common/v1/common_pb2/index.html#viam.gen.common.v1.common_pb2.GeoGeometry)) (optional): Set of obstacles which the robot must remain within while navigating. +- `bounding_regions` ([Sequence[viam.proto.common.GeoGeometry]](https://python.viam.dev/autoapi/viam/gen/app/data/v1/data_pb2/index.html#viam.gen.app.data.v1.data_pb2.Sequence)) (optional): Set of obstacles which the robot must remain within while navigating. - `extra` (Mapping[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), Any]) (optional): Extra options to pass to the underlying RPC call. - `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call. @@ -496,14 +489,12 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/s **Parameters:** -- `destination` ([PlainMessage](https://ts.viam.dev/types/PlainMessage.html)) (required): Destination for the component to move to, represented - as a `GeoPoint`. +- `destination` ([GeoPoint](https://ts.viam.dev/types/GeoPoint.html)) (required): Destination for the component to move to, represented as a `GeoPoint`. - `componentName` (string) (required): The name of the component to move. -- `movementSensorName` (string) (required): The name of the `Movement Sensor` used to check - the robot's location. +- `movementSensorName` (string) (required): The name of the `Movement Sensor` used to check the robot's + location. - `heading` (number) (optional): Compass heading, in degrees, to achieve at destination. -- `obstaclesList` ([PlainMessage](https://ts.viam.dev/types/PlainMessage.html)) (optional): Obstacles to consider when planning the motion of - the component. +- `obstaclesList` ([PlainMessage](https://ts.viam.dev/types/PlainMessage.html)) (optional): Obstacles to consider when planning the motion of the component. - `motionConfig` ([PlainMessage](https://ts.viam.dev/types/PlainMessage.html)) (optional) - `boundingRegionsList` ([PlainMessage](https://ts.viam.dev/types/PlainMessage.html)) (optional) - `extra` (None) (optional) @@ -531,7 +522,7 @@ const movementSensorName = 'my_movement_sensor'; const globeExecutionId = await motion.moveOnGlobe( destination, baseName, - movementSensorName + movementSensorName, ); ``` @@ -542,7 +533,7 @@ For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/ ### GetPose -`GetPose` gets the location and orientation of a component within the [frame system](/motion-planning/frame-system/). +`GetPose` gets the location and orientation of a component within the [frame system](/reference/services/frame-system/). The return type of this function is a `PoseInFrame` describing the pose of the specified component with respect to the specified destination frame. You can use the `supplemental_transforms` argument to augment the machine's existing frame system with supplemental frames. @@ -783,7 +774,7 @@ All repeated fields are in chronological order. **Returns:** -- ([Sequence[viam.proto.service.motion.PlanStatusWithID]](https://python.viam.dev/autoapi/viam/proto/service/motion/index.html#viam.proto.service.motion.PlanStatusWithID)): : List of last known statuses with the +- ([Sequence[viam.proto.service.motion.PlanStatusWithID]](https://python.viam.dev/autoapi/viam/gen/app/data/v1/data_pb2/index.html#viam.gen.app.data.v1.data_pb2.Sequence)): : List of last known statuses with the associated IDs of all plans within the TTL ordered by timestamp in ascending order. **Example:** @@ -827,8 +818,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/s **Parameters:** -- `onlyActivePlans` (boolean) (optional): If true, the response will only return plans which - are executing. +- `onlyActivePlans` (boolean) (optional): If true, the response will only return plans which are executing. - `extra` (None) (optional) - `callOptions` (CallOptions) (optional) @@ -1081,8 +1071,8 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Parameters:** -- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or - a plain object, which will be converted automatically. +- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or a plain object, + which will be converted automatically. - `callOptions` (CallOptions) (optional) **Returns:** @@ -1100,9 +1090,7 @@ const result = await resource.doCommand({ // Struct (still supported) import { Struct } from '@viamrobotics/sdk'; -const result = await resource.doCommand( - Struct.fromJson({ myCommand: { key: 'value' } }) -); +const result = await resource.doCommand(Struct.fromJson({ myCommand: { key: 'value' } })); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/MotionClient.html#docommand). @@ -1110,6 +1098,45 @@ For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/ {{% /tab %}} {{< /tabs >}} +### GetStatus + +Get the current status of the motion service as a map of key-value pairs describing its state. + +{{< tabs >}} +{{% tab name="Python" %}} + +**Parameters:** + +- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (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](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : The status of the service. + +**Example:** + +```python {class="line-numbers linkable-line-numbers"} +status = await service.get_status() +``` + +For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/services/motion/client/index.html#viam.services.motion.client.MotionClient.get_status). + +{{% /tab %}} +{{% tab name="TypeScript" %}} + +**Parameters:** + +- `callOptions` (CallOptions) (optional) + +**Returns:** + +- (Promise<[JsonValue](https://ts.viam.dev/types/JsonValue.html)>) + +For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/MotionClient.html#getstatus). + +{{% /tab %}} +{{< /tabs >}} + ### GetResourceName Get the `ResourceName` for this instance of the motion service. diff --git a/static/include/services/apis/generated/slam-table.md b/static/include/services/apis/generated/slam-table.md index 45ac702182..c7b6c1853b 100644 --- a/static/include/services/apis/generated/slam-table.md +++ b/static/include/services/apis/generated/slam-table.md @@ -9,5 +9,6 @@ | [`PointCloudMapFull`](/reference/apis/services/slam/#pointcloudmapfull) | `PointCloudMapFull` concatenates the streaming responses from `PointCloudMap` into a full point cloud. | | [`Reconfigure`](/reference/apis/services/slam/#reconfigure) | Reconfigure this resource. | | [`DoCommand`](/reference/apis/services/slam/#docommand) | Execute model-specific commands that are not otherwise defined by the service API. | +| [`GetStatus`](/reference/apis/services/slam/#getstatus) | Get the current status of the SLAM service as a map of key-value pairs describing its state. | | [`GetResourceName`](/reference/apis/services/slam/#getresourcename) | Get the `ResourceName` for this instance of the SLAM service. | | [`Close`](/reference/apis/services/slam/#close) | Safely shut down the resource and prevent further use. | diff --git a/static/include/services/apis/generated/slam.md b/static/include/services/apis/generated/slam.md index 827c64431d..b19a0766e2 100644 --- a/static/include/services/apis/generated/slam.md +++ b/static/include/services/apis/generated/slam.md @@ -124,7 +124,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/s **Returns:** -- (Promise) +- (Promise>) **Example:** @@ -191,7 +191,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/s **Returns:** -- (Promise) +- (Promise>) **Example:** @@ -418,8 +418,8 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Parameters:** -- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or - a plain object, which will be converted automatically. +- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or a plain object, + which will be converted automatically. - `callOptions` (CallOptions) (optional) **Returns:** @@ -437,9 +437,7 @@ const result = await resource.doCommand({ // Struct (still supported) import { Struct } from '@viamrobotics/sdk'; -const result = await resource.doCommand( - Struct.fromJson({ myCommand: { key: 'value' } }) -); +const result = await resource.doCommand(Struct.fromJson({ myCommand: { key: 'value' } })); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/SlamClient.html#docommand). @@ -447,6 +445,45 @@ For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/ {{% /tab %}} {{< /tabs >}} +### GetStatus + +Get the current status of the SLAM service as a map of key-value pairs describing its state. + +{{< tabs >}} +{{% tab name="Python" %}} + +**Parameters:** + +- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (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](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : The status of the service. + +**Example:** + +```python {class="line-numbers linkable-line-numbers"} +status = await service.get_status() +``` + +For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/services/slam/client/index.html#viam.services.slam.client.SLAMClient.get_status). + +{{% /tab %}} +{{% tab name="TypeScript" %}} + +**Parameters:** + +- `callOptions` (CallOptions) (optional) + +**Returns:** + +- (Promise<[JsonValue](https://ts.viam.dev/types/JsonValue.html)>) + +For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/SlamClient.html#getstatus). + +{{% /tab %}} +{{< /tabs >}} + ### GetResourceName Get the `ResourceName` for this instance of the SLAM service. diff --git a/static/include/services/apis/generated/vision-table.md b/static/include/services/apis/generated/vision-table.md index 9a1426c75e..ec06e20326 100644 --- a/static/include/services/apis/generated/vision-table.md +++ b/static/include/services/apis/generated/vision-table.md @@ -9,6 +9,7 @@ | [`CaptureAllFromCamera`](/reference/apis/services/vision/#captureallfromcamera) | Get the next image, detections, classifications, and objects all together, given a camera name. | | [`Reconfigure`](/reference/apis/services/vision/#reconfigure) | Reconfigure this resource. | | [`DoCommand`](/reference/apis/services/vision/#docommand) | Execute model-specific commands that are not otherwise defined by the service API. | +| [`GetStatus`](/reference/apis/services/vision/#getstatus) | Get the current status of the vision service as a map of key-value pairs describing its state. | | [`GetResourceName`](/reference/apis/services/vision/#getresourcename) | Get the `ResourceName` for this instance of the vision service. | | [`GetProperties`](/reference/apis/services/vision/#getproperties) | Fetch information about which vision methods a given vision service supports. | | [`Close`](/reference/apis/services/vision/#close) | Safely shut down the resource and prevent further use. | diff --git a/static/include/services/apis/generated/vision.md b/static/include/services/apis/generated/vision.md index 101ddab1f9..4d9550c429 100644 --- a/static/include/services/apis/generated/vision.md +++ b/static/include/services/apis/generated/vision.md @@ -13,9 +13,9 @@ Get a list of detections from the next image from a specified camera using a con **Returns:** -- ([List[viam.proto.service.vision.Detection]](https://python.viam.dev/autoapi/viam/proto/service/vision/index.html#viam.proto.service.vision.Detection)): : A list of 2D bounding boxes, their labels, and the - confidence score of the labels, around the found objects in the next 2D image - from the given camera, with the given detector applied to it. +- ([list[viam.proto.service.vision.Detection]](https://python.viam.dev/autoapi/viam/proto/service/vision/index.html#viam.proto.service.vision.Detection)): : A list of 2D bounding boxes, their labels, and the + confidence score of the labels, around the found objects in the next 2D image + from the given camera, with the given detector applied to it. **Raises:** @@ -78,13 +78,13 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/s **Returns:** -- (Promise<[visionApi](https://ts.viam.dev/modules/visionApi.html).[Detection](https://ts.viam.dev/classes/visionApi.Detection.html)[]>): \* The list of Detections. +- (Promise<[visionApi](https://ts.viam.dev/modules/visionApi.html).[Detection](https://ts.viam.dev/classes/visionApi.Detection.html)[]>): * The list of Detections. **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const vision = new VIAM.VisionClient(machine, "my_vision"); -const detections = await vision.getDetectionsFromCamera("my_camera"); +const vision = new VIAM.VisionClient(machine, 'my_vision'); +const detections = await vision.getDetectionsFromCamera('my_camera'); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/VisionClient.html#getdetectionsfromcamera). @@ -128,9 +128,9 @@ Get a list of detections from a given image using a configured [detector](/refer **Returns:** -- ([List[viam.proto.service.vision.Detection]](https://python.viam.dev/autoapi/viam/proto/service/vision/index.html#viam.proto.service.vision.Detection)): : A list of 2D bounding boxes, their labels, and the - confidence score of the labels, around the found objects in the next 2D image - from the given camera, with the given detector applied to it. +- ([list[viam.proto.service.vision.Detection]](https://python.viam.dev/autoapi/viam/proto/service/vision/index.html#viam.proto.service.vision.Detection)): : A list of 2D bounding boxes, their labels, and the + confidence score of the labels, around the found objects in the next 2D image + from the given camera, with the given detector applied to it. **Raises:** @@ -158,7 +158,7 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/ **Parameters:** - `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries. -- `img` [(\*camera.NamedImage)](https://pkg.go.dev/go.viam.com/rdk/components/camera#NamedImage): The image in which to look for detections. +- `img` [(*camera.NamedImage)](https://pkg.go.dev/go.viam.com/rdk/components/camera#NamedImage): The image in which to look for detections. - `extra` [(map[string]interface{})](https://go.dev/blog/maps): Extra options to pass to the underlying RPC call. **Returns:** @@ -169,17 +169,15 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/ **Example:** ```go {class="line-numbers linkable-line-numbers"} + // add "go.viam.com/rdk/utils" to imports to use this code snippet + myCam, err := camera.FromProvider(machine, "my_camera") if err != nil { logger.Error(err) return } - // Capture an image from the camera - images, _, err := myCam.Images(context.Background(), nil, nil) - if err != nil { - logger.Error(err) - return - } + // Get an image from the camera decoded as an image.Image + img, err = camera.DecodeImageFromCamera(context.Background(), utils.MimeTypeJPEG, nil, myCam) myDetectorService, err := vision.FromProvider(machine, "my_detector") if err != nil { @@ -187,7 +185,7 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/ return } // Get the detections from the image - detections, err := myDetectorService.Detections(context.Background(), &images[0], nil) + detections, err := myDetectorService.Detections(context.Background(), img, nil) if err != nil { logger.Fatalf("Could not get detections: %v", err) } @@ -212,13 +210,13 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/s **Returns:** -- (Promise<[visionApi](https://ts.viam.dev/modules/visionApi.html).[Detection](https://ts.viam.dev/classes/visionApi.Detection.html)[]>): \* The list of Detections. +- (Promise<[visionApi](https://ts.viam.dev/modules/visionApi.html).[Detection](https://ts.viam.dev/classes/visionApi.Detection.html)[]>): * The list of Detections. **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const camera = new VIAM.CameraClient(machine, "my_camera"); -const vision = new VIAM.VisionClient(machine, "my_vision"); +const camera = new VIAM.CameraClient(machine, 'my_camera'); +const vision = new VIAM.VisionClient(machine, 'my_vision'); const { images } = await camera.getImages(); const detections = await vision.getDetections( @@ -272,7 +270,7 @@ Get a list of classifications from the next image from a specified camera using **Returns:** -- ([List[viam.proto.service.vision.Classification]](https://python.viam.dev/autoapi/viam/proto/service/vision/index.html#viam.proto.service.vision.Classification)): : The list of Classifications. +- ([list[viam.proto.service.vision.Classification]](https://python.viam.dev/autoapi/viam/proto/service/vision/index.html#viam.proto.service.vision.Classification)): : The list of Classifications. **Example:** @@ -333,16 +331,13 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/s **Returns:** -- (Promise<[visionApi](https://ts.viam.dev/modules/visionApi.html).[Classification](https://ts.viam.dev/classes/visionApi.Classification.html)[]>): \* The list of Classifications. +- (Promise<[visionApi](https://ts.viam.dev/modules/visionApi.html).[Classification](https://ts.viam.dev/classes/visionApi.Classification.html)[]>): * The list of Classifications. **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const vision = new VIAM.VisionClient(machine, "my_vision"); -const classifications = await vision.getClassificationsFromCamera( - "my_camera", - 10, -); +const vision = new VIAM.VisionClient(machine, 'my_vision'); +const classifications = await vision.getClassificationsFromCamera('my_camera', 10); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/VisionClient.html#getclassificationsfromcamera). @@ -388,7 +383,7 @@ Get a list of classifications from a given image using a configured [classifier] **Returns:** -- ([List[viam.proto.service.vision.Classification]](https://python.viam.dev/autoapi/viam/proto/service/vision/index.html#viam.proto.service.vision.Classification)): : The list of Classifications. +- ([list[viam.proto.service.vision.Classification]](https://python.viam.dev/autoapi/viam/proto/service/vision/index.html#viam.proto.service.vision.Classification)): : The list of Classifications. **Example:** @@ -412,7 +407,7 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/ **Parameters:** - `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries. -- `img` [(\*camera.NamedImage)](https://pkg.go.dev/go.viam.com/rdk/components/camera#NamedImage): The image in which to look for classifications. +- `img` [(*camera.NamedImage)](https://pkg.go.dev/go.viam.com/rdk/components/camera#NamedImage): The image in which to look for classifications. - `n` [(int)](https://pkg.go.dev/builtin#int): The number of classifications to return. For example, if you specify `3` you will get the top three classifications with the greatest confidence scores. - `extra` [(map[string]interface{})](https://go.dev/blog/maps): Extra options to pass to the underlying RPC call. @@ -424,17 +419,15 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/ **Example:** ```go {class="line-numbers linkable-line-numbers"} + // add "go.viam.com/rdk/utils" to imports to use this code snippet + myCam, err := camera.FromProvider(machine, "my_camera") if err != nil { logger.Error(err) return } - // Capture an image from the camera - images, _, err := myCam.Images(context.Background(), nil, nil) - if err != nil { - logger.Error(err) - return - } + // Get an image from the camera decoded as an image.Image + img, err = camera.DecodeImageFromCamera(context.Background(), utils.MimeTypeJPEG, nil, myCam) myClassifierService, err := vision.FromProvider(machine, "my_classifier") if err != nil { @@ -442,7 +435,7 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/ return } // Get the 2 classifications with the highest confidence scores from the image - classifications, err := myClassifierService.Classifications(context.Background(), &images[0], 2, nil) + classifications, err := myClassifierService.Classifications(context.Background(), img, 2, nil) if err != nil { logger.Fatalf("Could not get classifications: %v", err) } @@ -468,13 +461,13 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/s **Returns:** -- (Promise<[visionApi](https://ts.viam.dev/modules/visionApi.html).[Classification](https://ts.viam.dev/classes/visionApi.Classification.html)[]>): \* The list of Classifications. +- (Promise<[visionApi](https://ts.viam.dev/modules/visionApi.html).[Classification](https://ts.viam.dev/classes/visionApi.Classification.html)[]>): * The list of Classifications. **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const camera = new VIAM.CameraClient(machine, "my_camera"); -const vision = new VIAM.VisionClient(machine, "my_vision"); +const camera = new VIAM.CameraClient(machine, 'my_camera'); +const vision = new VIAM.VisionClient(machine, 'my_vision'); const { images } = await camera.getImages(); const classifications = await vision.getClassifications( @@ -529,7 +522,7 @@ Get a list of 3D point cloud objects and associated metadata in the latest pictu **Returns:** -- ([List[viam.proto.common.PointCloudObject]](https://python.viam.dev/autoapi/viam/proto/common/index.html#viam.proto.common.PointCloudObject)): : The pointcloud objects with metadata. +- ([list[viam.proto.common.PointCloudObject]](https://python.viam.dev/autoapi/viam/proto/common/index.html#viam.proto.common.PointCloudObject)): : The pointcloud objects with metadata. **Example:** @@ -560,7 +553,7 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/ **Returns:** -- [([]\*viz.Object)](https://pkg.go.dev/go.viam.com/rdk/vision#Object): A list of point clouds and associated metadata like the center coordinates of each point cloud. +- [([]*viz.Object)](https://pkg.go.dev/go.viam.com/rdk/vision#Object): A list of point clouds and associated metadata like the center coordinates of each point cloud. - [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred. **Example:** @@ -594,13 +587,13 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/s **Returns:** -- (Promise<[commonApi](https://ts.viam.dev/modules/commonApi.html).[PointCloudObject](https://ts.viam.dev/classes/commonApi.PointCloudObject.html)[]>): \* The list of PointCloudObjects. +- (Promise<[commonApi](https://ts.viam.dev/modules/commonApi.html).[PointCloudObject](https://ts.viam.dev/classes/commonApi.PointCloudObject.html)[]>): * The list of PointCloudObjects. **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const vision = new VIAM.VisionClient(machine, "my_vision"); -const pointCloudObjects = await vision.getObjectPointClouds("my_camera"); +const vision = new VIAM.VisionClient(machine, 'my_vision'); +const pointCloudObjects = await vision.getObjectPointClouds('my_camera'); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/VisionClient.html#getobjectpointclouds). @@ -649,9 +642,9 @@ Used for visualization. **Returns:** -- ([viam.services.vision.vision.CaptureAllResult](https://python.viam.dev/autoapi/viam/services/vision/vision/index.html#viam.services.vision.vision.CaptureAllResult)): : A class that stores all potential returns from the vision service. - It can return the image from the camera along with its associated detections, classifications, - and objects, as well as any extra info the model may provide. +- ([viam.services.vision.vision.CaptureAllResult](https://python.viam.dev/autoapi/viam/services/vision/vision/index.html#viam.services.vision.vision.CaptureAllResult)): : A class that stores all potential returns from the vision service. + It can return the image from the camera along with its associated detections, classifications, + and objects, as well as any extra info the model may provide. **Example:** @@ -711,22 +704,21 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/s **Parameters:** -- `cameraName` (string) (required): The name of the camera to use for classification, - detection, and segmentation. -- `__namedParameters` (CaptureAllOptions) (required) +- `cameraName` (string) (required): The name of the camera to use for classification, detection, and + segmentation. +- `opts` (CaptureAllOptions) (required): The fields desired in the response. - `extra` (None) (optional) - `callOptions` (CallOptions) (optional) **Returns:** -- (Promise< { classifications: [visionApi](https://ts.viam.dev/modules/visionApi.html).[Classification](https://ts.viam.dev/classes/visionApi.Classification.html)[]; detections: [visionApi](https://ts.viam.dev/modules/visionApi.html).[Detection](https://ts.viam.dev/classes/visionApi.Detection.html)[]; extra: undefined | [Struct](https://ts.viam.dev/classes/Struct.html); image: undefined | [Image](https://ts.viam.dev/classes/cameraApi.Image.html); objectPointClouds: [commonApi](https://ts.viam.dev/modules/commonApi.html).[PointCloudObject](https://ts.viam.dev/classes/commonApi.PointCloudObject.html)[]; }, >): \* The requested image, classifications, detections, and 3d point - cloud objects. +- (Promise< { classifications: [visionApi](https://ts.viam.dev/modules/visionApi.html).[Classification](https://ts.viam.dev/classes/visionApi.Classification.html)[]; detections: [visionApi](https://ts.viam.dev/modules/visionApi.html).[Detection](https://ts.viam.dev/classes/visionApi.Detection.html)[]; extra: [Struct](https://ts.viam.dev/classes/Struct.html) | undefined; image: [Image](https://ts.viam.dev/classes/cameraApi.Image.html) | undefined; objectPointClouds: [commonApi](https://ts.viam.dev/modules/commonApi.html).[PointCloudObject](https://ts.viam.dev/classes/commonApi.PointCloudObject.html)[]; }, >): * The requested image, classifications, detections, and 3d point cloud objects. **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const vision = new VIAM.VisionClient(machine, "my_vision"); -const captureAll = await vision.captureAllFromCamera("my_camera", { +const vision = new VIAM.VisionClient(machine, 'my_vision'); +const captureAll = await vision.captureAllFromCamera('my_camera', { returnImage: true, returnClassifications: true, returnDetections: true, @@ -779,7 +771,7 @@ If you are implementing your own vision service and want to add features that ha **Returns:** -- (Mapping[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : Result of the executed command. +- (collections.abc.Mapping[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : Result of the executed command. **Example:** @@ -825,8 +817,8 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Parameters:** -- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or - a plain object, which will be converted automatically. +- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or a plain object, + which will be converted automatically. - `callOptions` (CallOptions) (optional) **Returns:** @@ -838,15 +830,13 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r ```ts {class="line-numbers linkable-line-numbers"} // Plain object (recommended) const result = await resource.doCommand({ - myCommand: { key: "value" }, + myCommand: { key: 'value' }, }); // Struct (still supported) -import { Struct } from "@viamrobotics/sdk"; +import { Struct } from '@viamrobotics/sdk'; -const result = await resource.doCommand( - Struct.fromJson({ myCommand: { key: "value" } }), -); +const result = await resource.doCommand(Struct.fromJson({ myCommand: { key: 'value' } })); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/VisionClient.html#docommand). @@ -875,6 +865,58 @@ For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_s {{% /tab %}} {{< /tabs >}} +### GetStatus + +Get the current status of the vision service as a map of key-value pairs describing its state. + +{{< tabs >}} +{{% tab name="Python" %}} + +**Parameters:** + +- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call. + +**Returns:** + +- (collections.abc.Mapping[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : The status of the service. + +**Example:** + +```python {class="line-numbers linkable-line-numbers"} +status = await service.get_status() +``` + +For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/services/vision/client/index.html#viam.services.vision.client.VisionClient.get_status). + +{{% /tab %}} +{{% tab name="TypeScript" %}} + +**Parameters:** + +- `callOptions` (CallOptions) (optional) + +**Returns:** + +- (Promise<[JsonValue](https://ts.viam.dev/types/JsonValue.html)>) + +For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/VisionClient.html#getstatus). + +{{% /tab %}} +{{% tab name="Flutter" %}} + +**Parameters:** + +- None. + +**Returns:** + +- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)<[Map](https://api.flutter.dev/flutter/dart-core/Map-class.html)<[String](https://api.flutter.dev/flutter/dart-core/String-class.html), dynamic>\> + +For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_sdk/VisionClient/getStatus.html). + +{{% /tab %}} +{{< /tabs >}} + ### GetResourceName Get the `ResourceName` for this instance of the vision service. @@ -888,7 +930,7 @@ Get the `ResourceName` for this instance of the vision service. **Returns:** -- ([viam.proto.common.ResourceName](https://python.viam.dev/autoapi/viam/proto/common/index.html#viam.proto.common.ResourceName)): : The ResourceName of this Resource. +- ([viam.proto.common.ResourceName](https://python.viam.dev/autoapi/viam/proto/common/index.html#viam.proto.common.ResourceName)): : The ResourceName of this Resource. **Example:** @@ -933,7 +975,7 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r **Example:** ```ts {class="line-numbers linkable-line-numbers"} -vision.name; +vision.name ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/VisionClient.html#name). @@ -974,7 +1016,7 @@ Fetch information about which vision methods a given vision service supports. **Returns:** -- ([Vision.Properties](https://python.viam.dev/autoapi/viam/services/vision/vision/index.html#viam.services.vision.vision.Vision.Properties)): : The properties of the vision service. +- ([Vision.Properties](https://python.viam.dev/autoapi/viam/services/vision/vision/index.html#viam.services.vision.vision.Vision.Properties)): : The properties of the vision service. **Example:** @@ -997,7 +1039,7 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/ **Returns:** -- [(\*Properties)](https://pkg.go.dev/go.viam.com/rdk/services/vision#Properties) +- [(*Properties)](https://pkg.go.dev/go.viam.com/rdk/services/vision#Properties) - [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred. For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/services/vision#Service). @@ -1012,12 +1054,12 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/s **Returns:** -- (Promise< { classificationsSupported: boolean; detectionsSupported: boolean; objectPointCloudsSupported: boolean; }, >): \* The properties of the vision service. +- (Promise< { classificationsSupported: boolean; detectionsSupported: boolean; objectPointCloudsSupported: boolean; }, >): * The properties of the vision service. **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const vision = new VIAM.VisionClient(machine, "my_vision"); +const vision = new VIAM.VisionClient(machine, 'my_vision'); const properties = await vision.getProperties(); ``` diff --git a/static/include/services/apis/generated/world_state_store-table.md b/static/include/services/apis/generated/world_state_store-table.md index 06957fb522..7a8da6c317 100644 --- a/static/include/services/apis/generated/world_state_store-table.md +++ b/static/include/services/apis/generated/world_state_store-table.md @@ -5,5 +5,6 @@ | [`GetTransform`](/reference/apis/services/world-state-store/#gettransform) | Get a world state transform by UUID. | | [`StreamTransformChanges`](/reference/apis/services/world-state-store/#streamtransformchanges) | Stream changes to world state transforms. | | [`DoCommand`](/reference/apis/services/world-state-store/#docommand) | Execute model-specific commands that are not otherwise defined by the service API. | +| [`GetStatus`](/reference/apis/services/world-state-store/#getstatus) | Get the current status of the world state store service as a map of key-value pairs describing its state. | | [`GetResourceName`](/reference/apis/services/world-state-store/#getresourcename) | Get the ResourceName for this Resource with the given name. | | [`Close`](/reference/apis/services/world-state-store/#close) | Safely shut down the resource and prevent further use. | diff --git a/static/include/services/apis/generated/world_state_store.md b/static/include/services/apis/generated/world_state_store.md index 480e23581f..8e4a1c2563 100644 --- a/static/include/services/apis/generated/world_state_store.md +++ b/static/include/services/apis/generated/world_state_store.md @@ -39,10 +39,7 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/ **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const worldStateStore = new VIAM.WorldStateStoreClient( - machine, - 'builtin' -); +const worldStateStore = new VIAM.WorldStateStoreClient(machine, 'builtin'); // Get all transform UUIDs const uuids = await worldStateStore.listUUIDs(); @@ -96,10 +93,7 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/ **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const worldStateStore = new VIAM.WorldStateStoreClient( - machine, - 'builtin' -); +const worldStateStore = new VIAM.WorldStateStoreClient(machine, 'builtin'); // Get a specific transform by UUID const transform = await worldStateStore.getTransform(uuid); @@ -152,19 +146,12 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/ **Example:** ```ts {class="line-numbers linkable-line-numbers"} -const worldStateStore = new VIAM.WorldStateStoreClient( - machine, - 'builtin' -); +const worldStateStore = new VIAM.WorldStateStoreClient(machine, 'builtin'); // Stream transform changes const stream = worldStateStore.streamTransformChanges(); for await (const change of stream) { - console.log( - 'Transform change:', - change.changeType, - change.transform - ); + console.log('Transform change:', change.changeType, change.transform); } ``` @@ -212,8 +199,8 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/ **Parameters:** -- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or - a plain object, which will be converted automatically. +- `command` ([Struct](https://ts.viam.dev/classes/Struct.html)) (required): The command to execute. Accepts either a [Struct](https://ts.viam.dev/classes/Struct.html) or a plain object, + which will be converted automatically. - `callOptions` (CallOptions) (optional) **Returns:** @@ -231,9 +218,7 @@ const result = await resource.doCommand({ // Struct (still supported) import { Struct } from '@viamrobotics/sdk'; -const result = await resource.doCommand( - Struct.fromJson({ myCommand: { key: 'value' } }) -); +const result = await resource.doCommand(Struct.fromJson({ myCommand: { key: 'value' } })); ``` For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/WorldStateStoreClient.html#docommand). @@ -241,6 +226,45 @@ For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/ {{% /tab %}} {{< /tabs >}} +### GetStatus + +Get the current status of the world state store service as a map of key-value pairs describing its state. + +{{< tabs >}} +{{% tab name="Python" %}} + +**Parameters:** + +- `timeout` ([float](https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex)) (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](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes]): : The status of the service. + +**Example:** + +```python {class="line-numbers linkable-line-numbers"} +status = await service.get_status() +``` + +For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/services/worldstatestore/index.html#viam.services.worldstatestore.WorldStateStoreClient.get_status). + +{{% /tab %}} +{{% tab name="TypeScript" %}} + +**Parameters:** + +- `callOptions` (CallOptions) (optional) + +**Returns:** + +- (Promise<[JsonValue](https://ts.viam.dev/types/JsonValue.html)>) + +For more information, see the [TypeScript SDK Docs](https://ts.viam.dev/classes/WorldStateStoreClient.html#getstatus). + +{{% /tab %}} +{{< /tabs >}} + ### GetResourceName Get the ResourceName for this Resource with the given name. diff --git a/static/include/services/apis/overrides/protos/data_manager.GetStatus.md b/static/include/services/apis/overrides/protos/data_manager.GetStatus.md new file mode 100644 index 0000000000..1b12bb7049 --- /dev/null +++ b/static/include/services/apis/overrides/protos/data_manager.GetStatus.md @@ -0,0 +1 @@ +Get the current status of the data management service as a map of key-value pairs describing its state. diff --git a/static/include/services/apis/overrides/protos/discovery.GetStatus.md b/static/include/services/apis/overrides/protos/discovery.GetStatus.md new file mode 100644 index 0000000000..7d31ece0d6 --- /dev/null +++ b/static/include/services/apis/overrides/protos/discovery.GetStatus.md @@ -0,0 +1 @@ +Get the current status of the discovery service as a map of key-value pairs describing its state. diff --git a/static/include/services/apis/overrides/protos/generic_service.GetStatus.md b/static/include/services/apis/overrides/protos/generic_service.GetStatus.md new file mode 100644 index 0000000000..dc373bd10a --- /dev/null +++ b/static/include/services/apis/overrides/protos/generic_service.GetStatus.md @@ -0,0 +1 @@ +Get the current status of the generic service as a map of key-value pairs describing its state. diff --git a/static/include/services/apis/overrides/protos/mlmodel.GetStatus.md b/static/include/services/apis/overrides/protos/mlmodel.GetStatus.md new file mode 100644 index 0000000000..1baac66f3b --- /dev/null +++ b/static/include/services/apis/overrides/protos/mlmodel.GetStatus.md @@ -0,0 +1 @@ +Get the current status of the ML model service as a map of key-value pairs describing its state. diff --git a/static/include/services/apis/overrides/protos/motion.GetStatus.md b/static/include/services/apis/overrides/protos/motion.GetStatus.md new file mode 100644 index 0000000000..eaf23bf116 --- /dev/null +++ b/static/include/services/apis/overrides/protos/motion.GetStatus.md @@ -0,0 +1 @@ +Get the current status of the motion service as a map of key-value pairs describing its state. diff --git a/static/include/services/apis/overrides/protos/slam.GetStatus.md b/static/include/services/apis/overrides/protos/slam.GetStatus.md new file mode 100644 index 0000000000..e88954725b --- /dev/null +++ b/static/include/services/apis/overrides/protos/slam.GetStatus.md @@ -0,0 +1 @@ +Get the current status of the SLAM service as a map of key-value pairs describing its state. diff --git a/static/include/services/apis/overrides/protos/vision.GetStatus.md b/static/include/services/apis/overrides/protos/vision.GetStatus.md new file mode 100644 index 0000000000..a18dcfeccf --- /dev/null +++ b/static/include/services/apis/overrides/protos/vision.GetStatus.md @@ -0,0 +1 @@ +Get the current status of the vision service as a map of key-value pairs describing its state. diff --git a/static/include/services/apis/overrides/protos/world_state_store.GetStatus.md b/static/include/services/apis/overrides/protos/world_state_store.GetStatus.md new file mode 100644 index 0000000000..25117805aa --- /dev/null +++ b/static/include/services/apis/overrides/protos/world_state_store.GetStatus.md @@ -0,0 +1 @@ +Get the current status of the world state store service as a map of key-value pairs describing its state.