So in December, I received my Spirit Rover from Plum Geek Robotics for supporting their Kickstarter Campaign. This is a great kit for learning robotics, embedded computing, and micro-controllers. Well done, Kevin & company at Plum Geek.
Erik’s completed kit of the Plum Geek Robotics Spirit Rover
Between October 2000 and February 2004, I worked on the Entry, Descent, and Landing team for Spirit and Opportunity at the Jet Propulsion Laboratory (JPL), and I had to support Kevin’s kickstarter when I saw it. I’m so elated to see the work we did at JPL being used to build hands-on kits to inspire future generations of roboticists. Note that Opportunity is still kicking on Mars after sol 4970 after 45 kilometers of driving! Go Oppy!
Back to Kevin’s kit, though. For those of you who are building it, make sure you follow the instructions VERY carefully — read through them in their entirety before you start, and read each step completely before embarking upon doing that particular step. There are subtle details that matter.
The pre-loaded software is an Arduino sketch that has three different modes, and the robot makes no use of the Raspberry Pi sandwiched inside the robot. My robot came with a vanilla Raspbian Jessie install on a 16GB card, which I upgraded to a 128GB card with Raspbian Stretch.
I changed the default user (pi) password, and used raspi-config to set up SSH, VNC, I2C, SPI, and Serial interfaces, as well as enable the raspberry pi camera.
I want to be able to develop robot python scripts and C code with openCV, which uses the cmake build process. I figured having the cmake-gui might be handy, so I installed it as well as following installation dependencies for OpenCV using apt-get. I then grabbed the 3.4.0 tagged branch from git for OpenCV because the package manager for Raspbian Stretch only has opencv 2.4, and I wanted the latest. So I then used cmake to build the source I obtained from git. The process looks like this:
sudo apt-get update sudo apt-get upgrade sudo rpi-update sudo reboot sudo apt-get install build-essential git cmake pkg-config \ libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev \ libavcodec-dev libavformat-dev libswscale-dev \ libv4l-dev libxvidcore-dev libx264-dev libgtk2.0-dev \ libatlas-base-dev gfortran python2.7-dev python3-dev python-pip \ python-numpy python-scipy python-picamera cd ~ git clone https://github.com/opencv/opencv.git cd opencv git checkout 3.4.0 cd ~ git clone https://github.com/opencv/opencv_contrib.git cd opencv_contrib git checkout 3.4.0 cd ~/opencv mkdir build cd build cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D INSTALL_C_EXAMPLES=OFF \ -D INSTALL_PYTHON_EXAMPLES=ON \ -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \ -D BUILD_EXAMPLES=ON .. make -j3 sudo make install sudo ldconfig
Then I tested it on the Spirit Rover using example code from here. The following is a scrot screen grab of a streaming moving coming from the Raspberry Pi camera into OpenCV and displaying it to the screen in an OpenCV window:
Success! I had to add
to the example scripts at the link above to make the images properly oriented due to how the camera is mounted on the Pan/Tilt head of my Spirit Rover.
So far, so good! Now to tackle i2c and spi comm to the other ICs on the custom SpiritRover board… but that’ll be a later post.