Surveyor Robotics Journal |
|||||
|
Surveyor Corporation home page
Subscribe to a syndicated RSS feed. Archives |
Fri, 22 Sep 2006 further exploration of the SRV-1 "wander mode" ... Continuing from the discussion yesterday, there is now a version of SRV-1 test code that has the motors activated in wander mode. The field of view is broken into 7 overlapping regions that are each 20 pixel columns wide, and each region is flagged as open (1) or blocked (0) ... tflag = 0; for (ix=0; ix<7; ix++) if (tzeros[ix] <5) tflag += (0x40 >> ix); producing a 7-bit pattern that has 128 possible combinations. There's a lookup table for all 128 patterns, where a motor control keypad command is assigned to each pattern (8 = forward, 2 = back, 0 = rotate left 20-deg, . = rotate right 20-deg, 7 = drift left, 9 = drift right, etc) ... unsigned char motor_cmd[128] = { // assign motor command to each 7-bit tflag pattern // 1's in the bit pattern represent clear regions for movement // 0000000, 0000001, 0000010, 0000011, 0000100, 0000101, 0000110, 0000111, '.', '.', '.', '.', '.', '.', '.', '6', // 0001000, 0001001, 0001010, 0001011, 0001100, 0001101, 0001110, 0001111, '0', '.', '.', '6', '2', '7', '6', '6', // 0010000, 0010001, 0010010, 0010011, 0010100, 0010101, 0010110, 0010111, '0', '0', '2', '.', '0', '.', '2', '6', // 0011000, 0011001, 0011010, 0011011, 0011100, 0011101, 0011110, 0011111, '0', '0', '3', '.', '4', '4', '9', '9', // 0100000, 0100001, 0100010, 0100011, 0100100, 0100101, 0100110, 0100111, '0', '.', '0', '.', '0', '2', '2', '6', // 0101000, 0101001, 0101010, 0101011, 0101100, 0101101, 0101110, 0101111, '3', '3', '2', '.', '0', '2', '2', '6', // 0110000, 0110001, 0110010, 0110011, 0110100, 0110101, 0110110, 0110111, '0', '0', '0', '1', '4', '4', '8', '8', // 0111000, 0111001, 0111010, 0111011, 0111100, 0111101, 0111110, 0111111, '4', '4', '4', '4', '4', '4', '8', '9', // 1000000, 1000001, 1000010, 1000011, 1000100, 1000101, 1000110, 1000111, '0', '0', '0', '.', '0', '.', '.', '6', // 1001000, 1001001, 1001010, 1001011, 1001100, 1001101, 1001110, 1001111, '0', '0', '0', '1', '.', '.', '6', '6', // 1010000, 1010001, 1010010, 1010011, 1010100, 1010101, 1010110, 1010111, '0', '0', '0', '.', '0', '2', '2', '6', // 1011000, 1011001, 1011010, 1011011, 1011100, 1011101, 1011110, 1011111, '3', '3', '3', '3', '4', '8', '8', '8', // 1100000, 1100001, 1100010, 1100011, 1100100, 1100101, 1100110, 1100111, '0', '0', '0', '2', '0', '0', '.', '6', // 1101000, 1101001, 1101010, 1101011, 1101100, 1101101, 1101110, 1101111, '3', '3', '3', '3', '0', '0', '.', '6', // 1110000, 1110001, 1110010, 1110011, 1110100, 1110101, 1110110, 1110111, '4', '4', '4', '4', '4', '4', '7', '8', // 1111000, 1111001, 1111010, 1111011, 1111100, 1111101, 1111110, 1111111, '4', '4', '4', '4', '7', '7', '8', '8' }; It would be worth trying different motor commands for the different patterns, and there's definitely room for improvement in the logic that determines whether a region is open (1) or blocked (0), also taking into consideration the mean and max pixel column measurements rather than just looking a zeros, but the basic approach is reasonable, and should yield a significant improvement over the original wander mode once the code is dialed in. Here's a link to the above-described code...
Posted Fri, 22 Sep 2006 14:12 | HTML Link | see additional stories ... |
||||