@METHODDEFAULT("OUT<THIS,THIS<V,V<IN,V*,THISLOC=THIS,RETURNLOC=OUT")\r
public class MotorControl {\r
@LOC("T")\r
- boolean DEBUG = false;\r
+ boolean DEBUG = true;\r
@LOC("UP")\r
int motorLeftUpTime = 150;\r
@LOC("UP")\r
motorUpTime--;\r
}\r
\r
- if (DEBUG) {\r
- System.out.println("setSpeedSpinLeft: output-> = " + Integer.toString(motorUpTime));\r
- }\r
+ // if (DEBUG) {\r
+ // System.out.println("setSpeedSpinLeft: output-> = " +\r
+ // Integer.toString(motorUpTime));\r
+ // }\r
// synchronized (this) {\r
/* Factor in the speed and agility factors */\r
motorLeftUpTime = motorUpTime;\r
// }\r
+ if (DEBUG) {\r
+ System.out.println("MotorControl: setSpeedSpinLeft: output-> " + motorLeftUpTime);\r
+ }\r
}\r
\r
/**\r
motorUpTime--;\r
}\r
\r
- if (DEBUG) {\r
- System.out.println("setSpeedSpinRight: output-> = " + Integer.toString(motorUpTime));\r
- }\r
+ // if (DEBUG) {\r
+ // System.out.println("setSpeedSpinRight: output-> = " +\r
+ // Integer.toString(motorUpTime));\r
+ // }\r
// synchronized (this) {\r
/* Factor in the speed and agility factors */\r
motorRightUpTime = motorUpTime;\r
// }\r
+ if (DEBUG) {\r
+ System.out.println("MotorControl: setSpeedSpinRight: output-> " + motorRightUpTime);\r
+ }\r
}\r
\r
/**\r
} else if (motorUpTime == 1000000) {\r
motorUpTime--;\r
}\r
- if (DEBUG) {\r
- System.out.println("setSpeedTurnLeft: output-> = " + Integer.toString(motorUpTime));\r
- }\r
+ // if (DEBUG) {\r
+ // System.out.println("setSpeedTurnLeft: output-> = " +\r
+ // Integer.toString(motorUpTime));\r
+ // }\r
// synchronized (this) {\r
/* Factor in the speed and agility factors */\r
motorLeftUpTime = motorUpTime;\r
// }\r
+ if (DEBUG) {\r
+ System.out.println("MotorControl: setSpeedTurnLeft: output-> " + motorLeftUpTime);\r
+ }\r
}\r
\r
/**\r
motorUpTime--;\r
}\r
\r
- if (DEBUG) {\r
- System.out.println("setSpeedTurnRight: output-> " + Integer.toString(motorUpTime));\r
- }\r
// synchronized (this) {\r
/* Factor in the speed and agility factors */\r
motorRightUpTime = motorUpTime;\r
// }\r
+ if (DEBUG) {\r
+ System.out.println("MotorControl: setSpeedTurnRight: output-> " + motorRightUpTime);\r
+ }\r
}\r
\r
/**\r
} else if (motorUpTime == 1000000) {\r
motorUpTime--;\r
}\r
- if (DEBUG) {\r
- System.out.println("setSpeedLeft: output-> " + Integer.toString(motorUpTime));\r
- }\r
+\r
// synchronized (this) {\r
/* Factor in speedFactor */\r
motorLeftUpTime = motorUpTime;\r
// }\r
+ if (DEBUG) {\r
+ System.out\r
+ .println("MotorContol: setSpeedLeft: output-> " + Integer.toString(motorLeftUpTime));\r
+ }\r
}\r
\r
/**\r
} else if (motorUpTime == 1000000) {\r
motorUpTime--;\r
}\r
- if (DEBUG) {\r
- System.out.println("setSpeedRight: output-> " + Integer.toString(motorUpTime));\r
- }\r
// synchronized (this) {\r
/* Factor in speedFactor */\r
motorRightUpTime = motorUpTime;\r
// }\r
+ if (DEBUG) {\r
+ System.out.println("MotorControl: setSpeedRight: output-> " + motorRightUpTime);\r
+ }\r
}\r
\r
public void setUrgentReverse() {\r
motorLeftUpTime = 1;\r
motorRightUpTime = 1;\r
// }\r
+ if (DEBUG) {\r
+ System.out.println("MotorControl: setUrgentReverse: motorLeftUpTime-> " + motorLeftUpTime);\r
+ System.out.println("MotorControl: setUrgentReverse: motorRightUpTime-> " + motorRightUpTime);\r
+ }\r
}\r
\r
public void setUrgentStraight() {\r
// synchronized (this) {\r
motorLeftUpTime = 99;\r
motorRightUpTime = 99;\r
+ if (DEBUG) {\r
+ System.out.println("MotorControl: setUrgentStraight: motorLeftUpTime-> " + motorLeftUpTime);\r
+ System.out.println("MotorControl: setUrgentStraight: motorRightUpTime-> " + motorRightUpTime);\r
+ }\r
// }\r
}\r
\r
// synchronized (this) {\r
motorLeftUpTime = motorLeftUpTime;\r
motorRightUpTime = motorRightUpTime;\r
+ if (DEBUG) {\r
+ System.out.println("MotorControl: justSync: motorLeftUpTime-> " + motorLeftUpTime);\r
+ System.out.println("MotorControl: justSync: motorRightUpTime-> " + motorRightUpTime);\r
+ }\r
// }\r
}\r
\r