

File: Kemmel_Read_Me_R03.txt
R02 - 2011 Apr 07 - hdrake - TabbyCat Robots
R03 - 2011 Jul 24 - hdrake - TabbyCat Robots

****************************************************************************
Files referenced

Kemmel_Read_Me_R03.txt - this file

Description_Kemmel_Track_R03.txt - description of track and robots

Bill_of_Materials_Kemmel_Track_R03.txt - list of materials used to
	make track.


Robot WFCR is the small-wheel robot
-----------------------------------

Robot WHYY is the large-dual-wheel robot
----------------------------------------



For the Kemmel Straight - F1 Pass Recreation.
---------------------------------------------
WFCR_10_Kemmel.nxc
WFCR_Defines_Kemmel.h
WHYY_10_Kemmel.nxc
WHYY_Defines_Kemmel.h
NXC_Explr_Kemmel.h


For robot doing 4 practice laps of track.
-----------------------------------------
WFCR_20_Laps04.nxc
WFCR_Defines_Laps04.h
WHYY_20_Laps04.nxc
WHYY_Defines_Laps04.h
NXC_Explr_Laps04.h


Common Program Files
--------------------
NXC_Explr_Roadway.h
NXC_Explr_Roadway_Global_Variables.h
NXC_Explr_Line_Contrast_Discover.nxc
NXC_Explr_Display_Pathfind_Data.nxc


Zip File
--------
Kemmel_Line_Following_Project_R03.zip - contains all files above.


****************************************************************************
Related YouTube Videos
<http://www.youtube.com/watch?v=r8zh20PsiAI> - shows lane changing.
<http://www.youtube.com/watch?v=awrkmwdM1jc> - shows robot details.
<http://www.youtube.com/watch?v=H0g7U_GRUKc> - shows robot in pit lane.

Viewing these videos will probably make the following descriptions more
understandable.  (if a picture is worth a thousand words, then a video
must be worth 10,000 words.)
****************************************************************************
Overview
Kemmel is the name of a long straight at the Spa reacetrack in Belgium.  At
the Formula 1 race at Spa in 2000, on a damp track, Mika Hkkinen passed
Michael Schumacher, who in turn was passing Ricardo Zonta.  So, being both
an F1 fan and NXT fan, what better than to recreate this pass with NXT robots.

And Kemmel is also the name of my MOC for BrickFair 2011.  For several hours,
each day of the show, I will be recreating parts of an F1 race.  (Lots of
imagination required.)  And for several hours, the track will be open to
other registrants' line following robots.

Soon after starting, it was obvious that NXT-G wouldn't work, or at least not
easily and reliably, so NXC is used.

A requirement was that all intelligence for lane changes, pit stops, etc, be
in the program running on the NXT, and not in a human using a remote control.
This led to colored markers on the track to indicate to the robot, what lies
ahead on the track.

For the robot to change lanes, the robot must stop line following, traverse
some white space, then start looking for a new line to follow.  In places
there are helper lines, to guide the robot to the main line.


****************************************************************************
Code description
The zip file includes the NXC files and header files that create a program
that runs on the Kemmel racing robots.  Some of these files are common to
other NXT projects, and thus the pathnames in the #include directives.  The
files are included to give ideas.  If the files are used as is, the #include
directives may need editing.

Roadway is a line following project and includes several sub-projects.  These
are Kemmel, this project, Laps04, and a highway project, to simulate regular
streets with stop signs, intersections, etc.  The code is divided into files
to fit these various projects.  E.g., the file NXC_Explr_Roadway.h is used
for all projects, the file NXC_Explr_Kemmel.h is used by all robots in the
Kemmel project, and WFCR_Defines_Kemmel.h is used by the small wheeled robot in
the Kemmel project.  (Yes, my NXT bricks are named after NPR radio stations.)

The program is multi-threaded (multiple tasks).  In the main part of the
program, one thread watches for colored markers with the color sensor,
interprets these, and queues an action for the line-following thread.  The
line-following thread watches the left side of the line to-be-followed with
the light sensor, controls the motors, and executes the actions queued by 
first thread.

The files WFCR_10_Kemmel.nxc and WFCR_20_Laps04.nxc contains the function,
task main(), for the small wheeled robot.  The files WHYY_10_Kemmel.nxc
and WHYY_20_Laps04.nxc contains the function, task main(), for the large
dual wheeled robot.  These are the files to compile to create the rxe files.


****************************************************************************
Track description
See the file 
Description_Kemmel_Track_R03.txt, for a description of the track.


**************************************************************************
References
----------
I firmly believe in Isaac Newton's quote:
"If I have seen further it is only by standing on the shoulders of giants."
or "Give credit where credit's due."

My NXC line following code is from ideas in the NXT-G program LineFollowPro,
at http://www.nxtprograms.com/line_follower.
I could not find an author's name.

Lego Mindstorms NXT Power Programming
Robotics In C
Second Edition
John C. Hansen

Creating Cool Mindstorms NXT Robots
Daniele Benedettelli

An Introduction to ANSI C on Unix
Paul S. Wang

NXC Programmers Guide
June 8, 2010
by John Hansen
NXC
Version 1.2.1 r3

Programming LEGO NXT Robots using NXC
(beta 30 or higher)
(Version 2.2, June 7, 2007)
by Daniele Benedettelli
with revisions by John Hansen

The Lego Mindstorms NXT 2.0 Discovery Book
Laurens Valk


 