X-Git-Url: http://git.droids-corp.org/?p=aversive.git;a=blobdiff_plain;f=projects%2Fmicrob2010%2Fmainboard%2Fcommands_traj.c;h=be9150b3b2fa6bdfff3bef92a5d325a93332c190;hp=8c59996a034d8a5786b4d8d253abaec3f4f1b7c0;hb=78150017ab8c5615af414df706a0525fe7c262ae;hpb=6914527de2ecfef9d790740c71739e7418246b96 diff --git a/projects/microb2010/mainboard/commands_traj.c b/projects/microb2010/mainboard/commands_traj.c index 8c59996..be9150b 100644 --- a/projects/microb2010/mainboard/commands_traj.c +++ b/projects/microb2010/mainboard/commands_traj.c @@ -766,14 +766,13 @@ static void auto_position(void) strat_get_speed(&old_spdd, &old_spda); strat_set_speed(AUTOPOS_SPEED_FAST, AUTOPOS_SPEED_FAST); - trajectory_d_rel(&mainboard.traj, 300); - err = wait_traj_end(END_INTR|END_TRAJ|END_BLOCKING); + err = strat_calib(300, END_INTR|END_TRAJ|END_BLOCKING); if (err == END_INTR) goto intr; - wait_ms(100); - strat_reset_pos(ROBOT_WIDTH/2, + strat_reset_pos(ROBOT_WIDTH/2 + 100, COLOR_Y(ROBOT_HALF_LENGTH_FRONT), COLOR_A(-90)); + strat_hardstop(); trajectory_d_rel(&mainboard.traj, -180); err = wait_traj_end(END_INTR|END_TRAJ); @@ -785,14 +784,13 @@ static void auto_position(void) if (err == END_INTR) goto intr; - trajectory_d_rel(&mainboard.traj, 300); - err = wait_traj_end(END_INTR|END_TRAJ|END_BLOCKING); + err = strat_calib(300, END_INTR|END_TRAJ|END_BLOCKING); if (err == END_INTR) goto intr; - wait_ms(100); strat_reset_pos(ROBOT_HALF_LENGTH_FRONT, DO_NOT_SET_POS, 180); + strat_hardstop(); trajectory_d_rel(&mainboard.traj, -170); err = wait_traj_end(END_INTR|END_TRAJ);