This is some awesome robot code
Dependencies: mbed-rtos mbed QEI
Fork of ICRSEurobot13 by
Revision 85:b0858346d838, committed 2013-04-16
- Comitter:
- madcowswe
- Date:
- Tue Apr 16 10:43:15 2013 +0000
- Parent:
- 84:00c799fd10a7
- Child:
- 86:769e33a3f0ff
- Commit message:
- diff
Changed in this revision
--- a/Actuators/Arms/Arm.cpp Tue Apr 16 10:05:58 2013 +0000
+++ b/Actuators/Arms/Arm.cpp Tue Apr 16 10:43:15 2013 +0000
@@ -3,7 +3,7 @@
namespace arm
{
-Arm lower_arm(p25, 0.05, 0.9, 2.0);
-Arm upper_arm(p26, 0.05, 0.6, 2.5);
+Arm lower_arm(p25, 0.05, 0.9, 1.9);//2.0
+Arm upper_arm(p26, 0.05, 0.6, 2.2);//2.5
} //namespace
\ No newline at end of file
--- a/Processes/AI/ai.cpp Tue Apr 16 10:05:58 2013 +0000
+++ b/Processes/AI/ai.cpp Tue Apr 16 10:43:15 2013 +0000
@@ -64,12 +64,13 @@
MotorControl::motorsenabled = false;
arm::upper_arm.go_up();
- arm::lower_arm.go_up();
+ arm::lower_arm.go_down();
Thread::signal_wait(0x2); //wait for cord
// CORD PULLED
MotorControl::motorsenabled = true;
+ arm::lower_arm.go_up();
#ifdef TEAM_BLUE
Waypoint mid_wp = {1.8, 1, (1.0/4.0)*PI, 0.03, 0.05*PI, 32};
@@ -87,7 +88,7 @@
Waypoint mutable_cake_wp = {0, 0, 0, 0.01, 0.01*PI, 512};
- float r = 0.26+0.35+0.01+0.01; //second 0.01 for being less collisiony with sensors
+ float r = 0.26+0.35-0.01; //second 0.01 for being less collisiony with sensors
layer layer_to_push = top_layer;
@@ -132,7 +133,7 @@
if ((colour_read==own_colour) && MotorControl::motorsenabled)
{
arm::upper_arm.go_down();
- top_arm_up_timer.start(1200);
+ top_arm_up_timer.start(1100);
}
}
else
@@ -141,10 +142,10 @@
if ((colour_read==own_colour || i==5 || i==7 || i==8 || i==10/*|| colour_read==WHITE*/) && MotorControl::motorsenabled)
{
arm::lower_arm.go_down();
- bottom_arm_up_timer.start(1200);
+ bottom_arm_up_timer.start(1100);
}
}
- Thread::wait(2200);
+ Thread::wait(2000);
}
////////////////////
--- a/Processes/Kalman/Kalman.cpp Tue Apr 16 10:05:58 2013 +0000
+++ b/Processes/Kalman/Kalman.cpp Tue Apr 16 10:43:15 2013 +0000
@@ -55,7 +55,7 @@
printf("waiting for all sonar, and at least 1 IR\r\n");
while( ((sensorseenflags & 0x7)^0x7) || !(sensorseenflags & 0x7<<3) );
-#ifdef TEAM_RED
+//#ifdef TEAM_RED
//solve for our position (assume perfect bias)
const float d = beaconpos[2].y - beaconpos[1].y;
const float i = beaconpos[2].y - beaconpos[0].y;
@@ -63,7 +63,8 @@
float r1 = RawReadings[SONAR2];
float r2 = RawReadings[SONAR1];
float r3 = RawReadings[SONAR0];
-#endif
+//#endif
+/*
#ifdef TEAM_BLUE
const float d = beaconpos[1].y - beaconpos[2].y;
const float i = beaconpos[0].y - beaconpos[2].y;
@@ -72,21 +73,24 @@
float r2 = RawReadings[SONAR1];
float r3 = RawReadings[SONAR0];
#endif
+*/
printf("ranges: 0: %0.4f, 1: %0.4f, 2: %0.4f \r\n", r1, r2, r3);
float y_coor = (r1*r1-r2*r2+d*d)/(2*d);
float x_coor = (r1*r1-r3*r3+i*i+j*j)/(2*j) - (i*y_coor)/j;
-#ifdef TEAM_RED
+//#ifdef TEAM_RED
//coordinate system hack (for now)
x_coor = beaconpos[2].x - x_coor;
y_coor = beaconpos[2].y - y_coor;
-#endif
+//#endif
+/*
#ifdef TEAM_BLUE
x_coor = x_coor - beaconpos[2].x;
y_coor = y_coor - beaconpos[2].y;
#endif
+*/
printf("solved pos from sonar: %f, %f \r\n", x_coor, y_coor);
--- a/Processes/Motion/motion.cpp Tue Apr 16 10:05:58 2013 +0000
+++ b/Processes/Motion/motion.cpp Tue Apr 16 10:43:15 2013 +0000
@@ -134,7 +134,7 @@
// forward velocity controller
- const float p_gain_fv = 0.9;//0.7; //TODO: tune
+ const float p_gain_fv = 0.85;//0.7; //TODO: tune
float max_fv = 0.3;//0.2; // meters per sec //TODO: tune
float max_fv_reverse = 0.03; //TODO: tune
--- a/globals.cpp Tue Apr 16 10:05:58 2013 +0000
+++ b/globals.cpp Tue Apr 16 10:43:15 2013 +0000
@@ -2,9 +2,11 @@
#include "globals.h"
//Store global objects here
-#ifdef TEAM_RED
+//#ifdef TEAM_RED
pos beaconpos[] = {{-0.040,1}, {3.040,-0.040}, {3.040,2.040}};
-#endif
+//#endif
+/*
#ifdef TEAM_BLUE
pos beaconpos[] = {{3.040,1}, {-0.040,2.040}, {-0.040,-0.040}};
#endif
+*/
--- a/globals.h Tue Apr 16 10:05:58 2013 +0000 +++ b/globals.h Tue Apr 16 10:43:15 2013 +0000 @@ -2,8 +2,8 @@ #ifndef GLOBALS_H #define GLOBALS_H -//#define TEAM_RED -#define TEAM_BLUE +#define TEAM_RED +//#define TEAM_BLUE #include "mbed.h"

