f-log

just another web log

07 Jul 2017:
joes robot challenge left bias
I knew the code for Joes Robot Challenge was little be rushed and messy. Certainly not up to my usual standard. But still, I did not expect it to have critical NOOB bug in it.

At the Fete I noticed the robot often went left even though from what the user had selected it should be going right. At first I thought it was the power cable causing a small amount of drag. But as I watched more carefully and tried my best to not let the cable be involved I realised something was wrong.

I had noticed before there was a bias in the simple motors of the Alex s Cam Jam Robot kit, but we weren't using that. Sad truth is the code kept over writing the users value with 10 as I reused the variable.

It was an easy fix just to use unique variable names throughout the code.

https://github.com/davisjoe/joesrobotchallenge
07 Jul 2017:
erm ftp or sftp 1and1
My ftp access has finally stopped. I thought lftp would automatically detect sftp but it does not and I think it is because 1and1 are still running a ftp server but not letting people connect.
04 Jul 2017:
joes robot challenge
Joe's Robot Challenge is over!

It was hard work from everyone involved but I think we pulled it off.
Crew photo from Joe's Robot challenge 2017

The idea was to create a Robot and Raspberry Pi themed experience that would raise money at the school fete. Joe had been bugging me for more than two years to get involved with the fete. First year he was too young, we had no preparation time, then last year we were dealing with Sarah's leg.

This year we had lots of prep time and brainstormed the idea of a very simple interface to a destructive robot. The user would be required to press a single button to set the direction and then the speed of the robot that would then knock over empty drinks bottles.

I had a cool Raspberry Pi battery that screws onto the bottom of the Pi, but sadly, it did not have the power to supply the Pi when connected to HDMI. Well, it did but the power warning icon keep appearing. As I had worked with Pis in the early days, where power problems often corrupted SD cards irreparably, I was overly cautious.

WINGONEER Lithium Battery Pack

Robot photo from Joe's Robot challenge 2017

The robot is from the
CAM JAM kit 3
that was unbelievably cheap at the Raspberry Pi Birthday sellers market back in 2016, due to no P&P. Consisting of just motors and an interface board, it plugs into the Pi and once powered via AA batteries, it just works. The Cam Jam kits also come with other components like an Ultrasound distance detector, but we have never tried that.

The code is worryingly short. Just tell the Pi you are using specific GPIO pins and set two pin states for each wheel. GO and FORWARD/BACKWARDS, that's it! For steering/directions it is all about how long each wheel does what.

https://github.com/davisjoe/joesrobotchallenge/blob/master/motortest_forward_one_second.py

I already had the cool looking button

The last piece of the puzzle was the graphics/interface. I had done some work with PyGame before so we went with that. We just setup the button polling code to run during frame redraws.

It took a while to put it all together and I am not sure it is very "good", but on the day it worked enough that everyone trying it had fun and we raised a load of money!

I did want to have Joe's photo in the game but I could not see a way to do it that did not kill the frame rate, so it only appeared on the start screen.

Robot workbench photo from Joe's Robot challenge 2017
The juggling balls made an ideal stand to hold the robot steady when testing the motors ;) We originally used a standard Raspberry Pi Model B+ v1.2, but swapped for a quad core Pi 3 for improved development experience.

The biggest problem on the day was the wind knocking over the up turned water bottles. The fix was to tape sweets into the necks to lower the center of gravity.
All the code is on GitHub.


https://github.com/davisjoe/joesrobotchallenge

loading results, please wait loading animateloading animateloading animate
[More tags]
rss feed

email

root

flog archives


Disclaimer: This page is by me for me, if you are not me then please be aware of the following
I am not responsible for anything that works or does not work including files and pages made available at www.jumpstation.co.uk I am also not responsible for any information(or what you or others do with it) available at www.jumpstation.co.uk In fact I'm not responsible for anything ever, so there!

[Pay4Foss banner long]