Robot Tracking at the Hardware Meetup

Tonight we did some robot tracking at the hardware meetup. This is all part of the “Robot Rugby” thing we are working on. Brian and I set up our cameras and got to work. Brian is reading QR codes from the top of the robot, I’m trying to find out if I can get position and orientation from two lit pixels on top of the robot.

We set up the supports (with copious duct tape) and started playing. Tests seem to indicate that I should be able to detect only the pixels on the robot by turning down the gain on the camera so that only very bright lights show up. Lots of work to do here, but we are making progress.

Buying overhead camera supports

As part of our Hull Pixelbot Rugby effort we need some supports for the camera that we will use to track the robot player positions. Searching for “camera supports” doesn’t work. But after a bit of bouncing around Amazon I came across the above. It’s supposed to be used by photographers to support backdrop cloths, but it provides exactly what we want, a portable means of hanging a small camera over a playfield. The price is very nice too. And I might even use it for photography.

Making QR codes from Python

I’m trying to create the game of robot rugby. As you do. I’ve no idea how the game mechanic will work. My plan is to rope in some folks at the Hardware Meetup to try and work out the rules.

Anyhoo, one of the things that we are working on is some way of tracking the robots around the playfield so that each robot player can know where it is. Brian has been working on some code to track things by means of QR codes and so I said I’d make some “rugby hats” for the robots with QR codes printed on them. So I needed to get and print some QR codes.

It turns out that making QR codes from a Python program is really, really easy. I found this library which works a treat.

import qrcode
for i in range(1,25):
    qr = qrcode.QRCode(
    version=1,
    error_correction=qrcode.constants.ERROR_CORRECT_L,
    box_size=5,
    border=4,
    )
    text="Robot"+str(i)
    qr.add_data(text)
    qr.make()
    img = qr.make_image(fill_color="black", back_color="white")
    filename = text+".png"
    img.save(filename)

This will make 24 labels that will just fill an A4 page in a word document. I printed them out onto label paper and stuck them on some pixel shades that I’d printed.

Building Robots at GSK

We’ve taken “Build a robot in a day” on the road and today we spent a lovely day today down at GSK in Weybridge. Things went so well that at one point we thought we might have to rename the course “Build a robot before lunch”. Everyone got their robot moving around and interacting with them.

If you were on the course (or are just interested) you can find all sample programs here.

If you want to work further with the Arduino I’d recommend that you search Amazon or ebay for “Arduino Kit” and buy something that costs around 25 pounds or so.

Update:

I’m back home now and I’ve put a few pictures of the event on Flickr here.

Hull Pixelbots and the wrong kind of quotes

One of the downsides of thinking “I’ll use my phone for all my pictures” seems to be that don’t take any photographs at all when I should. This is how it was today at the Hull Pixelbot talk I gave at the university. However, the talk went well with a very appreciative audience.

I hope I didn’t come over as too obsessive compulsive when, during the session I started to fret about the use of the wrong kind of double quote in some of my sample code. Stupid “Smart Quotes” had stuck its fingers into my text and broken it. I hate it when I see it in other folk’s stuff, and I usually try to make sure that my quote characters are the right stuff.

For those of you who’ve no idea what I’m on about, its the “ in the top line should be vertical double quotes like the rest of the sample. It’s important to me, but perhaps I should get out more…..

For connoisseurs of quotation marks you can find the slide deck here.

Fantastic Bugs and Where To Find Them

On Thursday, as we were building robots I came across one of the most amazing bugs I’d ever seen. We’d reached the point where the robots had been built and they were connected to the computer. My HullOS Editor program lets you write programs and send them into the robot for it to run them. But something weird was happening.

The editor was displaying things that it should not. It seemed to be duplicating program code that had been typed in. And nothing was working. It was very confusing. I thought back to the time I spent the day before testing the code and had to confess that I’d never seen anything like it before. In fact, if I’d set out to write a program that was doing what the editor seemed to be doing, I was not sure how I would do it.

After a bit of head scratching I found the fault. And it wasn’t software. The robot has a speaker - more of a buzzer actually - which makes all kinds of irritating buzzing noises. Normally you’d connect a speaker across an output pin and a ground connection so that when the voltage on the pin goes up and down the speaker is driven in and out.

However, the Arduino doesn’t have many ground connections, and the ones it does have are all in use by the pixel and the distance sensor. So I use this rather clever (for me) trick of putting the loudspeaker across pins A0 and A1. If I make sure that A1 is always at the low logic level I can produce a potential difference between the pins by setting A0 high. This drives the speaker and sound comes out. I’m happy to trade a signal pin I don’t need for a ground connection.

This is probably deeply dodgy in electrical design terms. But since it works I think I have the last laugh on this one. Actually, if I had the time I’d experiment with swapping the ground level from one pin to the other while I play the waveform and seeing if this means I can make louder sounds by driving the speaker in and out, not just out.

Anyhoo, enough about my dodgy cleverness. Turns out that the fellow making the robot had wired his speaker incorrectly. Rather than wire the speaker between pins A0 and A1 he had wired the speaker between pins D0 and D1. These are two data pins on the Arduino which are also used for the serial port that is connected to the host PC. One of the pins is the data going into the Arduino and the other is the data coming out of the Arduino. Linking these pins together has the effect of sending every character that the PC sends to the robot right back to the PC again. Hence the terminal madness.

We put the speaker on the right pins and it worked a treat.

This illustrates one of things I said at the start of the robot building. Making robots is both fun and tricky because the combination of hardware and software makes for very “Interesting” misbehaviour.

Making Hull Pixelbots

We were in Hull University Robots Lab

Had a lovely day making robots today. I was working with Tristan and Mac, who were visiting the university from Scarborough, taking part in a work experience program. I had to robot kits all ready and a set of nicely printed instructions for them to follow.

They spent the morning building the robots and the afternoon programming them. It was great fun, and by the end they had left the suggested exercises well behind and were heading off in all kinds of interesting directions, which was wonderful.

It’s a couple of years since I stopped working at the university and it was lovely to see the campus looking so nice. There seem to be a lot more buildings than I remember and the Computer Science and Engineering Department have acquired some lovely new toys.

Rob at Ron Dearing UTC

Despite arriving a tiny bit late, I had a great time at the evening event at Ron Dearing UTC today. A whole bunch of folks came to see me to talk about technology and I showed off some Hull Pixelbots, my silly goggles and the prototype air quality sensor that we’re working on over at Connected Humber.

Of course, I totally forgot to take any pictures at the event. Silly me. That’s why there’s a rather splendid picture of Whitby pier at the top of this post instead of anything relevant to the night.

Anyhoo, I talked to a bunch of folks and gave out a bunch of advice. Summarised thusly (posh prose)

  • If you’re into computing, start playing with the Arduino device. It’s cheap to get started (much less than a video game) and extremely creative. Buy a Sintron Arduino kit (search ebay or Amazon for “Sintron Arduino” to see a selection of kits. The one that is around thirty pounds is good value. If you want to start cheaper, come along to a Connected Humber event (we have them on the first and third Thursday of the month at c4di starting at 6:00pm in the evening). We’ll sell you an Arduino and some hardware for five pounds and give you some things to do with it. You can find out more here.

  • Start learning about 3D design. Lots of people that I spoke to were already doing this. The ability to think in 3D will stand you in good stead whether you go into fields ranging from video games to product design. There are lots of free packages you can use, I quite like FreeCad, although it can be a brute to get to grips with. If you’re a programming type, take a look at OpenScad. If you want to use a free, professional level, tool take a look at Blender. It will really make your head hurt, but you can do awesome things with it. Take a look online for howto videos for these tools. If you don’t like the ones that you find, make some better ones of your own.

  • Which brings me to my third point. Lean to write and talk. When you start doing something, start writing about it too. Put your writings into a blog, a personal diary or a log. I don’t mind. The important thing is that you do this. I made the point lots of times that you can learn a good living, and have fun, as a programmer. But if you also have the ability to write well and are good at communicating your ideas this makes you much more useful and interesting to employers, getting you even more interesting and rewarding things to do. So you should work at getting those skills. Deliberately do things that take you out of your comfort zone. Practice talking to people (networking is a big part of success) and try to force yourself to speak in public. Trust me. It really pays off.

By the end of the evening my voice had just about worn out, as had the batteries in the robots. But it was great fun. And then I went home and had bananas and custard for supper. Such fun.

Hull Pixelbot at The Digital Awards

I'm totally gobsmacked (a great phrase) to discover that the Hull Pixelbot has been made a finalist in not one, but two categories in the The Digital Awards 2018.  

"The little robot from Hull" is up for an award in the "Best Hardware" and "Best Use of Technology within Education" categories. Awesome stuff. Thanks so much folks. The awards ceremony is in September.

There's some impressive competition in the categories, including some from companies that are also based at c4di. I'm really pleased just to have made it as a finalist. If you want to read what I wrote about the robot, you can find my entry description here

Robot Rumbles at Dot Net North

Turns out that Dot Net North is a great place to go and talk about robots. It's in Manchester and they run regular events about technology. Pete had offered me a chance to take along some Hull Pixelbots and explain that they are all about. Great fun. You can find the explanation here

We had Pizza, and at the end a Robot Carrying Cheese Race. 

A tense moment with the cheese.

The audience was splendid, most things worked (although one of the cheese carrying robots could probably have used some new batteries). 

You can find out about more Dot Net North events here

Hull Raspberry Pi Jam with robots

Well, that was great fun. Spent the morning at the Hull Raspberry Pi Jam. It was something of a "RobotFest". I had my Hull Pixelbots and Coretec Robotics were there with their balloon Raspberry Pi powered balloon busting robots. I was trialling a new idea I've had, called the "Robot Rumble". The idea is that players code up their robot warriors to get as far into their opponents area as possible. You can find the draft rules here

As it turned out we didn't get that many rumbles going, but folks had great fun making their robots do things, including some things I'd never have thought of, which was rather nice. And from the sounds of bursting balloons and cries of victory coming from the other side of the library, fun was being had there too. 

The second part of this post was going to have the title "Three Thing Game Judging Fun". But instead I'd have to use the title "I probably shouldn't have eaten that chicken from the fridge". Number one wife did ask me to check the sell by date but I was confident it was fine. And besides, I'd thrown the package away.

By 2:30 it was turning out that the chicken might not have been that fine after all. And an attempt to "kill or cure" by drinking a can full of "Old English Ginger Beer" didn't have the desired effect. Which meant I had to beat a hasty retreat from the event and head home for a lie down amongst other things. 

Fortunately the effects don't seem to have been too long lasting, which is a good thing as I'm supposed to be driving to Birmingham tomorrow. 

 

Hull Pixelbots at Dot Net North in Manchester next Tuesday

Another Hull Pixelbot event coming up. On Tuesday next week I'm going across the Pennines to Dot Net North in Manchester. You can sign up here.  I'm going to try and crowd source some robot control. And apparently the pizza is really good. 

If you want me to bring my Hull Pixelbots to your neck of the woods (do woods have necks?) then let me know. 

Hull Pixelbot Robot Rumble at the Raspberry Pi Jam on Saturday

Don't forget the Hull Raspberry Pi Jam this coming Saturday at Central Library.  There are going to be lots of robots, including a bunch of my Hull Pixelbots.

I'm going to be testing a new "Hull Pixelbot Robot Rumble" in which two teams of robots face off against each other in a test of programming skills and strategy. Should be fun. You can sign up here

esp8266 wacky wifi

one way to get a screenshot....

This is rather weird. It all started when I got my old Nexus 7 tablet out of retirement. I'm doing some upgrades for the web server for the Raspberry Pi event coming up, and I wanted to use the Nexus to see if the web site would work on an Android powered browser. 

One of the applications on the Nexus is a WiFi analyser that I've used to pick and choose my WiFi channels. When I fired it up I noticed a few strange transmitters which were taking over the spectrum (as you can see above). 

I finally tracked this down to the esp8266 devices that I use in Hull Pixelbots. For some reason, when they wake up, they start doing things on WiFi channels. I've no idea of the precise meaning of this transmission, but I don't particularly like it. It turns out that if you turn off the WiFi before you do anything else (even turn it back on to connect to an access point) then you don't see this. 

I'd love comments from anyone else who've seen this, or has more knowledge of what is going on. In the meantime all my programs now start with:

WiFi.mode(WIFI_OFF);

Talking Hull Pixelbots at the new Hull Makerspace

I stole this picture from Hull Makerspace. Thanks for that. 

Today I got my first look at the new Hull Makerspace. 

It's splendid. It's a huge room full of potential; connected to a bunch of other rooms also full of potential. The stuff they are installing is fantastic, including pottery kilns, a CNC machine shop, a paint booth, wood working, sewing and of course frickin' lasers (not mounted on sharks, that would be silly, but for cutting things with). 

I'd been invited to give a presentation at a Code Club meetup. Code Club is an an organisation that does just what it says on the tin. It sets up code clubs, usually as an after school activity, where kids learn the basics of coding. They're getting going in Hull, but they could always use more help - contact them here for more

We also had a talk from Matthew about his efforts putting a Raspberry Pi in the sky, Becky on why we should all be taking part in Code Club and Jon, giving details of the next Raspberry Pi Jam in Hull. 

When it was my turn I showed off the new Hull Pixelbot in perspex,talked a bit about HullOS and we had some fun making robots move via Azure IoT Hub and MQTT. Such fun.

Thanks for the invite folks, I look forward to seeing a lot more of the makerspace in Hull. 

Talking about robots for the children's university

Showing of "Transparent Terry", one of the robot crew

We had a bunch of folks from HEY Children's University come and see us at c4di today. It was great fun. I was showing off how we can put programs into robots to tell them what to do, and that a program is just something that takes in something (a distance from a distance sensor)  does something with it (run away if the distance is less than 100 mm). 

They were a great audience and I hope that a fair few of them get into software, robots and other stuff that can change the world. 

I said I'd put some links on here to resources. You can find out about the Hull Pixelbot (the robot I was showing off) here. You can find resources to build your own Pixelbot here. If you really do want to build a robot, come along to our hardware group meetings (there's one next Thursday). Sign up here