#Trying to control Viam's in office robot to move in a square, using python

1 messages · Page 1 of 1 (latest)

sterile pollen
#

I am at home, and did the "try viam" route. I was able to see the rover on camera, and watch it move as i used the arrows on the keyboard.

I wanted to try to write code in Python to control the Viam-connected robot, Viam Rover, so I thought that this tutorial was the way to go:
https://docs.viam.com/tutorials/get-started/try-viam-sdk/
I did the steps found here https://python.viam.dev/ to install the Viam Python SDK (including the installing from the source steps to be sure)
Then I try to configure the client application at app.viam.com.. I get to the part of the Setup tab where I try to start the Viam-server on my mac. When I run:
viam-server -config ~/Downloads/viam-bitter-haze-main.json
the server starts but then I get these errors (in screenshot attached).

Any idea what I am missing? Or are there steps I should be following that I am not that come to mind? Thank you!

Viam Documentation

Use a Viam SDK to program a Viam Rover to move in a square.

tribal surge
#

Hi @sterile pollen - no need to run viam-server on your laptop in order to interface with the rover via the python SDK. The viam rover is running viam-server and knows how to interface with the components and services that make up that robot.

#

The error you are getting is your laptop saying "hm, these components and parts don't exist here!"

#

I can see how this would absolutely be confusing in the "Try" experience, since the part of configuring the robot and setting up viam-server is already done ahead of time...

sterile pollen
#

Hi Matt! @tribal surge

#

ok got it thanks...

#

I'm still a little stuck and don't want to spend time on the wrong things ... any chance you could chat for a tine sec on the phone or on zoom? just wanna make sure I get up and running the way I am supposed to!

tribal surge
#

Hi Betsy, I will DM you

sterile pollen
#

After talking to Matt, we think there may actually be an unexpected bug happening so wanted to document it:

  • I had gone down an irrelevant path with whole trying to set up viam-server on my laptop (LOL),
  • but once we sorted that out and I went back to doing the real intended instructions on my machine, I still had a problem that was unexpected to Matt as well:
  • I attached a txt file w the whole terminal output showing the error, and here are some highlights:
  • Unable to establish a connection to the robot. Ensure the robot is online and reachable and try again.
  • grpclib.exceptions.GRPCError: (<Status.UNIMPLEMENTED: 12>, 'unknown service viam.robot.v1.RobotService', None)
#

(I just updated the file to include all the info for the most recent error a second after posting just fyi)

tribal surge
#

Thanks @sterile pollen - note that I was able to execute the code sample successfully from my laptop, the same code did not execute successfully from Betsy's laptop. We confirmed we were both running the latest python SDK (0.2.19) and had compatible python versions

distant magnet
#

Hello @sterile pollen and thanks for all back-and-forth @tribal surge ; I'm taking a look now and trying to reproduce locally