TRR 2018 / Mbed 2 deprecated biniou-TRR2019-chassis2

Dependencies:   mbed MPU6050

Files at this revision

API Documentation at this revision

Comitter:
ohlimi2
Date:
Sat Oct 05 01:32:50 2019 +0000
Parent:
14:914467165f34
Commit message:
Pour le mordor

Changed in this revision

chassis_mode.cpp Show annotated file Show diff for this revision Revisions of this file
sm_sections.cpp Show annotated file Show diff for this revision Revisions of this file
sm_servo.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/chassis_mode.cpp	Fri Oct 04 23:31:08 2019 +0000
+++ b/chassis_mode.cpp	Sat Oct 05 01:32:50 2019 +0000
@@ -9,13 +9,25 @@
 {
     b_CHASSIS_Mode.mode(PullUp);
     if(b_CHASSIS_Mode.read()) {
-        b_CHASSIS_with_pushbutton = false;
-        d_CHASSIS_inversion = -1.0;
-        d_CHASSIS_dist_one_step_odom = 0.066;
-    } else {
         b_CHASSIS_with_pushbutton = true;
         d_CHASSIS_inversion = 1.0;
         d_CHASSIS_dist_one_step_odom = 0.066;
+        
+        
+        
+        
+        
+      //  b_CHASSIS_with_pushbutton = false;
+      //  d_CHASSIS_inversion = -1.0;
+      //  d_CHASSIS_dist_one_step_odom = 0.066;
+    } else {
+  //      b_CHASSIS_with_pushbutton = true;
+   //     d_CHASSIS_inversion = 1.0;
+    //    d_CHASSIS_dist_one_step_odom = 0.066;
+    
+            b_CHASSIS_with_pushbutton = false;
+        d_CHASSIS_inversion = -1.0;
+        d_CHASSIS_dist_one_step_odom = 0.066;
     }
     return;
 }
\ No newline at end of file
--- a/sm_sections.cpp	Fri Oct 04 23:31:08 2019 +0000
+++ b/sm_sections.cpp	Sat Oct 05 01:32:50 2019 +0000
@@ -20,6 +20,7 @@
 s_Section s_section10;
 s_Section s_section11;
 s_Section s_section11_1;
+s_Section s_section11_2;
 s_Section s_section12;
 
 E_STATE_SECTIONS e_SECTIONS_state;
@@ -45,8 +46,8 @@
     //ligne droite debut
     s_section2.nextSection = &s_section2_1;
     s_section2.consigne_position = 0.5;
-    s_section2.targetSpeed_mps = 1770;
-    s_section2.lng_section_m = 10.0;
+    s_section2.targetSpeed_mps = 1790;
+    s_section2.lng_section_m = 11.5;
     s_section2.coef_pos = 30;
     s_section2.coef_bord = 0.5;
     s_section2.plagePulseFreinage = 50;
@@ -54,28 +55,28 @@
     
     //ligne droite debut
     s_section2_1.nextSection = &s_section3;
-    s_section2_1.consigne_position = 0.4;
-    s_section2_1.targetSpeed_mps = 1600;
-    s_section2_1.lng_section_m = 3.0;
+    s_section2_1.consigne_position = 0.5;
+    s_section2_1.targetSpeed_mps = 1670;
+    s_section2_1.lng_section_m = 1.5;
     s_section2_1.coef_pos = 30;
-    s_section2_1.coef_bord = 0.4;
+    s_section2_1.coef_bord = 0.9;
     s_section2_1.plagePulseFreinage = 50;
     
     //epingle 1 debut
     s_section3.nextSection = &s_section3_1;
     s_section3.consigne_position = 0.7;
-    s_section3.targetSpeed_mps = 1620;
+    s_section3.targetSpeed_mps = 1660;
     s_section3.lng_section_m = 2.0;
     s_section3.coef_pos = 30;
     s_section3.coef_bord = 2.0;
-    s_section3.plagePulseFreinage = 20;
+    s_section3.plagePulseFreinage = 30;
     
     //epingle 1 milieu
     s_section3_1.nextSection = &s_section4;
     s_section3_1.consigne_position = 0.7;
     s_section3_1.targetSpeed_mps = 1690;
     s_section3_1.lng_section_m = 4.0;
-    s_section3_1.coef_pos = 30;
+    s_section3_1.coef_pos = 40;
     s_section3_1.coef_bord = 2.0;
     s_section3_1.plagePulseFreinage = 20;
     
@@ -92,7 +93,7 @@
     s_section5.nextSection = &s_section5_1;
     s_section5.consigne_position = 0.6;
     s_section5.targetSpeed_mps = 1780;
-    s_section5.lng_section_m = 7.0;
+    s_section5.lng_section_m = 8.0;
     s_section5.coef_pos = 30;
     s_section5.coef_bord = 0.7;
     s_section5.plagePulseFreinage = 40;
@@ -100,8 +101,8 @@
     
     //avant chicane
     s_section5_1.nextSection = &s_section6_0;
-    s_section5_1.consigne_position = 0.8;
-    s_section5_1.targetSpeed_mps = 1650;
+    s_section5_1.consigne_position = 0.7;
+    s_section5_1.targetSpeed_mps = 1690;
     s_section5_1.lng_section_m = 4.0;
     s_section5_1.coef_pos = 30;
     s_section5_1.coef_bord = 2.0;
@@ -110,35 +111,27 @@
     //pre chicane
     s_section6_0.nextSection = &s_section6;
     s_section6_0.consigne_position = 0.5;
-    s_section6_0.targetSpeed_mps = 1650;
-    s_section6_0.lng_section_m = 3.0;
-    s_section6_0.coef_pos = 30;//50
-    s_section6_0.coef_bord = 1.0;//2.0
+    s_section6_0.targetSpeed_mps = 1660;
+    s_section6_0.lng_section_m = 2.0;
+    s_section6_0.coef_pos = 40;//50
+    s_section6_0.coef_bord = 0.9;//2.0
     s_section6_0.plagePulseFreinage = 45;
    
    
     //chicane
     s_section6.nextSection = &s_section7;
-    s_section6.consigne_position = 0.58;
+    s_section6.consigne_position = 0.6;
     s_section6.targetSpeed_mps = 1675;
-    s_section6.lng_section_m = 17.0;
-    s_section6.coef_pos = 30;//50
+    s_section6.lng_section_m = 17.5;
+    s_section6.coef_pos = 40;//50
     s_section6.coef_bord = 2.0;//2.0
     s_section6.plagePulseFreinage = 50;
     
-    //fin chicane SKIPPED
-    s_section6_1.nextSection = &s_section7;
-    s_section6_1.consigne_position = 0.58;
-    s_section6_1.targetSpeed_mps = 1675;
-    s_section6_1.lng_section_m = 0.0;
-    s_section6_1.coef_pos = 30;//50
-    s_section6_1.coef_bord = 2.0;//2.0
-    s_section6_1.plagePulseFreinage = 50;
     
    //ligne droite postchicane
     s_section7.nextSection = &s_section8;
     s_section7.consigne_position = 0.4;
-    s_section7.targetSpeed_mps = 1770;
+    s_section7.targetSpeed_mps = 1730;
     s_section7.lng_section_m = 8.0;
     s_section7.coef_pos = 30;
     s_section7.coef_bord = 0.5;
@@ -147,19 +140,19 @@
     
     //freinage avant epingle
     s_section8.nextSection = &s_section9;
-    s_section8.consigne_position = 0.4;
-    s_section8.targetSpeed_mps = 1620;
-    s_section8.lng_section_m = 4.0;
+    s_section8.consigne_position = 0.5;
+    s_section8.targetSpeed_mps = 1660;
+    s_section8.lng_section_m = 3.5;
     s_section8.coef_pos = 30;
-    s_section8.coef_bord = 0.4;
+    s_section8.coef_bord = 0.5;
     s_section8.plagePulseFreinage = 50;
     
     //epingle 2 debut
     s_section9.nextSection = &s_section9_1;
-    s_section9.consigne_position = 0.7;
-    s_section9.targetSpeed_mps = 1620;
+    s_section9.consigne_position = 0.6;
+    s_section9.targetSpeed_mps = 1660;
     s_section9.lng_section_m = 2.0;
-    s_section9.coef_pos = 30;
+    s_section9.coef_pos = 40;
     s_section9.coef_bord = 2.0;
     s_section9.plagePulseFreinage = 20;
     
@@ -167,45 +160,53 @@
     s_section9_1.nextSection = &s_section10;
     s_section9_1.consigne_position = 0.7;
     s_section9_1.targetSpeed_mps = 1670;
-    s_section9_1.lng_section_m = 4.0;
-    s_section9_1.coef_pos = 30;
+    s_section9_1.lng_section_m = 5.0;
+    s_section9_1.coef_pos = 40;
     s_section9_1.coef_bord = 2.0;
     s_section9_1.plagePulseFreinage = 20;
     
     //post epingle 2
     s_section10.nextSection = &s_section11;
-    s_section10.consigne_position = 0.8;
-    s_section10.targetSpeed_mps = 1720;
+    s_section10.consigne_position = 0.5;
+    s_section10.targetSpeed_mps = 1700;
     s_section10.lng_section_m = 5.0;
     s_section10.coef_pos = 30;
-    s_section10.coef_bord = 1.3;
+    s_section10.coef_bord = 1.5;
     s_section10.plagePulseFreinage = 30;
     
     //dernière ligne droite
     s_section11.nextSection = &s_section11_1;
-    s_section11.consigne_position = 0.65;
-    s_section11.targetSpeed_mps = 1750;
-    s_section11.lng_section_m = 8.0;
-    s_section11.coef_pos = 20;
-    s_section11.coef_bord = 0.4;
+    s_section11.consigne_position = 0.5;
+    s_section11.targetSpeed_mps = 1800;
+    s_section11.lng_section_m = 5.0;
+    s_section11.coef_pos = 30;
+    s_section11.coef_bord = 0.5;
     s_section11.plagePulseFreinage = 40;
     
     //dernière ligne droite
-    s_section11_1.nextSection = &s_section12;
+    s_section11_1.nextSection = &s_section11_2;
     s_section11_1.consigne_position = 0.5;
-    s_section11_1.targetSpeed_mps = 1810;
-    s_section11_1.lng_section_m = 30.0;
+    s_section11_1.targetSpeed_mps = 1870;
+    s_section11_1.lng_section_m = 5.0;
     s_section11_1.coef_pos = 20;
-    s_section11_1.coef_bord = 0.4;
+    s_section11_1.coef_bord = 0.5;
     s_section11_1.plagePulseFreinage = 100;
   
+      //der des dernière ligne droite
+    s_section11_2.nextSection = &s_section12;
+    s_section11_2.consigne_position = 0.5;
+    s_section11_2.targetSpeed_mps = 1900;
+    s_section11_2.lng_section_m = 25.0;
+    s_section11_2.coef_pos = 20;
+    s_section11_2.coef_bord = 0.5;
+    s_section11_2.plagePulseFreinage = 100;
     
     //frein
     s_section12.nextSection = NULL;
     s_section12.consigne_position = 0.5;
-    s_section12.targetSpeed_mps = 1300;
-    s_section12.lng_section_m = 0.1;
-    s_section12.coef_pos = 80;
+    s_section12.targetSpeed_mps = 1500;
+    s_section12.lng_section_m = 7.0;
+    s_section12.coef_pos = 40;
     s_section12.coef_bord = 1.0;
     s_section12.plagePulseFreinage = 20;
 
--- a/sm_servo.cpp	Fri Oct 04 23:31:08 2019 +0000
+++ b/sm_servo.cpp	Sat Oct 05 01:32:50 2019 +0000
@@ -55,7 +55,7 @@
 double pwmFromAngle(double angleDeg)
 {
     //on a une regression linéaire entre l'angle et la pwm on centre sur 0 puis on applique
-    pulsewidth = (d_CHASSIS_inversion*angleDeg * 11.0) + SERVO_PULSE_MIDDLE_US;
+    pulsewidth = (d_CHASSIS_inversion*angleDeg * 21.0) + SERVO_PULSE_MIDDLE_US;
     //rs_LOG_pc.printf("pulsewidth = %d =(%f * 11.0) + 1500\r\n",pulsewidth,angleDeg);
     if(pulsewidth > SERVO_PULSE_MAX_US) {
         pulsewidth =  SERVO_PULSE_MAX_US;