From c07de296a112ea7e2b0361c4f15ab5cf5370c3cf Mon Sep 17 00:00:00 2001
From: Peter de Kok
Date: Wed, 17 Jun 2015 14:54:26 +0200
Subject: comments, debugprints added
---
Venus_Skeleton/Venus_Skeleton.ino | 13 ++++++++-----
1 file 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) {
--
cgit v1.2.1