Attrape cerise bas et cerise haut côté gauche
This commit is contained in:
		
							parent
							
								
									2a0bde7385
								
							
						
					
					
						commit
						702e99b788
					
				
							
								
								
									
										24
									
								
								Strategie.c
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								Strategie.c
									
									
									
									
									
								
							| @ -34,6 +34,9 @@ enum etat_action_t lance_balles_dans_panier(enum couleur_t couleur, uint32_t ste | ||||
| enum etat_action_t calage_angle(enum longer_direction_t longer_direction, float x_mm, float y_mm, float angle_radian); | ||||
| enum etat_action_t lance_balles(uint32_t step_ms); | ||||
| 
 | ||||
| int Robot_est_dans_quart_haut_gauche(); | ||||
| int Robot_est_dans_quart_haut_droit(); | ||||
| 
 | ||||
| enum etat_homologation_t etat_homologation=STRATEGIE_INIT; | ||||
| 
 | ||||
| 
 | ||||
| @ -147,10 +150,10 @@ void Strategie(enum couleur_t couleur, uint32_t step_ms){ | ||||
|         case ATTRAPER_CERISE_HAUT: | ||||
|             recal_pos_y = 3000 - RAYON_ROBOT; | ||||
|             if(couleur == COULEUR_BLEU){ | ||||
|                 longer_direction = LONGER_VERS_C; | ||||
|                 longer_direction = LONGER_VERS_A; | ||||
|                 recal_pos_x = 1000 - 15 - PETIT_RAYON_ROBOT_MM; | ||||
|             }else{ | ||||
|                 longer_direction = LONGER_VERS_A; | ||||
|                 longer_direction = LONGER_VERS_C; | ||||
|                 recal_pos_x = 1000 + 15 + PETIT_RAYON_ROBOT_MM; | ||||
|             } | ||||
| 
 | ||||
| @ -161,22 +164,7 @@ void Strategie(enum couleur_t couleur, uint32_t step_ms){ | ||||
|             break; | ||||
|              | ||||
|         case ALLER_PANIER: | ||||
|             Trajet_config(500, 500); | ||||
|             if(couleur == COULEUR_BLEU){ | ||||
|                 Trajectoire_bezier(&trajectoire,Localisation_get().x_mm, Localisation_get().y_mm,  | ||||
|                                     485, Localisation_get().y_mm, | ||||
|                                     465, 857, | ||||
|                                     465,2830, | ||||
|                                     +30. * DEGRE_EN_RADIAN, +120. * DEGRE_EN_RADIAN); | ||||
|             }else{ | ||||
|                 Trajectoire_bezier(&trajectoire,Localisation_get().x_mm, Localisation_get().y_mm,  | ||||
|                                     485, Localisation_get().y_mm, | ||||
|                                     2000-465, 857, | ||||
|                                     2000-465,2830, | ||||
|                                     -150. * DEGRE_EN_RADIAN, -240. * DEGRE_EN_RADIAN); | ||||
|             } | ||||
| 
 | ||||
|             if(parcourt_trajet_simple(trajectoire, step_ms) == ACTION_TERMINEE){ | ||||
|             if(Strategie_aller_panier(couleur, step_ms) == ACTION_TERMINEE){ | ||||
|                 etat_strategie = LANCER_PANIER; | ||||
|             } | ||||
|             break; | ||||
|  | ||||
| @ -57,6 +57,7 @@ int test_panier(void); | ||||
| void Strategie(enum couleur_t couleur, uint32_t step_ms); | ||||
| 
 | ||||
| int temporisation_terminee(uint32_t * tempo_ms, uint32_t step_ms); | ||||
| enum etat_action_t  Strategie_aller_panier(enum couleur_t couleur, uint32_t step_ms); | ||||
| 
 | ||||
| extern float distance_obstacle; | ||||
| 
 | ||||
|  | ||||
| @ -82,7 +82,7 @@ enum etat_action_t cerise_attraper_bordure(enum longer_direction_t longer_direct | ||||
| 
 | ||||
|         case ASPIRE_LONGE: | ||||
|             longer_direction_aspire = inverser_longe_direction(longer_direction); | ||||
|             avance_puis_longe_bordure(LONGER_VERS_A); | ||||
|             avance_puis_longe_bordure(longer_direction_aspire); | ||||
|             // La fonction cerise_longer_bord n'est efficace que tant que le robot a ses deux contacteur sur le support
 | ||||
|             // Le robot n'a les deux contacteurs sur le support que tant qu'il est à moins de 240mm (MAX_LONGE_MM) de la bordure
 | ||||
|             // En fonction du demi-terrain sur lequel se trouve le robot, on surveille la position en Z pour respecter cette condition
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user