From 13a2ff28cb287e152a88bc64ff10a5b3ac642e9c Mon Sep 17 00:00:00 2001
From: RicardoEA <ricardo.ercoli@fing.edu.uy>
Date: Thu, 26 Jan 2023 21:03:32 -0300
Subject: [PATCH] Eliminate hardcoded moves

---
 Robotito/src/main.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/Robotito/src/main.c b/Robotito/src/main.c
index 37eb3b8..8a8340e 100644
--- a/Robotito/src/main.c
+++ b/Robotito/src/main.c
@@ -27,7 +27,7 @@
 
 static const char *tag = "UART EVENT";
 #define UART_NUM UART_NUM_2
-#define FLOAT_BUF_SIZE 1
+#define FLOAT_BUF_SIZE 3
 #define BUF_SIZE FLOAT_BUF_SIZE * sizeof(float)
 #define TASK_MEMORY 1024 * 2
 
@@ -50,11 +50,7 @@ static void uart_task(void *pvParameters)
                 len = uart_read_bytes(UART_NUM, data, BUF_SIZE, portMAX_DELAY);
                 if (len == BUF_SIZE){
                     memcpy(&fdata, data , sizeof(fdata));
-                    for (int i = 0; i < FLOAT_BUF_SIZE; i++)
-                    {
-                        printf("El dato %d en float es: %f \n",i, fdata[i]);    
-                    }
-                    // decodificar mensaje y hacer omni_drive
+                    omni_drive(fdata[0], fdata[1], fdata[2], 0);
                     uart_flush(UART_NUM);
                 }else{
                     printf("Todavia no se completo el mensaje o hay un error. \n");
@@ -93,7 +89,6 @@ void app_main(void)
     omni_init();
     omni_set_enable(true);
     while (1) {       
-        omni_drive(0,0,PI/4,0);
         vTaskDelay( 300000/ portTICK_RATE_MS);
     } 
 }
\ No newline at end of file
-- 
GitLab