|
|
|
|
||||||
Contents
Links and
Resources
MyBots
LookBot (mark 2) – a robot that looks around to plan its next
move
The LookBot uses its rotating sonar head to look out for
obstacles and then reacts accordingly.
I have programmed it in RobotC after becoming very frustrated with the
NXT-G system. Here
is the code as it stands at the moment. I have a method for keeping the robot going straight
implemented in the task “FullAhead”.
There may be a better way to do this.
It keeps track of the rotation sensor of each motor and if one starts
overtaking the other it lowers the power for a bit. In order to get the robot to look straight ahead, I had to
allow for backlash in the gear train of the motors. See the task Radar to see how this works
out (current version still has this in, but doesn’t really need to look
straight ahead any more). As far as the behaviour goes, it tries to do the sensible thing at all times and heads for likely openings. There is some checking for radar motor stalls to help it out of a tight corner, but it does get stuck at times and due to its rather top-heavy design can fall over quite easily. If it can’t get going ahead for a few times, then it tries to back up and rotate. |
||||||||
|
|
|
|
||||||