07.18.09
Puckbot I – Collector Robot Success!
The collector is a more complex robot building on concepts learns from AreaBot. The robot covers are much area of a closed arena as possible collecting Mindstorms NXT foam pucks, and delivering them to a central home base (light source). The following represents the sensors, drivers, and behavior hierarchy to accomplish the task.
See all of the collector robot articles here.
Download the Code: Download: bbPuckBot.zip
See the video here.
07.14.09
Escape Sequence – A generic approach to getting away
The escape behavior is one of the more important behaviors implemented in my robots. Any time the robot bumps into a wall, there is an opportunity to escape. In response to a trigger (collision), the robot backs up, spins away, and nudges forward to execute the “escape sequence”. I have detailed this sequence in articles about creating the AreaBot robot.
The reason I am blogging about it again, is that I believe the escape sequence is a generic action.
Download Sample Code: EscapeSequence.zip
What do I mean?
Bumpers and Light – Combining Sensors into One Port
Some of you may have noticed that my Collector Robot has more than two light sensors hanging off the sides… There is an archaic bumper (design from the original Mindstorms 1.0 kit) and a legacy light sensor buried in the bumper. There is also a couple of white arched technic pieces under the bumper.
I thought I would go into more detail on this design because the implementation was interesting. This robot is designed to find and move Lego NXT pucks around. It does not specifically search for pucks, but happens upon them because it is able to cover all areas of the arena.
Download the driver here: BumpLightCombo.h
Read the rest of this entry »
07.13.09
Differential Light Sensor – Two NXT Light Sensors as One
One of the goals of the Collector Robot is to push pucks to a light source “Home Base” and leave them there. In order to accomplish this, the robot must be able to home in on a light source. In order to home, the robot needs to have some method for finding the light, and adjusting its course to drive toward it.
I created a virtual differential light sensor using two NXT light sensors mounted on the robot facing forward, angled to the left and right. This gives me a good starting point to read values from each sensor to determine the difference in intensity and therefore determining the STEERING value to drive the robot toward the light.
Download the driver: DiffLight-driver.h
Download this too: mathext.h
07.01.09
Collecting my behavior-based RobotC code in one place
Currently, All code attached to the robot articles and is self-contained (the framework, behaviors, sensor drivers, etc… in one zip file) . I think this makes the most sense for each robot so people can download all they need in one shot, but I wonder if I should create a pool of code that accumulates the latest versions of the framework and each behavior I created so people can download one or more files as samples to build upon or create their own arrangement. What do you think?
The tricky part of putting each file online is the framework is being changed as I go, so keeping everything in sync may be a chore.
For instance, this week I made a change to the timer macros that allow a programmer to create and name multiple timers within a behavior. That means previous code will not function (if you over-wrote the framework file) until you update behaviors to name the timer in the following functions.
CreateTimer(); ---> CreateTimer(timerName);
StartTimer(); ---> StartTimer(timerName);
TimesUp(time); ---> TimesUp (timerName, expirationTime);
06.30.09
AreaRover III – Another wall following behavior
Background
While I was experimenting with the Lego Ultrasonic (US) sensor for following a wall, I thought I would create a behavior for following a wall using only the front bumper. This serves two purposes.
- As a backup or augmentation to the US wall following.
- As an alternative to the US wall following where only the front bumper is needed to accomplish similar goals.
Download the code: bbAreaRover3.zip
06.28.09
AreaRover II – Better coverage by adding a new behavior
Background
After watching AreaRover move around my arena, and
blogging about its behavior, I came up with some ideas to improve its operation. The best part is I did not change the previous code to make this happen… I added a new behavior on top of the others!
The previous AreaRover bounced off walls and followed walls when the opportunity was presented, but really had issue with inside corners. Because the robot implemented the Lego Ultrasonic sensor mounted to point straight left, it is blind in the front. This is by design and offers the best method for following a wall, but
is not good when the robot follows a wall into a corner. The robot follows the wall into the corner until it collides at the end. At this point, BUMP_ESCAPE takes control and spins the robot out of harms way.
Unfortunately, wall following is stopped, and the robot moves on. In order to better cover the ground inside a corridor with an inside corner, the robot needs to learn to follow the wall better.
Download Code: bbAreaRover2.zip
See the video here: ***COMING SOON***
06.25.09
AreaRover – Adding Wall Following with the Lego Ultrasonic Sensor
Building on our behavior-based programming concepts
I thought I better start building more robots to support
my articles on behavior-based programming. The world loves examples and there are very few in this area, if any for the Mindstorms robots. This robot is a natural progression from the BumperBot. It is called AreaRover (clever names!).
AreaRover’s job is to bounce around a closed area and cover as much ground as possible in the least amount of time. In order to accomplish this task, I started with the BumperBot, and added a Lego Ultrasonic sensor on the left side of the robot facing sideways. I then added a new behavior that triggers if a wall is in range helping the robot to follow walls for a period of time.
Download Program: bbAreaRover.zip
See the Video:
Read the rest of this entry »
06.22.09
BumperBot – A Detailed Behavior Primer
Featuring: BumperBot
RobotC Source code for a behavior-based bumper robot:Download: bbBumperBot.zip
Behaviors – Defined
Behaviors are the way to implement functionality in when using the behavior framework. A behavior represents an action or reaction to events (triggers) and resulting request to control where the robot moves.
Read the rest of this entry »
06.20.09
Behavior-based Framework for Mindstorms NXT Robots
Behavior-based Framework for RobotC
Download my RobotC code: : behRobotFramework.zip
I have created a basic framework in RobotC to implement behavior-based programming. There are two files to start with when creating a behavior robot.
