From 2162548b098552880719d8d7fc174e63f59f2ff4 Mon Sep 17 00:00:00 2001 From: Peter de Kok Date: Fri, 5 Jun 2015 09:23:15 +0200 Subject: includes fixed Compile errors fixed --- Venus_Skeleton/Venus_Skeleton.ino | 5 ++--- Venus_Skeleton/calibration_wall-e.h | 10 +++++++--- Venus_Skeleton/definitions.h | 8 +++++++- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Venus_Skeleton/Venus_Skeleton.ino b/Venus_Skeleton/Venus_Skeleton.ino index 8877af6..60df676 100644 --- a/Venus_Skeleton/Venus_Skeleton.ino +++ b/Venus_Skeleton/Venus_Skeleton.ino @@ -27,7 +27,6 @@ #include #include #include -#include #include // ********************** @@ -209,7 +208,7 @@ bool checkIfPiAlive() { } bool checkRPiActive() { - RPiActive = (lastCommunication + MAX_COMMUNICATION_DELAY) > millis()); + RPiActive = ((lastCommunication + MAX_COMMUNICATION_DELAY) > millis()); if(!RPiActive) { RPiActive = checkIfPiAlive(); @@ -605,7 +604,7 @@ int eliminateDirections(int directionArray[]) { // Incremental value for turret directions per robot direction float kinc = ((((float)NUM_TURRET_DIRECTIONS - 1) * 3.0) / (float)NUM_DIRECTIONS); // left most turret direction for this robot direction - int kinit = ((int)((float)(k % NUM_DIRECTIONS) + (float)NUM_DIRECTIONS / 6.0) % NUM_DIRECTIONS) * kinc - kinc; + int kinit = ((int)((float)(i % NUM_DIRECTIONS) + (float)NUM_DIRECTIONS / 6.0) % NUM_DIRECTIONS) * kinc - kinc; // for all turret directions relative to this robot direction, check obstacle sensor data for (int k = kinit; k <= (kinit + 2*kinc); k++) { if (k < 0) k = 0; diff --git a/Venus_Skeleton/calibration_wall-e.h b/Venus_Skeleton/calibration_wall-e.h index daf8a8e..61848f3 100644 --- a/Venus_Skeleton/calibration_wall-e.h +++ b/Venus_Skeleton/calibration_wall-e.h @@ -2,13 +2,17 @@ #define calObstacleTurretMaxDist 50 #define calObstacleTurretMinDist 10 -#define CAL_IR_LEFT_THRESHOLD 600 +#define CAL_IR_LEFT_THRESHOLD 700 #define CAL_IR_RIGHT_THRESHOLD 600 -#define CAL_SAMPLE_GRIPPER_THRESHOLD x +#define CAL_SAMPLE_GRIPPER_THRESHOLD 1 +#define CAL_SAMPLE_TURRET_THRESHOLD 1 #define CAL_INITIAL_DISTANCE 30.0 #define CAL_TURRET_DEGREE 7 // Left wheel calibration factor WALL-E: 1.4 EVE: 1.0 #define CAL_SERVO_LEFT 1.4 // Right wheel calibration factor WALL-E: 1.0 EVE: 1.1 -#define CAL_SERVO_RIGHT 1.0 \ No newline at end of file +#define CAL_SERVO_RIGHT 1.0 + +#define CAL_MOVE_TURN 6.05 + diff --git a/Venus_Skeleton/definitions.h b/Venus_Skeleton/definitions.h index 877dbdf..1e4a110 100644 --- a/Venus_Skeleton/definitions.h +++ b/Venus_Skeleton/definitions.h @@ -22,4 +22,10 @@ #define NUM_TURRET_DIRECTIONS 13 // Number of compass checks to create average -#define NUM_COMPASS_CHECKS 12 \ No newline at end of file +#define NUM_COMPASS_CHECKS 12 + +// Threshold value for obstacle turret. No free path! +#define OBSTACLE_TOO_CLOSE 30 + +// Maximum time between communications to Raspberry Pi (ms) +#define MAX_COMMUNICATION_DELAY 3000 \ No newline at end of file -- cgit v1.2.1