Pololu 3pi Robot Instrukcja Użytkownika Strona 33

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 63
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 32
}
}
The first main loop needs to drive down a segment of the course, decide how to turn, and record the turn in the path
variable. To pass the correct arguments to select_turn(), we need to carefully examine the intersection as we cross it.
Note that there is a special exception for finding the end of the maze. The following code works pretty well, at least
at the slow speeds that we’re using:
// FIRST MAIN LOOP BODY
follow_segment();
// Drive straight a bit. This helps us in case we entered the
// intersection at an angle.
// Note that we are slowing down - this prevents the robot
// from tipping forward too much.
set_motors(50,50);
delay_ms(50);
// These variables record whether the robot has seen a line to the
// left, straight ahead, and right, whil examining the current
// intersection.
unsigned char found_left=0;
unsigned char found_straight=0;
unsigned char found_right=0;
// Now read the sensors and check the intersection type.
unsigned int sensors[5];
read_line(sensors,IR_EMITTERS_ON);
// Check for left and right exits.
if(sensors[0] > 100)
found_left = 1;
if(sensors[4] > 100)
found_right = 1;
// Drive straight a bit more - this is enough to line up our
// wheels with the intersection.
set_motors(40,40);
delay_ms(200);
// Check for a straight exit.
read_line(sensors,IR_EMITTERS_ON);
if(sensors[1] > 200 || sensors[2] > 200 || sensors[3] > 200)
found_straight = 1;
// Check for the ending spot.
// If all three middle sensors are on dark black, we have
// solved the maze.
if(sensors[1] > 600 && sensors[2] > 600 && sensors[3] > 600)
break;
// Intersection identification is complete.
// If the maze has been solved, we can follow the existing
// path. Otherwise, we need to learn the solution.
unsigned char dir = select_turn(found_left, found_straight, found_right);
// Make the turn indicated by the path.
turn(dir);
// Store the intersection in the path variable.
path[path_length] = dir;
path_length ++;
// You should check to make sure that the path_length does not
// exceed the bounds of the array. We'll ignore that in this
// example.
// Simplify the learned path.
simplify_path();
// Display the path on the LCD.
display_path();
Pololu 3pi Robot User's Guide © 2001–2014 Pololu Corporation
8. Example Project #2: Maze Solving Page 33 of 63
Przeglądanie stron 32
1 2 ... 28 29 30 31 32 33 34 35 36 37 38 ... 62 63

Komentarze do niniejszej Instrukcji

Brak uwag

American Standard Reliant 3 Bath and Shower Trim Kits podręczniki

Instrukcje obsługi i podręczniki użytkownika dla Nie American Standard Reliant 3 Bath and Shower Trim Kits.
Dostarczamy 1 pdf podręczników American Standard Reliant 3 Bath and Shower Trim Kits do pobrania za darmo według typów dokumentów: Instrukcja Użytkownika






Więcej produktów i instrukcji dla Nie American Standard

Modele Rodzaj dokumentu
Madera 16-1/8" Height Elongated Flush Valve Toilet 2305.100 Instrukcja Użytkownika   American Standard Madera 16-1/8" Height Elongated Flush Valve Toilet 2305.100 User's Manual, 1 strony
EasyTouch 6310 Instrukcja Użytkownika   American Standard EasyTouch 6310 User's Manual, 1 strony
Lifetime 2771LC Instrukcja Użytkownika   American Standard Lifetime 2771LC User's Manual [et] , 2 strony
Champion Slow Close Toilet Seat 5325.010 Instrukcja Użytkownika     American Standard Champion Slow Close Toilet Seat 5325.010 User's Manual, 2 strony
Colony Corner 1730 SERIES Instrukcja Użytkownika   American Standard Colony Corner 1730 SERIES User's Manual, 4 strony
Robe Hook 6028.210 Instrukcja Użytkownika   American Standard Robe Hook 6028.210 User's Manual, 1 strony
7676.029 Instrukcja Użytkownika   American Standard 7676.029 User's Manual, 1 strony
670.312 Instrukcja Użytkownika   American Standard 670.312 User's Manual [no] , 1 strony
2064.90X Instrukcja Użytkownika   American Standard 2064.90X User's Manual, 3 strony
Corner Minette 0451.021 Instrukcja Użytkownika   American Standard Corner Minette 0451.021 User's Manual, 2 strony
2998.01 Instrukcja Użytkownika   American Standard 2998.01 User's Manual, 1 strony
Copeland 7005.801 Instrukcja Użytkownika   American Standard Copeland 7005.801 User's Manual, 8 strony
Generations 30" Vanity 9210.030.329 Instrukcja Użytkownika   American Standard Generations 30" Vanity 9210.030.329 User's Manual [et] , 5 strony
Colony 2388.012 Instrukcja Użytkownika   American Standard Colony 2388.012 User's Manual, 1 strony
7837.024 Instrukcja Użytkownika   American Standard 7837.024 User's Manual [es] , 1 strony
Copeland 7005.201 Instrukcja Użytkownika   American Standard Copeland 7005.201 User's Manual, 8 strony
Ravenna 2642.016 Instrukcja Użytkownika   American Standard Ravenna 2642.016 User's Manual, 1 strony
Bordeaux Vanity and Mirror 9586.101 Instrukcja Użytkownika   American Standard Bordeaux Vanity and Mirror 9586.101 User's Manual, 2 strony
2315.016 Round Front Instrukcja Użytkownika   American Standard 2315.016 Round Front User's Manual, 1 strony
2774E Instrukcja Użytkownika   American Standard 2774E User's Manual, 4 strony