From 6d8603c454ae83f21059bf4549bbb4410d8ee591 Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Fri, 23 Dec 2022 14:30:23 +0100 Subject: [PATCH] tuning before challenge --- ADIS_Sumo/Sumo/Application.c | 15 ++++++++------- ADIS_Sumo/Sumo/Turn.c | 6 +++--- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/ADIS_Sumo/Sumo/Application.c b/ADIS_Sumo/Sumo/Application.c index bcb2f98..5affd20 100644 --- a/ADIS_Sumo/Sumo/Application.c +++ b/ADIS_Sumo/Sumo/Application.c @@ -389,19 +389,20 @@ static void StateMachine(bool buttonPress) { // McuShell_SendStr((unsigned char*)"\r\n", McuESP32_GetTxToESPStdio()->stdOut); appState = APP_STATE_IDLE; mazeFailure=0; - }else if(!LF_IsFollowing() && !MAZE_IsSolved() && mazeFailure < 5){ + }else if(!LF_IsFollowing() && !MAZE_IsSolved()){// && mazeFailure < 5){ // failed - mazeFailure++; +// mazeFailure++; MAZE_ClearSolution(); DRV_SetSpeed(0, 0); DRV_SetMode(DRV_MODE_SPEED); LF_StartFollowing(); - }else if(!LF_IsFollowing() && !MAZE_IsSolved() && mazeFailure >= 5){ - BUZ_Beep(1000, 1000); - McuShell_SendStr((unsigned char*)"mqtt publish \"/mobile/status/mode/\" \"FAILURE\"\r\n", McuESP32_GetTxToESPStdio()->stdOut); -// McuShell_SendStr((unsigned char*)"\r\n", McuESP32_GetTxToESPStdio()->stdOut); - appState = APP_STATE_IDLE; } +// }else if(!LF_IsFollowing() && !MAZE_IsSolved() && mazeFailure >= 5){ +// BUZ_Beep(1000, 1000); +// McuShell_SendStr((unsigned char*)"mqtt publish \"/mobile/status/mode/\" \"FAILURE\"\r\n", McuESP32_GetTxToESPStdio()->stdOut); +//// McuShell_SendStr((unsigned char*)"\r\n", McuESP32_GetTxToESPStdio()->stdOut); +// appState = APP_STATE_IDLE; +// } if(MAZE_GetPresentCount() != presentCnt){ presentCnt = MAZE_GetPresentCount(); //publish diff --git a/ADIS_Sumo/Sumo/Turn.c b/ADIS_Sumo/Sumo/Turn.c index 196809b..f725731 100644 --- a/ADIS_Sumo/Sumo/Turn.c +++ b/ADIS_Sumo/Sumo/Turn.c @@ -63,11 +63,11 @@ #define TURN_STEPS_POST_LINE_TIMEOUT_MS 500 #define TURN_STEPS_STOP_TIMEOUT_MS 150 #elif PL_IS_INTRO_ZUMO_K22 /* no LiPo */ - #define TURN_STEPS_90 650//720 + #define TURN_STEPS_90 720 /*!< number of steps for a 90 degree turn */ - #define TURN_STEPS_LINE 170//100 /*230*/ + #define TURN_STEPS_LINE 100 /*230*/ /*!< number of steps stepping over the line */ - #define TURN_STEPS_POST_LINE 240//150 + #define TURN_STEPS_POST_LINE 150 /*!< number of steps after the line, before making a turn */ #define TURN_STEPS_90_TIMEOUT_MS 1000 #define TURN_STEPS_LINE_TIMEOUT_MS 200