Skip to content

Latest commit

 

History

History
20 lines (16 loc) · 1.74 KB

README.md

File metadata and controls

20 lines (16 loc) · 1.74 KB

viam-python

Try out the Python Viam SDK and use code to control a robot in our lab!

Get Started

  1. Access this repo in a web browser at: https://github.com/hexbabe/viam-python.
  2. Open a new GitHub Codespace using this repo as a template by clicking the green Use this template button, and selecting Open in a codespace.
  3. In the Terminal pane at the bottom of the editor, run pip install viam-sdk to install the latest version of Viam's Python SDK.
  4. In a separate browser window, head to Try Viam, start a new session by clicking Try Now. If you haven’t already, you will need to create a Viam account. Wait for configuration to complete, then click Try My Rover when ready.
  5. In the Control tab, find the viam_base control panel, and enable the cam and overhead-cam:overheadcam cameras. You should see live feeds from its forward-facing webcam, as well as an external overhead camera.
  6. Next, switch to the Code sample tab, and enable the Include secret toggle.
  7. Copy the location secret, (the payload) shown in the Code sample tab and paste it between the single quotes for SECRET_FROM_VIAM_APP in drive.py.
  8. Similarly, copy the robot address within RobotClient.at_address() shown in the Code sample tab and paste it between the single quotes for ADDRESS_FROM_VIAM_APP in drive.py. Only copy the hostname, ending with viam.cloud.
  9. Return to the Terminal in your GitHub editor window, and run the Python code:
python drive.py

You should see the robot move in the controls tab of the Try Viam app!