Texas State IEEE / scanner

Dependents:   steppertest R5 2016 Robotics Team 1

Fork of scanner by David Vasquez

Files at this revision

API Documentation at this revision

Comitter:
j_j205
Date:
Sat Mar 26 23:21:13 2016 +0000
Parent:
9:bae63bc84829
Child:
13:8767be1c5cc2
Commit message:
updated jj

Changed in this revision

scanner.cpp Show annotated file Show diff for this revision Revisions of this file
scanner.h Show annotated file Show diff for this revision Revisions of this file
--- a/scanner.cpp	Sat Mar 26 23:01:49 2016 +0000
+++ b/scanner.cpp	Sat Mar 26 23:21:13 2016 +0000
@@ -21,7 +21,7 @@
     LongRangeSensor &_longRangeR, Gripper &_robotGrip, float _period) : pc(pc1), drive(_drive), servoL(_servoL),
     servoR(_servoR), shortRangeL(_shortRangeL),
     shortRangeR(_shortRangeR), longRangeL(_longRangeL),
-    longRangeR(_longRangeR), grip(_robotGrip), period(_period)
+    longRangeR(_longRangeR), robotGrip(_robotGrip), period(_period)
 {
     servoL.period(1.0/50.0);
     servoR.period(1.0/50.0);
@@ -217,7 +217,7 @@
     }
     
     // This is the code to enable the gripper to grip the peg. 
-    robotGrip.grip()
+    robotGrip.grip();
     
     /* pseudocode
     implement the code for reading a value from the color sensor
--- a/scanner.h	Sat Mar 26 23:01:49 2016 +0000
+++ b/scanner.h	Sat Mar 26 23:21:13 2016 +0000
@@ -24,8 +24,14 @@
     float getDistRight() {return distRight;}
     float getDistForwardL() {return distForwardL;}
     float getDistForwardR() {return distForwardR;}
+    void setLocalizeRightFlag(bool value) {localizeRightFlag = value;}
+    void setLocalizeLeftFlag(bool value) {localizeLeftFlag = value;}
+    bool getYellowFlag() {return yellowFlag;}
+    bool getObjectFound() {return objectFound;}
 
 private:
+    static const int YELLOW = 1;
+    static const int RED = 0;
     static const int MIN_DUTY = 0;
     static const int MAX_DUTY = 6;
     static const int HALF_DUTY = 3;
@@ -50,11 +56,15 @@
     ShortRangeSensor &shortRangeR;
     LongRangeSensor &longRangeL;
     LongRangeSensor &longRangeR;
+    Gripper &robotGrip;
     float period;
     bool obstacle;
     bool huntFlag;
     bool avoidFlag; 
     bool objectFound;
+    bool localizeRightFlag;
+    bool localizeLeftFlag;
+    bool yellowFlag;
     
     struct huntMove
     {