Tuan Nguyen hace 1 año
padre
commit
db19fbc4db
Se han modificado 2 ficheros con 5 adiciones y 4 borrados
  1. 0 4
      app.py
  2. 5 0
      esp32/esp32.ino

+ 0 - 4
app.py

@@ -111,10 +111,6 @@ def parse_theta_rho_file(file_path):
         # Shift all thetas so the first coordinate has theta=0
         normalized = []
         for (theta, rho) in coordinates:
-            if rho > 1:
-                rho = 1
-            elif rho < 0:
-                rho = 0
             normalized.append((theta - first_theta, rho))
 
         # Replace original list with normalized data

+ 5 - 0
esp32/esp32.ino

@@ -190,6 +190,11 @@ void homing()
 
 void movePolar(double theta, double rho)
 {
+    if (rho < 0.0) 
+        rho = 0.0;
+    else if (rho > 1.0) 
+        rho = 1.0;
+
     long rotSteps = lround(theta * (rot_total_steps / (2.0f * M_PI)));
     double revolutions = theta / (2.0 * M_PI);
     long offsetSteps = lround(revolutions * (rot_total_steps / gearRatio));