Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 23:a74135a0271d, committed 2020-10-28
- Comitter:
- Nanaud
- Date:
- Wed Oct 28 16:27:05 2020 +0000
- Parent:
- 22:f891c2bce091
- Child:
- 24:be2b2be6907b
- Commit message:
- avant => double to int
Changed in this revision
--- a/captUS.cpp Tue Oct 27 17:27:33 2020 +0000
+++ b/captUS.cpp Wed Oct 28 16:27:05 2020 +0000
@@ -46,7 +46,7 @@
else if((objRecule[indice]==1) && (fnc == 2)) {
//if ((distt[2] >= DISTLIM) && (distt[3] >= DISTLIM) && (distt[4] >= DISTLIM)) {
- if (((distt[2] >= DISTLIM) && (distt[3] >= DISTLIM) && (distt[4] >= DISTLIM)) || ((distt[2] < 0) && (distt[3] < 0) && (distt[4] < 0))) {
+ if (((distt[2] >= DISTLIM) && (distt[3] >= DISTLIM) && (distt[4] >= DISTLIM)) || ((distt[2] < 0) && (distt[3] < 0) && (distt[4] < 0))) {
wtt=1;
}
@@ -77,6 +77,14 @@
pc.printf("\n\r");
*/
+ pc.printf("distance[1] = %lf\n\r", distt[0]);
+ pc.printf("distance[2] = %lf\n\r", distt[1]);
+ pc.printf("distance[3] = %lf\n\r", distt[2]);
+ pc.printf("distance[4] = %lf\n\r", distt[3]);
+ pc.printf("distance[5] = %lf\n\r", distt[4]);
+ pc.printf("distance[6] = %lf\n\r", distt[5]);
+ pc.printf("\n\r");
+
TimUS.reset();
trigger=1;
wait(0.00002);
--- a/debugPC.cpp Tue Oct 27 17:27:33 2020 +0000
+++ b/debugPC.cpp Wed Oct 28 16:27:05 2020 +0000
@@ -438,14 +438,15 @@
//*/
// bt
- /*
- bt.printf("distance[0] = %f\n\r", ::distance[0]);
- bt.printf("distance[1] = %f\n\r", ::distance[1]);
- bt.printf("distance[2] = %f\n\r", ::distance[2]);
- bt.printf("distance[3] = %f\n\r", ::distance[3]);
- bt.printf("distance[4] = %f\n\r", ::distance[4]);
- bt.printf("distance[5] = %f\n\r", ::distance[5]);
- */
+
+ bt.printf("distance[1] = %lf\n\r", distt[0]);
+ bt.printf("distance[2] = %lf\n\r", distt[1]);
+ bt.printf("distance[3] = %lf\n\r", distt[2]);
+ bt.printf("distance[4] = %lf\n\r", distt[3]);
+ bt.printf("distance[5] = %lf\n\r", distt[4]);
+ bt.printf("distance[6] = %lf\n\r", distt[5]);
+ bt.printf("\n\r");
+
}
void affCodeurs()
--- a/odo_asserv.cpp Tue Oct 27 17:27:33 2020 +0000
+++ b/odo_asserv.cpp Wed Oct 28 16:27:05 2020 +0000
@@ -3,7 +3,7 @@
/* #define & constantes */
#define VMAXROT 0.050
-#define VMAXLIN 0.100
+#define VMAXLIN 0.080
#define entraxe 253 // (Valeur théorique = 255)
const double coeffGLong = 5.956, coeffDLong = 5.956; // tics/millimètre
@@ -78,8 +78,8 @@
// Ligne droite
double erreurPreDist = 0;
double deltaErreurDist = 0;
-const double coeffProDist = 0.0005; // 0.010 de base
-const double coeffDerDist = 0.0005; // 0.010 de base
+const double coeffProDist = 0.0004; // 0.010 de base
+const double coeffDerDist = 0.0004; // 0.010 de base
// NEW NEW NEW NEW
int fnc = 0;
@@ -163,7 +163,7 @@
double deltaCommande = (abs(coeffPro * erreurAngle) + abs(coeffDer * deltaErreur));
if(acc) {
- cmdG = cmdG + 0.0005; // +0.0008
+ cmdG = cmdG + 0.0001; // +0.0008
cmdD = cmdG;
if (cmdG >= VMAXROT) acc = 0;
@@ -211,7 +211,7 @@
double deltaCommande2 = (abs(coeffProDist * distanceCible) + abs(coeffDerDist * deltaErreurDist));
if(acc) {
- cmdG = cmdG + 0.001; // +0.0008
+ cmdG = cmdG + 0.0001; // +0.0008
cmdD = cmdG;
if (cmdG >= VMAXLIN) {