Modification de la fonction Strategie_aller_a pour être plus souple dans les choix d'évitement
This commit is contained in:
		
							parent
							
								
									34f0a45041
								
							
						
					
					
						commit
						d414eb1d07
					
				
							
								
								
									
										14
									
								
								Strategie.c
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								Strategie.c
									
									
									
									
									
								
							| @ -269,14 +269,14 @@ int temporisation_terminee(uint32_t * tempo_ms, uint32_t step_ms){ | |||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| enum etat_action_t Strategie_aller_a(float pos_x, float pos_y, uint32_t step_ms){ | enum etat_action_t Strategie_aller_a(float pos_x, float pos_y, enum evitement_t evitement, uint32_t step_ms){ | ||||||
|     struct trajectoire_t trajectoire; |     struct trajectoire_t trajectoire; | ||||||
| 
 | 
 | ||||||
|     Trajectoire_droite(&trajectoire, Localisation_get().x_mm, Localisation_get().y_mm,  |     Trajectoire_droite(&trajectoire, Localisation_get().x_mm, Localisation_get().y_mm,  | ||||||
|         pos_x, pos_y, |         pos_x, pos_y, | ||||||
|         Localisation_get().angle_radian, Localisation_get().angle_radian); |         Localisation_get().angle_radian, Localisation_get().angle_radian); | ||||||
| 
 | 
 | ||||||
|     return Strategie_parcourir_trajet(trajectoire, step_ms, EVITEMENT_ARRET_DEVANT_OBSTACLE); |     return Strategie_parcourir_trajet(trajectoire, step_ms, evitement); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| enum etat_action_t Strategie_tourner_et_aller_a(float pos_x, float pos_y, float angle_radian, enum evitement_t evitement,uint32_t step_ms){ | enum etat_action_t Strategie_tourner_et_aller_a(float pos_x, float pos_y, float angle_radian, enum evitement_t evitement,uint32_t step_ms){ | ||||||
| @ -415,7 +415,7 @@ enum etat_action_t Strategie_pieds_dans_plat_trajet(struct objectif_t *objectif_ | |||||||
|             }else{ |             }else{ | ||||||
|                 pos_x = 2000 - 250; |                 pos_x = 2000 - 250; | ||||||
|             } |             } | ||||||
|             return Strategie_aller_a(pos_x, pos_y, step_ms); |             return Strategie_aller_a(pos_x, pos_y, EVITEMENT_ARRET_DEVANT_OBSTACLE, step_ms); | ||||||
| 
 | 
 | ||||||
|         case ZONE_2: |         case ZONE_2: | ||||||
|             pos_y = 1125; |             pos_y = 1125; | ||||||
| @ -424,7 +424,7 @@ enum etat_action_t Strategie_pieds_dans_plat_trajet(struct objectif_t *objectif_ | |||||||
|             }else{ |             }else{ | ||||||
|                 pos_x = 2000 - 250; |                 pos_x = 2000 - 250; | ||||||
|             } |             } | ||||||
|             return Strategie_aller_a(pos_x, pos_y, step_ms); |             return Strategie_aller_a(pos_x, pos_y, EVITEMENT_ARRET_DEVANT_OBSTACLE, step_ms); | ||||||
| 
 | 
 | ||||||
|         case ZONE_3: |         case ZONE_3: | ||||||
|             pos_y = 250; |             pos_y = 250; | ||||||
| @ -433,7 +433,7 @@ enum etat_action_t Strategie_pieds_dans_plat_trajet(struct objectif_t *objectif_ | |||||||
|             }else{ |             }else{ | ||||||
|                 pos_x = 2000 - 725; |                 pos_x = 2000 - 725; | ||||||
|             } |             } | ||||||
|             return Strategie_aller_a(pos_x, pos_y, step_ms); |             return Strategie_aller_a(pos_x, pos_y, EVITEMENT_ARRET_DEVANT_OBSTACLE, step_ms); | ||||||
| 
 | 
 | ||||||
|         case ZONE_4: |         case ZONE_4: | ||||||
|             pos_y = 250; |             pos_y = 250; | ||||||
| @ -442,7 +442,7 @@ enum etat_action_t Strategie_pieds_dans_plat_trajet(struct objectif_t *objectif_ | |||||||
|             }else{ |             }else{ | ||||||
|                 pos_x = 250; |                 pos_x = 250; | ||||||
|             } |             } | ||||||
|             return Strategie_aller_a(pos_x, pos_y, step_ms); |             return Strategie_aller_a(pos_x, pos_y, EVITEMENT_ARRET_DEVANT_OBSTACLE, step_ms); | ||||||
| 
 | 
 | ||||||
|         case ZONE_5: |         case ZONE_5: | ||||||
|             pos_y = 1850; |             pos_y = 1850; | ||||||
| @ -451,7 +451,7 @@ enum etat_action_t Strategie_pieds_dans_plat_trajet(struct objectif_t *objectif_ | |||||||
|             }else{ |             }else{ | ||||||
|                 pos_x = 250; |                 pos_x = 250; | ||||||
|             } |             } | ||||||
|             return Strategie_aller_a(pos_x, pos_y, step_ms); |             return Strategie_aller_a(pos_x, pos_y, EVITEMENT_ARRET_DEVANT_OBSTACLE, step_ms); | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -64,10 +64,10 @@ enum etat_action_t Strategie_preparation(); | |||||||
| 
 | 
 | ||||||
| enum etat_action_t Strategie_pieds_dans_plat_trajet(struct objectif_t *objectif_plat_courant, enum couleur_t couleur, uint32_t step_ms); | enum etat_action_t Strategie_pieds_dans_plat_trajet(struct objectif_t *objectif_plat_courant, enum couleur_t couleur, uint32_t step_ms); | ||||||
| enum etat_action_t Strategie_pieds_dans_plat(enum couleur_t couleur, uint32_t step_ms); | enum etat_action_t Strategie_pieds_dans_plat(enum couleur_t couleur, uint32_t step_ms); | ||||||
| enum etat_action_t Strategie_aller_a(float pos_x, float pos_y, uint32_t step_ms); |  | ||||||
| 
 | 
 | ||||||
| enum etat_action_t Strategie_calage_debut(enum couleur_t couleur, uint32_t step_ms); | enum etat_action_t Strategie_calage_debut(enum couleur_t couleur, uint32_t step_ms); | ||||||
| enum etat_action_t Strategie_calage_debut_manuel(enum couleur_t couleur, uint32_t step_ms); | enum etat_action_t Strategie_calage_debut_manuel(enum couleur_t couleur, uint32_t step_ms); | ||||||
|  | enum etat_action_t Strategie_aller_a(float pos_x, float pos_y, enum evitement_t evitement, uint32_t step_ms); | ||||||
| enum etat_action_t Strategie_tourner_et_aller_a(float pos_x, float pos_y, float angle_radian, enum evitement_t evitement,uint32_t step_ms); | enum etat_action_t Strategie_tourner_et_aller_a(float pos_x, float pos_y, float angle_radian, enum evitement_t evitement,uint32_t step_ms); | ||||||
| enum etat_action_t Strategie_aller_a_puis_tourner(float pos_x, float pos_y, float angle_radian, enum evitement_t evitement,uint32_t step_ms); | enum etat_action_t Strategie_aller_a_puis_tourner(float pos_x, float pos_y, float angle_radian, enum evitement_t evitement,uint32_t step_ms); | ||||||
| enum etat_action_t Strategie_tourner_a(float angle_radian,uint32_t step_ms); | enum etat_action_t Strategie_tourner_a(float angle_radian,uint32_t step_ms); | ||||||
|  | |||||||
| @ -774,7 +774,7 @@ int test_attrape_1_pot(void){ | |||||||
|                     break; |                     break; | ||||||
|                 case TAP_APPROCHE_POT: |                 case TAP_APPROCHE_POT: | ||||||
|                     Trajet_config(TRAJECT_CONFIG_AVANCE_ET_TOURNE); |                     Trajet_config(TRAJECT_CONFIG_AVANCE_ET_TOURNE); | ||||||
|                     if(Strategie_aller_a(position_approche_pot.x_mm, position_approche_pot.y_mm, _step_ms) == ACTION_TERMINEE){ |                     if(Strategie_aller_a(position_approche_pot.x_mm, position_approche_pot.y_mm, EVITEMENT_PAUSE_DEVANT_OBSTACLE, _step_ms) == ACTION_TERMINEE){ | ||||||
|                         etat_test=TAP_TOURNE_POT; |                         etat_test=TAP_TOURNE_POT; | ||||||
|                     } |                     } | ||||||
|                     break; |                     break; | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user