From 4256d8112b25f0cae8da31f19a0d2e39b74c92c7 Mon Sep 17 00:00:00 2001
From: Arthur Van Betsbrugge <avbetsbr@gmail.com>
Date: Tue, 16 Mar 2021 16:42:10 -0400
Subject: [PATCH] Remise des valeurs min-max du standard

---
 Src/main.c                | 10 +++++-----
 Src/robot_configuration.c | 16 +++++++++-------
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/Src/main.c b/Src/main.c
index 1bb5dc8..6160fe1 100644
--- a/Src/main.c
+++ b/Src/main.c
@@ -121,13 +121,13 @@ int main(void)
   /* USER CODE BEGIN WHILE */
 	
 	while(1){
-		
-	if(signOfLife_Receiver_RadioController_tick !=0 ){
-		if(isControllerNeutral()){
-			break;
+		if(signOfLife_Receiver_RadioController_tick !=0 ){
+			if(isControllerNeutral()){
+				break;
+			}
 		}
 	}
-	}
+	
   while (1)
   {
 		signOfLife(); //LEDs BLINK
diff --git a/Src/robot_configuration.c b/Src/robot_configuration.c
index 0c9c504..3706c02 100644
--- a/Src/robot_configuration.c
+++ b/Src/robot_configuration.c
@@ -8,6 +8,9 @@
 /* Crée le tableau contenant tous les moteurs du robot */
 motor_t motors[MAX_MOTORS];
 
+// Variable qui sauvegarde le type de robot
+int robot_type;
+
 /* CAN MOTORS DATASHEET
 	M3508: Control by current
 		TX :
@@ -32,7 +35,6 @@ motor_t motors[MAX_MOTORS];
 */
 
 
-
 /* Fonction qui premet de configurer le robot */
 void robotInit(uint8_t robot_id){
 	/*
@@ -114,9 +116,9 @@ void robotInit(uint8_t robot_id){
 			motors[TOURELLE_PITCH].can_rx_id = 0x204+1; // ID = 1
 			motors[TOURELLE_PITCH].can_tx_frame = 0x1FF; 
 			motors[TOURELLE_PITCH].can_tx_id = 1;
-			motors[TOURELLE_PITCH].MIN_POSITION = 243; //en deg
-			motors[TOURELLE_PITCH].MAX_POSITION = 293; //en deg    //213 120
-			motors[TOURELLE_PITCH].consigne = 260; //en deg //Valeur initiale
+			motors[TOURELLE_PITCH].MIN_POSITION = 1; //en deg
+			motors[TOURELLE_PITCH].MAX_POSITION = 67; //en deg    //213 120
+			motors[TOURELLE_PITCH].consigne = 54; //en deg //Valeur initiale
 			motors[TOURELLE_PITCH].direction = -1; //permet de choisir la direction de controle (-1 ou 1)
 			pid_create(&motors[TOURELLE_PITCH].pid, 
 							&motors[TOURELLE_PITCH].info.angle_360, 		//input : le retour sur la quelle ont veut atteintre la consigne 
@@ -131,9 +133,9 @@ void robotInit(uint8_t robot_id){
 			motors[TOURELLE_YAW].can_rx_id = 0x204+2; // ID = 2
 			motors[TOURELLE_YAW].can_tx_frame = 0x1FF; 
 			motors[TOURELLE_YAW].can_tx_id = 2;
-			motors[TOURELLE_YAW].MIN_POSITION = 155; //en deg
-			motors[TOURELLE_YAW].MAX_POSITION = 269; //en deg
-			motors[TOURELLE_YAW].consigne = 215; //en deg //Valeur initiale
+			motors[TOURELLE_YAW].MIN_POSITION = 245; //en deg
+			motors[TOURELLE_YAW].MAX_POSITION = 359; //en deg
+			motors[TOURELLE_YAW].consigne = 325; //en deg //Valeur initiale
 			motors[TOURELLE_YAW].direction = -1; //permet de choisir la direction de controle (-1 ou 1)
 			pid_create(&motors[TOURELLE_YAW].pid, 
 							&motors[TOURELLE_YAW].info.angle_360, 		//input : le retour sur la quelle ont veut atteintre la consigne 
-- 
GitLab