Skip to content

Commit 12f15e4

Browse files
committed
DOCS-3792: Update code samples
1 parent c6c0966 commit 12f15e4

4 files changed

Lines changed: 9 additions & 6 deletions

File tree

static/include/app/apis/generated/app.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,6 +1358,9 @@ Get a specific machine {{< glossary_tooltip term_id="part" text="part" >}}.
13581358
my_robot_part = await cloud.get_robot_part(
13591359
robot_part_id="abc12345-1a23-1234-ab12-a22a22a2aa22"
13601360
)
1361+
# Check if machine is live (last access time less than 10 sec ago)
1362+
if (time.time() - my_robot_part.last_access.timestamp()) <= 10000:
1363+
print("Machine is live.")
13611364
```
13621365

13631366
For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/app/app_client/index.html#viam.app.app_client.AppClient.get_robot_part).

static/include/app/apis/generated/data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1511,7 +1511,7 @@ Add a bounding box to an image specified by its BinaryID.
15111511

15121512
**Example:**
15131513

1514-
```python {class="line-numbers linkable-line-numbers" data-line="5"}
1514+
```python {class="line-numbers linkable-line-numbers"}
15151515
bbox_id = await data_client.add_bounding_box_to_image_by_id(
15161516
binary_id="<YOUR-BINARY-DATA-ID>",
15171517
label="label",

static/include/components/apis/generated/base.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ my_base = Base.from_robot(robot=machine, name="my_base")
220220
# Make your wheeled base move forward. Set linear power to 75%.
221221
print("move forward")
222222
await my_base.set_power(
223-
linear=Vector3(x=0, y=-.75, z=0),
223+
linear=Vector3(x=0, y=.75, z=0),
224224
angular=Vector3(x=0, y=0, z=0))
225225

226226
# Make your wheeled base move backward. Set linear power to -100%.

static/include/components/apis/generated/board.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ Supported by `viam-micro-server`.
727727
my_board = Board.from_robot(robot=machine, name="my_board")
728728

729729
# Get the Analog "my_example_analog_reader".
730-
reader = await my_board.analog_by_name(
730+
reader = await my_board.analog_reader_by_name(
731731
name="my_example_analog_reader")
732732

733733
# Get the value of the digital signal "my_example_analog_reader" has most
@@ -1057,7 +1057,7 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/
10571057

10581058
- `ctx` [(Context)](https://pkg.go.dev/context#Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
10591059
- `mode` [(pb.PowerMode)](https://pkg.go.dev/go.viam.com/api/component/board/v1#PowerMode): Options to specify power usage of the board: `boardpb.PowerMode_POWER_MODE_UNSPECIFIED`, `boardpb.PowerMode_POWER_MODE_NORMAL`, and `boardpb.PowerMode_POWER_MODE_OFFLINE_DEEP`.
1060-
- `duration` [(\*time.Duration)](https://pkg.go.dev/time#Duration): If provided, the board will exit the given power mode after the specified duration.
1060+
- `duration` [(*time.Duration)](https://pkg.go.dev/time#Duration): If provided, the board will exit the given power mode after the specified duration.
10611061

10621062
**Returns:**
10631063

@@ -1403,8 +1403,8 @@ For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/r
14031403

14041404
```ts {class="line-numbers linkable-line-numbers"}
14051405
const result = await resource.doCommand({
1406-
name: "myCommand",
1407-
args: { key: "value" },
1406+
name: 'myCommand',
1407+
args: { key: 'value' },
14081408
});
14091409
```
14101410

0 commit comments

Comments
 (0)