Исправление зоны коррекции для второго робота

This commit is contained in:
VladislavOstapov 2023-02-04 14:14:51 +03:00
parent c4ed3b76f1
commit 4a029d9aa5

View File

@ -140,6 +140,8 @@ void scheduler_main()
scheduler_correction_stage++; scheduler_correction_stage++;
} }
} }
break;
case 1: case 1:
if (robot2_code.PC < 0 && robot1_code.PC < 0) { if (robot2_code.PC < 0 && robot1_code.PC < 0) {
scheduler_correction_stage++; scheduler_correction_stage++;
@ -230,18 +232,18 @@ void scheduler_main()
} }
if (robot_id != 0) { if (robot_id != 0) {
if ((robot_id == 1 && robot1.dx.current_zone < ZONE_DEGREASING) || if ((robot_id == 1 && robot1.dx.current_zone < ZONE_WASHING_1A) ||
(robot_id == 2 && robot2.dx.current_zone < ZONE_DEGREASING)) { (robot_id == 2 && robot2.dx.current_zone < ZONE_WASHING_1A)) {
if (robot_id == 1) { if (robot_id == 1) {
robot1_code.barrel_id = -1; robot1_code.barrel_id = -1;
robot1_code.code[0] = ROBOT_CMD_DOWN(); robot1_code.code[0] = ROBOT_CMD_DOWN();
robot1_code.code[1] = ROBOT_CMD_MOVE_TO_ZONE(ZONE_DEGREASING); robot1_code.code[1] = ROBOT_CMD_MOVE_TO_ZONE(ZONE_WASHING_1A);
robot1_code.code[2] = ROBOT_CMD_END(); robot1_code.code[2] = ROBOT_CMD_END();
robot1_code.PC = 0; robot1_code.PC = 0;
} else { } else {
robot2_code.barrel_id = -1; robot2_code.barrel_id = -1;
robot2_code.code[0] = ROBOT_CMD_DOWN(); robot2_code.code[0] = ROBOT_CMD_DOWN();
robot2_code.code[1] = ROBOT_CMD_MOVE_TO_ZONE(ZONE_DEGREASING); robot2_code.code[1] = ROBOT_CMD_MOVE_TO_ZONE(ZONE_WASHING_1A);
robot2_code.code[2] = ROBOT_CMD_END(); robot2_code.code[2] = ROBOT_CMD_END();
robot2_code.PC = 0; robot2_code.PC = 0;
} }
@ -315,13 +317,13 @@ void scheduler_main()
// и отдельно для второго (только если не в ночном режиме) // и отдельно для второго (только если не в ночном режиме)
if (robot2_code.PC < 0) { if (robot2_code.PC < 0) {
if (robot2.dx.current_zone < ZONE_DEGREASING) { if (robot2.dx.current_zone < ZONE_WASHING_1A) {
// начальная позиция робота 1 - обезжир // начальная позиция робота 1 - обезжир
robot2_lock_zone = ZONE_DEGREASING; robot2_lock_zone = ZONE_WASHING_1A;
if (robot2_code.PC < 0) { if (robot2_code.PC < 0) {
robot2_code.barrel_id = -1; robot2_code.barrel_id = -1;
robot2_code.code[0] = ROBOT_CMD_DOWN(); robot2_code.code[0] = ROBOT_CMD_DOWN();
robot2_code.code[1] = ROBOT_CMD_MOVE_TO_ZONE(ZONE_DEGREASING); robot2_code.code[1] = ROBOT_CMD_MOVE_TO_ZONE(ZONE_WASHING_1A);
robot2_code.code[2] = ROBOT_CMD_END(); robot2_code.code[2] = ROBOT_CMD_END();
robot2_code.PC = 0; robot2_code.PC = 0;
} }