|
Just teach it...
Interesting... Same approach we used.
Write 6 bytes of data to eeprom every other clock tick during training runs, play it back during autonomous mode. Using 5 of the banks for auto progs (plus one for init, one for main, and one utility).
Programmable on site, so we can adjust to conditions (we don't have the right carpeting) or partner strategy. Biggest difficulty is not driving it so hard during training that you get tread slips.
The utility allows us to see/massage the data after the fact, though we haven't actually done anything along those lines yet.
The addressing looks a little strange, but there is a method to my madness.
Dave
Serin COMA\COMB, INBAUD,
[oi_swA,oi_swB,rc_swA,PB_mode,sensor2,
p2_y,p1_y,p4_y,p3_y,delta_t]
if rc_sw4 = 0 or auton_mode = 1 then
if (time>>1)*6 < $6F0 then
Read (time>>1)*6, p1_y, p2_y, p3_y, p4_y, oi_swA, oi_swB
time = time +1 +delta_t
endif
else 'learn mode
if (time>>1)*6 < $6F0 then
write (time>>1)*6, p1_y, p2_y, p3_y, p4_y, oi_swA, oi_swB
time = time +1 +delta_t
endif
endif
if auto = 2 then
run 2 'dumper utilty
else
run 1 'process the data
endif
|