Rectification du déplacement absolu - en panne depuis le changement de signe de l'angle de la triangulation

This commit is contained in:
Samuel 2025-04-02 11:04:27 +02:00
parent a7be11a7b1
commit 4de29cd37c

View File

@ -383,7 +383,7 @@ enum etat_action_t Strategie(void){
break;
case STRAT_ALLER_GRADINS_1:
etat_action = deplacement_absolu(730, 550, M_PI/2., 0);
etat_action = deplacement_absolu(800, 800, -M_PI/2., 0);
if(etat_action == ACTION_TERMINEE){
etat_strategie = STRAT_RECULE_BANDEROLE;
return ACTION_TERMINEE;
@ -429,10 +429,10 @@ void compar_cinematique(int consigne_x_mm, int consigne_y_mm, float consigne_ori
// Distance à parcourir
float distance_calculee = sqrt(sq(compar_X) + sq(compar_Y));
float angle_robot_vers_destination = M_PI_2 - atan2(compar_Y, compar_X);
float angle_robot_vers_destination = M_PI + atan2f(compar_Y, compar_X);
chassis_emission->translation_x_mm = sin(angle_robot_vers_destination - Angle_Robot_RAD) * distance_calculee;
chassis_emission->translation_y_mm = cos(angle_robot_vers_destination - Angle_Robot_RAD) * distance_calculee;
chassis_emission->translation_x_mm = cos(angle_robot_vers_destination - triangulation_reception.angle_rad) * distance_calculee;
chassis_emission->translation_y_mm = sin(angle_robot_vers_destination - triangulation_reception.angle_rad) * distance_calculee;
chassis_emission->rotation_z_rad = 0;
chassis_emission->status = MOUVEMENT_EN_COURS;
}