|
|
@@ -2,33 +2,29 @@ package boebot;
|
|
|
public class Botsingdetectie{
|
|
|
private IrDetectie irL;
|
|
|
private IrDetectie irR;
|
|
|
- private VsDetectie vsL;
|
|
|
- private VsDetectie vsR;
|
|
|
private boolean IrDetectL;
|
|
|
private boolean IrDetectR;
|
|
|
- private boolean VsDetectL;
|
|
|
- private boolean VsDetectR;
|
|
|
|
|
|
public Botsingdetectie(){
|
|
|
irL = new IrDetectie(8, 9);
|
|
|
irR = new IrDetectie(2, 0);
|
|
|
- vsL = new VsDetectie(8, 9);
|
|
|
- vsR = new VsDetectie(2, 0);
|
|
|
}
|
|
|
|
|
|
public boolean detectEdge(){
|
|
|
|
|
|
IrDetectL = irL.detect();
|
|
|
IrDetectR = irR.detect();
|
|
|
- VsDetectL = vsL.detect();
|
|
|
- VsDetectR = vsR.detect();
|
|
|
-
|
|
|
- if(IrDetectL || IrDetectR || VsDetectL || VsDetectR){
|
|
|
+ System.out.println(IrDetectL);
|
|
|
+ System.out.println(IrDetectR);
|
|
|
+ if(IrDetectL || IrDetectR){
|
|
|
return true;
|
|
|
|
|
|
}else{
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
-}
|
|
|
+}
|