Example project for the Line Follower robot.

Dependencies:   PM2_Libary Eigen

Revision:
51:b27f2beaf7b3
Parent:
50:fec2ffc2a443
Child:
52:60a710ecc162
--- a/main.cpp	Sat May 14 15:28:15 2022 +0200
+++ b/main.cpp	Sat May 14 17:26:49 2022 +0200
@@ -48,14 +48,16 @@
     SpeedController* speedControllers[2];
     speedControllers[0] = new SpeedController(counts_per_turn, kn, max_voltage, pwm_M1, encoder_M1);
     speedControllers[1] = new SpeedController(counts_per_turn, kn, max_voltage, pwm_M2, encoder_M2);
-        
+    //speedControllers[0]->setMaxAccelerationRPS(999.0f); // big number, so it is no doing anything
+    //speedControllers[1]->setMaxAccelerationRPS(999.0f); // big number, so it is no doing anything
+
     // create SensorBar object for sparkfun line follower array
     I2C i2c(PB_9, PB_8);
     SensorBar sensor_bar(i2c, 0.1175f); // second input argument is distance from bar to wheel axis
 
     // robot kinematics
-    const float r_wheel = 0.0766f / 2.0f; // wheel radius
-    const float L_wheel = 0.176f;         // distance from wheel to wheel
+    const float r_wheel = 0.0358f / 2.0f; // wheel radius
+    const float L_wheel = 0.143f;         // distance from wheel to wheel
     Eigen::Matrix2f Cwheel2robot; // transform wheel to robot
     //Eigen::Matrix2f Crobot2wheel; // transform robot to wheel
     Cwheel2robot <<  r_wheel / 2.0f   ,  r_wheel / 2.0f   ,