Skip to content

Commit f5c2676

Browse files
authored
Make code samples more consistent (#771)
1 parent 3cde16a commit f5c2676

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

src/viam/components/camera/camera.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ async def get_point_cloud(
107107
import numpy as np
108108
import open3d as o3d
109109
110+
my_camera = Camera.from_robot(robot=machine, name="my_camera")
111+
110112
data, _ = await my_camera.get_point_cloud()
111113
112114
# write the point cloud into a temporary file

src/viam/components/input/input.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ async def trigger_event(
276276
"""Directly send an Event (such as a button press) from external code
277277
278278
::
279+
my_controller = Controller.from_robot(
280+
robot=machine, name="my_controller")
279281
280282
# Get your controller from the machine.
281283
my_controller = Controller.from_robot(

src/viam/services/motion/motion.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ async def stop_plan(
238238
239239
::
240240
241+
motion = MotionClient.from_robot(robot=machine, name="builtin")
242+
241243
# Assuming a `move_on_globe()` started the execution
242244
# Stop the base component which was instructed to move by `move_on_globe()`
243245
# or `move_on_map()`

0 commit comments

Comments
 (0)