I have the Sphero RVR all set up with the Sparkfun Advanced Autonomy kit.
Everything seems to be working, and I can drive using the WASD keys while watching the RPi camera stream.
However, the examples are all clearly limited, and I want to go further. In order to do this, it seems like I really need to set up a better development environment. (Editing the examples in nano over SSH to the RVR isn’t the best.)
It seems like a good way to do this is to build a github repo for my own programs, edit code on my computer using PyCharm or Visual Studio Code, commit and push changes, and then pull them on the robot.
Does this make sense? Any tips on setting it up so that the IDE on the computer side is aware of the various SDK calls?
I feel like RVR + autonomy kit is a powerful combo, but just getting set up to write code for it seems like a hassle so far.
I am a total noob and doing my best to learn, can you point me in the right direction on what I need to connect to a PC so I can see the camera and drive it? Iv’e tried Ubuntu and used that to config the wifi file, I’ve fiddled with python on my windows PC but i’ve no idea how to connect to the RVR now the kit is built. Any help would be greatly appreciated.
To be honest, it’s a pretty long-winded process. If you really are just getting started, you should figure out a way to connect a keyboard and monitor to the robot. You’ll need a mini-HDMI to HDMI adapter, and a micro-USB hub.
mini-HDMI cable https://smile.amazon.com/gp/product/B01 … UTF8&psc=1
micro USB hub https://smile.amazon.com/gp/product/B01 … UTF8&psc=1
You should follow the examples in the Sparkfun set up guide AND the Sphero set up guide.
Sparkfun guide tutorials/getting-started-with-the-auto … sphero-rvr
Sphero guide https://sdk.sphero.com/docs/getting_sta … _pi_setup/
When you are done with all that, you should have figured out what IP address your RVR is using. It might be easiest to do this by plugging in a monitor and keyboard.
Use ssh to connect to the RVR at that address.
Then you can start streaming the camera by going to the RPi_Cam_Web_Interface directory and typing ./start.sh
Open a browser on your PC using the RVR IP address, and you should see a video window and four controls for moving the camera.
Go back to the SSH window, ie controlling the RVR directly
Then go to the sphero-sdk-examples directory and start the python virtual environment by typing “pipenv shell”
Then open the projects directory, keyboard-control directory and start keyboard drive by typing “python3 drive_with_wasd_keys.py” or something like that.
You should now be able to drive the robot by pressing the W A S D keys (space to stop) while the video stream shows on a browser window.
Here’s what is bugging me:
The Sphero instructions explain that you should set up a Python virtual environment in order to manage all the various dependencies.
Whenever you want to run a Sphero example, you should do so within the virtual environment by typing “pipenv shell”
However, the Sparkfun examples don’t run in the virtualenv!
For example, to stream the camera view, you need to start the camera service WITHOUT the pipenv, then switch to the sphero directory, start the pipenv, and then you can use the keyboard controls.
If you start the pipenv before the camera view, then the little bit of python code that controls the pan/tilt mechanism throws an error.
It would be great if there were clearer directions for setting up a development environment that incorporates the Sphero SDK + the Sparkfun libraries in a cleaner way.
I have set up a github repo for my own programs, so I can edit on my Mac and then sync changes to the RVR, but something is clearly wrong with all the various libraries and dependencies.
Thank you! This is exactly what I needed direction wise. I’ll plug in the RVR the a monitor,keyboard, and mouse. I really appreciate the help. I wsa able to use examples of Vector SDK on my Win 10 machine using python and was trying that was to connect with the RVR and no luck. Once I am on the Pi zero’s OS I’ll be making progress.
You rock! connected with monitor, keyboard, mouse, also COM5 with hyper terminal but I’m getting a network error, couldn’t communicate wit wpa-supplement, I created a wpa file because none was there? should I delete that file? will the program create the file for me?
If you have a keyboard + monitor connected, type startx to start the GUI and use that to set up the WiFi
Thanks, GUI!!! strange thing is no networks show up in the list.
This is my problem not associated, wlan0 not associated raspberry pi zero