We combined a MU Smart Eye with an Edison programmable robot to create a robot that can detect and 'fire' at a ball and can follow a pen. This provides a fairly inexpensive way to explore how robots can make use of computer vision technology.
We've previously reviewed both the Edison Robot and the MU Smart Eye. Both of these tech toys use infra red in interesting ways.
Edison is a LEGO compatible mini robot which can learn remote control commands from existing remote controls by driving over a bar code and receiving a code.
MU can control existing remote control toys such as the HEXBUG Spider by sending them IR commands using channel 1.
So, I thought I'd have a go at getting Edison to respond to HEXBUG spider commands and then let MU control it using its HEXBUG Spider ball mode.
In ball mode the HEXBUG spider rotates right until it spots a ball then it fires at it (with light and sound effects) and sometimes follows the ball if it moves.
Programming Edison to respond to the HEXBUG Spider remote
First I programmed the Edison Robot to respond to the HEXBUG remote control. The MU seems uses left, right, forward and back commands in this mode so I programmed Edison to respond to them using the bar codes for forward, backwards, turn right and turn left. I checked that I could control Edison with the remote control from the HEXBUG Spider.Mounting MU on Edison
Next I mounted MU on top of Edison using a Velcro dot. MU certainly controlled the Edison but by default it moved too far and turned too far in one move. Partial success. This proved that MU could control Edison via IR commands.Programming Edison with custom behaviours for the IR commands
Edison can be programmed to have custom responses to remote control commands so I did some coding. I wasn't familiar with this aspect of Edison so first I made a program that just played different musical notes when a remote control command was pressed. The barcodes I had used to program Edison corresponded to the #0, #1, #4 and #5 codes.It doesn't really matter which codes you use with Edison as long as you teach them to Edison with the buttons on the HEXBUG remote control and know which ones you have used.
Once I could see Edison playing my tunes in response to the HEXBUG remote I added in movement, just guessing at the timing initially. I used some balls from the awesome Bounce-Off Rock'n'Rollz game which MU seems to like. It worked! Well at least Edison was clearly responding to MU's IR commands. The timing was better but still not good enough.
Here's look at one branch in more detail:
- if the remote control command is #5 (turn left)
- set the motors to turn left
- play a particular sequence of beeps
- wait for a small amount of time
- then turn the motors off.
This makes Edison turn slightly to the right when it receives the turn right remote control code (#5). MU sends this command when it wants the HexBug (or Edison) to turn to look for a ball.
This worked a bit. I was definitely getting closer.
Fine Tuning
It seems to work! It certainly turns to find a target. And sometimes it follows a moving target. It behaves in a similar way to the HEXBUG anyway. I don't think I've completely understood the behaviour. Both robots occasionally go backwards but I can't reproduce this reliably.
I'm sure I could fine-tune the behaviour. The good thing about working with Edison is that you can control what happens when you get an IR command.
Line Following Mode
Edison can already follow lines with it's light sensors but MU can help Edison to follow other objects. With the same program Edison can follow a brightly coloured pen or even a finger.
We really need to get a new model of Edison with more accurate motor control to get the best results.
We really need to get a new model of Edison with more accurate motor control to get the best results.
Human Mode
You can also use this approach to get Edison to react to a human face by putting MU into Human mode. Because Edison is programmable you can create different behaviours like adding LEGO arms to Edison that wave when they see a human. I think we'll try this next.Verdict
MU + Edison offers an interesting way to add computer vision abilities to a low cost programmable robot.
It's a really interesting way to explore computer vision. You end up thinking about what MU can see and how Edison can move to help MU out and how it should react to what MU detects.
Edison can react to up to 8 different remote control codes so there's actually scope for MU sending different commands in a variety of situations, but we'd need different MU firmware for that.
MU is available direct from Morpx and on Amazon.
And they're both orange which looks pretty cool :-)
It's a really interesting way to explore computer vision. You end up thinking about what MU can see and how Edison can move to help MU out and how it should react to what MU detects.
Edison can react to up to 8 different remote control codes so there's actually scope for MU sending different commands in a variety of situations, but we'd need different MU firmware for that.
MU is available direct from Morpx and on Amazon.
And they're both orange which looks pretty cool :-)