I've decided that today I'm going to start the long over-due corrections on my journal paper so I can submit it to the almighty editor for publication.
As promised I did play around with the lego robots on Friday, and they are a joy. The API is pretty good and whilst the compiler is flaky, (structs are not your friend) I really think that they're capable of being standalone research machines not just prototypes.
I managed to implement a basic "learning", (not really learning, it just looks like it) behavior that is loosely based on something I saw people do in Reading once.
1) I use the sensor data to classify the current situation into one of 10 different situations
- Freespace
- Wall to the left
- Wall to the right
- Wall in front of you
- Wall behind you
- Corner (front left)
- Corner (front right)
- Corner (back left)
- Corner (back right)
- Collision (any direction)
2) The robot has a randomly generated rule book that says what signals to pump out to the motors in each situation, (I only allow -100 to +100 in increments of 10). To help things along a little, (and to cheat slightly) I tell it that in freespace it should go (80,80) and in a collision it should just stop. I also have a rule that says it is not allowed to be at a complete stop in any case other than collision.
3) The robot runs round its pen, and if it ends up in a collision, it looks at the last state it was in before it got there and moves the motor signals by a random amount between +-50, (again it can't be in a complete stop.)
4) Then I let the little bugger free! When it enters "collision" mode, (closer than 10cm to a wall) it stops and I pick it up and put it back down in a safe part of the pen. After a while it never collides with walls and if you introduce new objects to the pen, it happily avoids those too.
It's a nice little demo that really quickly finds a solution that allows it to "survive" in its limited environment.
So, my geeky friends I have a new challenge for you. Any, (vaguely sensible) ideas about what my next robot project should be? You come up with a concept and I'll have a bash at implementing it. Try to make it simple, but interesting. If you want to supply example code, just email it to me and I'll publish it, along with a video/plot of the wee beasty doing its thang. I can't guarantee when my schedule will let me do these things, but I like playing with this stuff as it reminds me that I am actually doing a PhD in robotics, not just doing maths and writing reports that nobody will EVER read, (from my last meeting that includes my supervisors.)
Ooh - the stuff we have to play with per robot is:
- up to three motors variable speed, variable direction motors, with encoders
- up to four sensors which can be:
- sonar range sensors
- light sensors
- sound sensors
There is also a camera and a couple of infrared sensors, but I've not got those working yet. I'm not sure how hard it is.
The robots can also communicate to PCs and other robots over bluetooth.
Enjoy!