History | View | Annotate | Download (3.85 KB)
This is a working version of the code for the demo. It works on Bot 7, and partially on Bot 14. Due to the number of changes here, I'll list them by file:
traffic_navigation.hI added a #define for sendGraph, so its main won't be compiled unless defined. Uncomment the #define line at the top of this file to turn its main on. Make sure you also comment out the #define for main-new. Also, has the new #define for the node wireless packet type....
Added test map data encoding to intersectData.c. Fixe a whole bunch of stuff sothat at least this traffic_navigation compiles without warnings. Symlinked toneeded files in linefollow. Changed function declaration style. Addeddelclaration of read_line to analog.h. You're welcome. Fixed several #includes....
Added more functionality to database for mapping things.
Demo now MOSTLY WORKS. Yay. It just has trouble making turns and for some reason (which may be hardware caused) switches into intersection mode without a button press. It also needs barcodes. In order to run the demo, turn it on, press button 1 to make it stop at an intersection, and when it exits an intersection, press button 1 to make it go into highway mode, or button 2 to make it go into road mode. Highway mode only sometimes works, but not often.
Made compatibility of lineDrive.h and validTurns.h.
Changed the randomNumGen so that it stopps reading IR and does stuff with a seed. More random? Maybe.
Updated main to work for the demo. It now switches states properly, but button1 seems to trigger accidentally sometimes (but strangely consistently at the same point in the program). Also edited the random turn generator to use the rtc instead of a rangefinder for the seed.
Changed main and validTurns to get the test going. Should theoretically drive through the cloverleaf, switching between road and intersection mode, but has trouble following the line and keeps reading phantom barcodes.
Tested and finished the database and the valid turns and everything!
database: files: intersectData.c and intersectData.h database is an array defined in .h that stores all intersections right now it is defined for our demo map. it has an intialize function that is unique for each map and all...
Changed index of INTERSECTION variables and got rid of getCrossPos andgetCrossType that are being implemented in the database.
Separated the intersection constants from the turning constants, updated fuctions accordingly.
random character in one of those files...and the other needed a 7 instead of a 3...=D
Merged the types of doubles into the crossing type. Also fixed commentsthat were never updated and implements things of type DOUBLE as DOUBLE_T'sif you dont specify because DOUBLE_T is more safe.
tested validTurns.c and made it more compatible with the upcoming database.
GARS, source files aren't supposed to be executable. (now my ls output has the right colors!)
fixed priya's bugs, left her questionable sytlistic choices
see comments for validTurns.h
this is the actual code for the function validateTurn that takes a barcodeand returns an integer that corresponds to a valid turn.