torsdag den 13. september 2007

The Borg is watching you

The goal for the lesson 2 exercises is to experiment with the ultrasonic i2c sensor. In this session we will play around with an obstacle avoider program to get the feel of the sensor; and also create a wallfollower which includes upgrading our Borg warrior with new modifications.
As always the ultimate goal is conquering the world. Resistance is futile!


Experimenting with the ultrasonic sensor
After blessing the Borg with the sensation of vision we started experimenting with the sensor.
The first thing we could conclude was that the distance of the robots vision was quite limited, and that the granularity of measurements was quite crude. Especially with distances less than 10 and greater than 180'ish. Furthermore the angle at which the sensor was turned was crucial. If looking at a wall in an angle greater than 30'ish degrees it would tend to not see the wall at all or introduce alot of "jitter" in the measurements.
We also noted that the polling interval was somewhat limited, meaning that rapid movements will most likely go undetected.

Notes on the Avoider program
After initial experiments with the Borgs vision we wanted to take it to the next level. We uploaded the avoider program and ran a few tests with it. It is obviously quite a rough movement mode for our Borg, but we noted a few interesting things.
First off the robot would just run straight and then stop when within a set distance of an obstacle. But since this is the way it was designed it was quite expected. A notable thing it did however was driving slower as it got closer to an obstacle coming to a slow gentle stop. Almost like a Borg Cube stopping at a red light. This ensured that we would always stop at the desired distance.
If we however tried to tweak the robot to stop faster or have no "gentle stop" at all, it was possible for it to miss the stopping point and stop closer to the wall than desired.
All in all this form of simple feedback control is good for initial testing, but of course this will not do if we ever hope to conquer the world.

Look, a wall!
Next we examined the wallfollower program from Philippe Hurbain. We noted that it maintained quite a few variables and was rather "advanced.

We then continued to build a rotating station where we could mount the eyes to. This gave us better opportunities to play with different angles when looking at the wall. We will make sure to grab a picture of this new contraption in the near future.
We then proceeded to make a simple 3 state wallfollower program ourselves, partly inspired by the Philippe Hurbain algorithm and we managed to actually follow a wall consistently.
Things to note however, was that the angle in which the eyes were looking mattered hugely. If looking to straight at the wall it would just continue to turn right and drive around in a circle, since the distance it perceived did not change notably when turning. If the tower was turned in an angle at the previously examined 30 degrees however, it would loose sight of the wall or the granularity of the readings would vary too much.
We also experimented with the turning speed and noted a few things.
First off if it is "either one or the other" wheel turning, the turns would be too great and it could not follow the wall. If however we made "gentle" turns it would sway slightly along the wall in various distances, but still follow the direction without loosing sight of the wall or bumping in to it.

This comes at a cost though, since it means that it can not eg. detect a corner and turn sharply around it. The wall will have to be relatively straight for the Borg to follow it.
If we had had the time we would have introduced several "distance conditions" as in Hurbain's program, so that we could get the best of both worlds in a controlled way. It would be interesting to make it so that it could navigate a maze or find its way around a crowded room. This would require some pretty severe upgrades to the program, but who knows - the Borg might yet evolve into an even greater force.

Follow the Borg next week, where it will yet again unleash it's mighty powers in attempt to take over the world. . .

Ingen kommentarer:

Bidragydere