Been working on the Create. I have the web camera mounted so it peeks over the IR sensor on the front. The camera feeds to RoboRealm which does some image processing to determine the center of gravity of a 3" diameter red dot. The dot can be near or far and the processing almost always finds it.
Cool.

Previoiusly I implemented the behavior stack: Flee, Bump, Trapped, Cruise (from highest to lowest priority). This makes the Create wander. When it Bumps into something a data structure is set that tells Flee to execute a back and turn motion.
Sorry, I'm a bit confused here. Is Bump a behaviour or a sensor input? Ideally, you wouldn't have any communication between layers (except the reset to inhibit) so Bump couldn't trigger Flee?

Trapped isn't preempted because it needs to take control even when higher priority behaviors are firing since they are being unsuccessful.
In that case isn't Trapped the
de facto highest priority, rather than the others?
Okay, I could put an internal sensor (a flag variable) that RedDot sets saying that holding position is intentional and Trapped shouldn't fire. But that strikes me as a kludge that could easily lead to more flags as I add more behaviors.
Yeah, flags are a bad idea in subsumption because they introduce explicit internal states which subsumption was designed to remove.
Note that this is how Rodney Brooks' Subsumption works. In subsumption, RedDot would be a higher level behavior and would inhbit the input or output of Trapped. Or maybe it would inhibit Flee? Hmmm, there is a thought. Flee already has an internal senors structure which has an 'active' flag. If RedDot were at the top of the behavior stack it could turn off the active flag before Flee gets to see it.
Yeah, I agree with that. Something like:
--- RedDot -->
| |
|--- Flee ----> |
| |
|--- Trapped ->|
| |
Sensors ------- Cruise -------- Motors
?