The Tank of Autonomous Movement


#1

I bought an OSEPP Tank Mechanical Kit at least six months ago and built it out, I just slowed down a bit on that since I didn't have any Arduinos and was having difficulty getting the Raspberry Pi to control the servo on that.

After my recent success on the BRB project, I decided that doing a little more Arduino wouldn't hurt me. I recently then purchased an OSEPP Arduino Mega 2560 R3 Plus board as well their 6612 Motor Shield.

Arduino-based Tank with Raspberry Pi—based Steering

Given that this Arduino doesn't have wi-fi, Ethernet nor Bluetooth support out-of-the-box, it's a little difficult to control it externally unless it's tethered. There doesn't appear to be the robustness of things like you'd find in the Raspbian space like webcams.

So I thought I'd marry the two together. I'll use a dedicated Raspberry Pi Zero W with a webcam on the front of the tank with code to make determinations about navigation, sending those commands via GPIO serial over to the Arduino to then convert this into motor driving activities. I think ultimately, it would be my preference to lose the Arduino stack completely but I'm sure this will work out quite well.

The Raspberry Pi Zero W gives me an inexpensive means of communicating into the tank, I've got a quick-and-dirty mjpg_streamer available, it's got wi-fi, I can easily write a Node-based service for adjusting things.

[x] tank platform built with six AA batteries to run the stepper motors and electronics, removing the servo motor and mount
[x] printed part to hold the tank for programming purposes while it's tethered
[x] OSEPP Mega 2560 R3 Plus Arduino board with 6612 Motor Shield, minimal Arduino programming so far
[x] Raspberry Pi Zero W with Pi cam and mjpg_streamer loaded, Bluetooth disabled and hardware UART pointing to /dev/serial0
[x] wiring diagram Fritz'd
[x] "hello world" going over serial at 2400 baud from Pi to Arduino (GPIO to GPIO) which was a lot harder than you'd think
[x] not using a logic-level converter since this is one-way traffic from 3.3V to 5V
[x] add Node.js to the Raspi
[x] create some sort of serial interface for communicating steering/speed/direction instructions
[x] write a webserver for serving up, say, a mobile interface to stream the camera output and to allow driving the tank from there
[x] work up another program on the Raspi to interpret static images and to translate these into steering commands for autonomous driving, work-in-progress
[x] design/print/assemble some plastic for the rig

Repository
Blog


#2

Looks like I'll be at the track on Saturday with the tank. I'll get a chance to drive around, take some good-quality images from my own camera and then tighten up the autonomous-driving code.