First of all work got really busy. I’ve been promoted a few times and now head up a technology division.
Secondly, I got into ultra-running in a big way and have successfully completed some epic and beautiful races –a few of my favourites - the Kalahari Augrabies Extreme Marathon, the Marathon du Mont Blanc and the Swissalpine Davos K78.
Thirdly, I’ve created a scarily intelligent AI called Athena that will be coming to a cloud near you very soon.
Fourthly, I decided it was time to give my AI creations a physical form, so have started dabbling with robotics, and that is the subject of this post.
Yellobot is a means to an end – I much prefer writing code than bolting together bits of hardware. But with my electronics training, it turns out I still remember a thing or two. I wanted to create a platform for an AI to discover its surroundings and start to make intelligent decisions based on stimuli.
The foundation of Yellobot is simply four motors bolted to some acrylic sheet, a battery, and a Sabertooth motor controller. To give it some basic intelligence, I built an SRF05 ultrasound array and added an Arduino Uno microcontroller. For future expansion, there’s also a mini ITX motherboard, but that’s currently idle.
Next step is to hook up an Xbox Kinect to that motherboard for some long range vision and start to implement a real simultaneous localisation and mapping algorithm.
#define Min(x, y) (((x) < (y)) ? (x) : (y))
const float sideRatio = 1.7;
const int minDist = 40;
int lockSteer = 0;
AppendVal(distArrayL, readSensor(initL, echoL));
AppendVal(distArrayM, readSensor(initM, echoM));
AppendVal(distArrayR, readSensor(initR, echoR));
int distL = GetVal(distArrayL);
int distM = GetVal(distArrayM);
int distR = GetVal(distArrayR);
int speed = Min(Min(distL * sideRatio, distM), distR * sideRatio) + 80;
if (speed > 140) speed = 140;
else if (speed < 90) speed = speed / 2;
int steer = 90;
if (distM < minDist)
if (lockSteer != 0) steer = lockSteer;
if (distL > distR) steer = 60;
else steer = 120;
lockSteer = steer;
if (distL < minDist && distR < minDist) steer = 90 + (distR - distL);
else if (distL < minDist / sideRatio) steer = 120;
else if (distR < minDist / sideRatio) steer = 60;
lockSteer = 0;
int readSensor(int initPin, int echoPin)
unsigned long distance = pulseIn(echoPin, HIGH) / 58; //convert to cms
void AppendVal(int array, int val)
for (int i = 0; i < 2; i++) array[i] = array[i + 1];
array = val;
int GetVal(int array)
int total = 0;
for (int i = 0; i < 5; i++) total += array[i];
return total / 5;
#define echoL A5
#define initL A4
#define echoM A3
#define initM A2
#define echoR A1
#define initR A0
#define pinSpeed 5
#define pinSteer 6