Skip to content

Make code samples more consistent #771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/viam/components/camera/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ async def get_point_cloud(
import numpy as np
import open3d as o3d

my_camera = Camera.from_robot(robot=machine, name="my_camera")

data, _ = await my_camera.get_point_cloud()

# write the point cloud into a temporary file
Expand Down
2 changes: 2 additions & 0 deletions src/viam/components/input/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ async def trigger_event(
"""Directly send an Event (such as a button press) from external code

::
my_controller = Controller.from_robot(
robot=machine, name="my_controller")

# Define a "Button is Pressed" event for the control BUTTON_START.
button_is_pressed_event = Event(
Expand Down
2 changes: 2 additions & 0 deletions src/viam/services/motion/motion.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ async def stop_plan(

::

motion = MotionClient.from_robot(robot=machine, name="builtin")

# Assuming a `move_on_globe()` started the execution
# Stop the base component which was instructed to move by `move_on_globe()`
# or `move_on_map()`
Expand Down