From 49b57ef6ae665ccf7945bff82e775d81b7cd7add Mon Sep 17 00:00:00 2001 From: Naomi Pentrel <5212232+npentrel@users.noreply.github.com> Date: Mon, 2 Dec 2024 13:35:21 +0100 Subject: [PATCH] DOCS-3167: Update python doc strings for tabular_data_by_sql (#3717) --- static/include/app/apis/generated/data.md | 16 ++++--------- .../components/apis/generated/arm-table.md | 1 + .../include/components/apis/generated/arm.md | 24 +++++++++++++++++++ .../protos/arm.MoveThroughJointPositions.md | 2 ++ static/include/robot/apis/generated/robot.md | 20 ++++++++++++++++ .../services/apis/generated/mlmodel.md | 17 +------------ 6 files changed, 52 insertions(+), 28 deletions(-) create mode 100644 static/include/components/apis/overrides/protos/arm.MoveThroughJointPositions.md diff --git a/static/include/app/apis/generated/data.md b/static/include/app/apis/generated/data.md index 5da410c4ca..1f6fade203 100644 --- a/static/include/app/apis/generated/data.md +++ b/static/include/app/apis/generated/data.md @@ -56,7 +56,7 @@ Obtain unified tabular data and metadata, queried with SQL. **Returns:** -- (List[Dict[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes | [datetime.datetime](https://docs.python.org/3/library/datetime.html)]]): An array of data objects. +- (List[Dict[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes | [datetime.datetime](https://docs.python.org/3/library/datetime.html)]]): An array of decoded BSON data objects. **Example:** @@ -82,32 +82,24 @@ Obtain unified tabular data and metadata, queried with MQL. **Parameters:** - `organization_id` ([str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (required): The ID of the organization that owns the data. You can obtain your organization ID from the Viam app’s organization settings page. -- `mql_binary` (List[[bytes](https://docs.python.org/3/library/stdtypes.html#bytes-objects)]) (required): The MQL query to run as a list of BSON queries. You can encode your bson queries using a library like pymongo or bson. +- `mql_binary` (List[[bytes](https://docs.python.org/3/library/stdtypes.html#bytes-objects)]) (required): The MQL query to run as a list of BSON queries. You can encode your bson queries using a library like pymongo. **Returns:** -- (List[Dict[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes | [datetime.datetime](https://docs.python.org/3/library/datetime.html)]]): An array of data objects. +- (List[Dict[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str), viam.utils.ValueTypes | [datetime.datetime](https://docs.python.org/3/library/datetime.html)]]): An array of decoded BSON data objects. **Example:** ```python {class="line-numbers linkable-line-numbers"} import bson -# using bson package (pip install bson) -tabular_data = await data_client.tabular_data_by_mql(organization_id="", mql_binary=[ - bson.dumps({ '$match': { 'location_id': '' } }), - bson.dumps({ '$limit': 5 }) -]) - -print(f"Tabular Data 1: {tabular_data}") - # using pymongo package (pip install pymongo) tabular_data = await data_client.tabular_data_by_mql(organization_id="", mql_binary=[ bson.encode({ '$match': { 'location_id': '' } }), bson.encode({ "$limit": 5 }) ]) -print(f"Tabular Data 2: {tabular_data}") +print(f"Tabular Data: {tabular_data}") ``` For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/data_client/index.html#viam.app.data_client.DataClient.tabular_data_by_mql). diff --git a/static/include/components/apis/generated/arm-table.md b/static/include/components/apis/generated/arm-table.md index da0f042c35..34cf95d823 100644 --- a/static/include/components/apis/generated/arm-table.md +++ b/static/include/components/apis/generated/arm-table.md @@ -4,6 +4,7 @@ | [`GetEndPosition`](/appendix/apis/components/arm/#getendposition) | Get the current position of the arm as a pose. | | [`MoveToPosition`](/appendix/apis/components/arm/#movetoposition) | Move the end of the arm in a straight line to the desired pose, relative to the base of the arm. | | [`MoveToJointPositions`](/appendix/apis/components/arm/#movetojointpositions) | Move each joint on the arm to the position specified in `positions`. | +| [`MoveThroughJointPositions`](/appendix/apis/components/arm/#movethroughjointpositions) | Move the arm's joints through the given positions in the order they are specified. | | [`GetJointPositions`](/appendix/apis/components/arm/#getjointpositions) | Get the current position of each joint on the arm. | | [`GetKinematics`](/appendix/apis/components/arm/#getkinematics) | Get the kinematics information associated with the arm as the format and byte contents of the kinematics file. | | [`IsMoving`](/appendix/apis/components/arm/#ismoving) | Get if the arm is currently moving. | diff --git a/static/include/components/apis/generated/arm.md b/static/include/components/apis/generated/arm.md index 17f2e7c34c..d2829459f4 100644 --- a/static/include/components/apis/generated/arm.md +++ b/static/include/components/apis/generated/arm.md @@ -254,6 +254,30 @@ For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_s {{% /tab %}} {{< /tabs >}} +### MoveThroughJointPositions + +Move the arm's joints through the given positions in the order they are specified. +This will block until done or a new operation cancels this one. + +{{< tabs >}} +{{% 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. +- `positions` [([][]referenceframe.Input)](https://pkg.go.dev/go.viam.com/rdk/referenceframe#Input) +- `options` [(*MoveOptions)](https://pkg.go.dev/go.viam.com/rdk/components/arm#MoveOptions) +- `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. + +For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/components/arm#Arm). + +{{% /tab %}} +{{< /tabs >}} + ### GetJointPositions Get the current position of each joint on the arm. diff --git a/static/include/components/apis/overrides/protos/arm.MoveThroughJointPositions.md b/static/include/components/apis/overrides/protos/arm.MoveThroughJointPositions.md new file mode 100644 index 0000000000..f081389fea --- /dev/null +++ b/static/include/components/apis/overrides/protos/arm.MoveThroughJointPositions.md @@ -0,0 +1,2 @@ +Move the arm's joints through the given positions in the order they are specified. +This will block until done or a new operation cancels this one. diff --git a/static/include/robot/apis/generated/robot.md b/static/include/robot/apis/generated/robot.md index a66769cc84..bc74f39cae 100644 --- a/static/include/robot/apis/generated/robot.md +++ b/static/include/robot/apis/generated/robot.md @@ -211,6 +211,26 @@ const componentConfigs = await machine.discoverComponents(queries); For more information, see the [Typescript SDK Docs](https://ts.viam.dev/classes/RobotClient.html). +{{% /tab %}} +{{% tab name="Flutter" %}} + +**Parameters:** + +- `queries` [List](https://api.flutter.dev/flutter/dart-core/List-class.html)\<[DiscoveryQuery](https://flutter.viam.dev/viam_sdk/DiscoveryQuery-class.html)\> (required) + +**Returns:** + +- [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)\<[List](https://api.flutter.dev/flutter/dart-core/List-class.html)\<[Discovery](https://flutter.viam.dev/viam_sdk/Discovery-class.html)\>\> + +**Example:** + +```dart {class="line-numbers linkable-line-numbers"} +var queries = [DiscoveryQuery(subtype: 'camera', model: 'webcam', extra: {'username': 'admin', 'password': 'admin'})]; +var discoveredComponents = await machine.discoverComponents(queries); +``` + +For more information, see the [Flutter SDK Docs](https://flutter.viam.dev/viam_sdk/RobotClient/discoverComponents.html). + {{% /tab %}} {{< /tabs >}} diff --git a/static/include/services/apis/generated/mlmodel.md b/static/include/services/apis/generated/mlmodel.md index c03537eda0..1a1526da8e 100644 --- a/static/include/services/apis/generated/mlmodel.md +++ b/static/include/services/apis/generated/mlmodel.md @@ -22,8 +22,6 @@ import numpy as np my_mlmodel = MLModelClient.from_robot(robot=machine, name="my_mlmodel_service") -output_tensors = await my_mlmodel.infer(input_tensors) - image_data = np.zeros((1, 384, 384, 3), dtype=np.uint8) # Create the input tensors dictionary @@ -52,20 +50,7 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/ **Example:** ```go {class="line-numbers linkable-line-numbers"} -import ( - "go.viam.com/rdk/ml" - "gorgonia.org/tensor" -) - -myMLModel, err := mlmodel.FromRobot(machine, "my_mlmodel_service") - -input_tensors := ml.Tensors{ - "image": tensor.New( - tensor.Of(tensor.Uint8), - tensor.WithShape(1, 384, 384, 3), - tensor.WithBacking(make([]uint8, 1*384*384*3)), - ), -} +input_tensors := ml.Tensors{"0": tensor.New(tensor.WithShape(1, 2, 3), tensor.WithBacking([]int{1, 2, 3, 4, 5, 6}))} output_tensors, err := myMLModel.Infer(context.Background(), input_tensors) ```