* Rename 'isIRDetect*' functions to 'isLightBumper*'

* Documentation / code cleanup
* Add function 'driveRadius'
* Add function 'isVirtualWall'
This commit is contained in:
jacobperron 2016-03-28 19:17:35 -07:00
parent cdc6927e76
commit 75dd293bfd
5 changed files with 157 additions and 84 deletions

View file

@ -72,16 +72,16 @@ int main(int argc, char** argv) {
// If everything is ok, drive forward using IR's to avoid obstacles
if (drive) {
robot->setPowerLED(0); // green
if (robot->isIRDetectLeft() ||
robot->isIRDetectFrontLeft() ||
robot->isIRDetectCenterLeft()) {
if (robot->isLightBumperLeft() ||
robot->isLightBumperFrontLeft() ||
robot->isLightBumperCenterLeft()) {
// turn right
robot->drive(0.1, -1.0);
robot->setDigitsASCII('-','-','-',']');
}
else if (robot->isIRDetectRight() ||
robot->isIRDetectFrontRight() ||
robot->isIRDetectCenterRight()) {
else if (robot->isLightBumperRight() ||
robot->isLightBumperFrontRight() ||
robot->isLightBumperCenterRight()) {
// turn left
robot->drive(0.1, 1.0);
robot->setDigitsASCII('[','-','-','-');