summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter de Kok <p.j.s.d.kok@gmail.com>2015-06-17 14:54:26 +0200
committerPeter de Kok <p.j.s.d.kok@gmail.com>2015-06-17 14:54:26 +0200
commitc07de296a112ea7e2b0361c4f15ab5cf5370c3cf (patch)
tree5fc41c4a7a9be5ac4b5616991a455bc3cffe55bd
parentb462e0e9671ff7305945b2ed4f93f5f5b8cc9b96 (diff)
downloadcode-c07de296a112ea7e2b0361c4f15ab5cf5370c3cf.tar.gz
comments, debugprints added
-rw-r--r--Venus_Skeleton/Venus_Skeleton.ino13
1 files changed, 8 insertions, 5 deletions
diff --git a/Venus_Skeleton/Venus_Skeleton.ino b/Venus_Skeleton/Venus_Skeleton.ino
index 7b414e8..14e1ae8 100644
--- a/Venus_Skeleton/Venus_Skeleton.ino
+++ b/Venus_Skeleton/Venus_Skeleton.ino
@@ -457,8 +457,10 @@ int directionToDegree(int direction) {
}
/**
- * Rotates the robot and calculates its current orientation. If the desired
- * rotation has already been completed, nothing happens.
+ * Rotates the robot to a given direction relative to robot. If the desired
+ * rotation is 0, nothing happens.
+ * If the robot is still making it's turn, calculate it's current orientation.
+ * If the timer is finished, stop movement and reset all ultrasound values.
*
* @returns true when the rotation is completed.
*/
@@ -476,7 +478,7 @@ bool moveTurnTo(int degree) {
// if movementtimer is expired, stop movement.
if (!timerMovementStop) {
- DEBUG_PRINT(" Start turn move: ");
+ DEBUG_PRINT("\n Start turn move: ");
DEBUG_PRINT(degree);
DEBUG_PRINT("deg - ");
counterMovement++;
@@ -508,6 +510,7 @@ bool moveTurnTo(int degree) {
}
if (timerMovementStop < millis()) {
+ DEBUG_PRINT("\n Stop turn move")
stopMovement();
for (int k = 0; k < NUM_TURRET_DIRECTIONS; k++) {
data.obstacle_turret_distances[k] = OBSTACLE_FAR_AWAY;
@@ -760,12 +763,12 @@ void confirmSample(int turretVal) {
currValDirectionDegree += (x == 0 ? 0 : 10);
currValDirectionDegree *= sign;
- DEBUG_PRINT("\n currvaldeg = ");
+ DEBUG_PRINT("\n currvaldegi = ");
DEBUG_PRINT(currValDirectionDegree);
counterSampleConfirm++;
} else {
- DEBUG_PRINT("\n currvaldeg = ");
+ DEBUG_PRINT("\n currvaldege = ");
DEBUG_PRINT(currValDirectionDegree);
// Check if a sample was seen by the gripperSampleDetector and the movement to drive the grippers over it are done
if (!counterMovement && counterSampleConfirm == 2) {