Activity #5: High Performance Ir Navigation - Parallax Boe-Bot Student Manual

Hide thumbs Also See for Boe-Bot:
Table of Contents

Advertisement

Page 252 · Robotics with the Boe-Bot
Back_Up:
FOR pulseCount = 0 TO 40
PULSOUT 13, 650
PULSOUT 12, 850
PAUSE 20
NEXT
RETURN
Your Turn
Modify RoamingWithIr.bs2 so that the IR pairs are checked in a subroutine.

ACTIVITY #5: HIGH PERFORMANCE IR NAVIGATION

The style of pre-programmed maneuvers that were used in the previous activity were fine
for whiskers, but are unnecessarily slow when using the IR LEDs and detectors. You can
greatly improve the Boe-Bot's roaming performance by checking for obstacles before
delivering each set of pulses to the servos. The program can use the sensor inputs to
select the best maneuver for each moment of navigation. That way, the Boe-Bot never
turns further than it has to, and it can neatly find its way around obstacles and
successfully navigate more complex courses.
Sampling Between Every Pulse to Avoid Collisions
The great thing about detecting an obstacle before bumping into it is that it gives the Boe-
Bot some room to navigate around it. The Boe-Bot can apply a pulse to turn away from
an object, check again and if the object is still there, apply another pulse to avoid it. The
Boe-Bot can keep applying pulses and checking, until it steers clear of the obstacle.
Then, it can resume forward pulses.
program, you'll likely agree that it's a much better way for the Boe-Bot to roam.
Example Program – FastIrRoaming.bs2
Enter, save, and run FastIrRoaming.bs2.
' Robotics with the Boe-Bot - FastIrRoaming.bs2
' Higher performance IR object detection assisted navigation
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG "Program Running!"
irDetectLeft
VAR
After experimenting with this next example
Bit
' Back up.
' Variable Declarations

Advertisement

Table of Contents
loading

Table of Contents