Sail Code

=Changelog= Sailcode Alpha 1 - first alpha, waiting for parsing to be ported

Sailcode Alpha 2 - the complete ported code, including all sailing functions. parsing imported, serial ported; some glitches with parsing; biggest ones are that the buffer fills faster than we read it; and the parsing cant handle when data is returned with nothing between commas

Sailcode Alpha 3 - systems test code, using only the parsing and serial code from sailcode alpha 2 and the pololu control to turn a motor according to the heading. no sailing logic functions.

Reliable_serial_data.pde - function to be used in Wind and Compass building on the simple method of reading from the serial port; empties the serial buffer and error checks the data

Sailcode Alpha 4 - a copy of alpha3 created when moving files around when opening with Arduino0022 software

Sailcode Alpha 5 - a merge of alpha3 with reliable serial data; contains the change structure of alpha3

Sailcode Alpha 6 - major update to alpha5 everything uses structs, sailing functions rewritten

=To do=


 * Fix the basics of the sailcode, which are commented


 * Look into interrupts - looked into, refuse to work with current sailcode for unknown reasons


 * Look into overwriting the compass/PB100 EEPROM


 * Check out the version control software on Version Control, there's a list of tasks on both Launchpad and Google Code
 * Look into RTOS

Current Functions in Sailcode 6
The below section is for maintaining documentation of the existing sailcode,

Guidelines to Porting

 * Ported code must be commented as much as possible... explain it for the next person please :D
 * indent with a tab
 * start at highest level functions and use dummy functions to get high level compiling and working; and fill in the lower level functions iteratively
 * do not change the reference file test4.c
 * one person will work on the main function and go downwards
 * some people can work from the bottom up
 * Once a complete function is ported and tested, upload it to dropbox
 * Use the arduino emulator to test code: elec299 course page
 * Put your name in the Comments/progress box of the table for the function you are working on
 * As you work (or at LEAST at the end of a session) fill in comments about main things you changed, what is working, what is not working

Variable (not flexible) Guidelines

 * ALL CAPS VARIABLES are constants
 * Caps On First Letter variables are globals
 * global variables should not have their names changed
 * functions should not have their names changed
 * lower case variables are local variables to a function
 * variables should be named variableOne with capital on second word if there are two words in a variable

=Using the ELEC299 Simulator=

See the Compilers and Simulators page.

=Porting 2009's code to Arduino=

On the dropbox account there is a pdf in Software 2010/11 -> Old Code folder called Complete.pdf. This is the documentation of the 2009/2010 code, and might be useful for reference.

Improvements

 * If necessary, extend TinyGPS to include all the NMEA sentences we need; this will save memory over using strtok, sscanf for parsing
 * Move to an interrupt-driven program; this should speed up execution time

=Function Building=

The following sections should be documented when writing functions: (copy this template to a section about the specific function)

Background Information
What does the function do; why is it used

Options Considered
A pros/cons for each option should at least be documented; more complicated decision matrices are also possible.

List of design criteria
 * fast
 * efficient
 * clear and easy to modify
 * modularized
 * appropriate complexness for problem
 * others appropriate to problem

Technical Details
Put any equations or analyses tools here; or complicated math.

What to do in Delays
How much time? fill it function (have a function that does different things depending on how much time is available)

Things to do:
 * Get more data and average it.
 * Zigbee to land (especially for testing)
 * some data might expire? (wind)
 * compute sub-waypoints (wide vs narrow tacks, narrowing tacks, leeway, limit lines, angle of attack)
 * velocity headers

Very Useful
These are links which were GREAT about the topic

Also Useful
Links that were either not as helpful, or not as on-topic but still related