Nov 29, 2001
After around a week off after mapper was finished I kicked off the simulator.
Good start here is what I did
1) Imported QuadTree, ULinearAlgebra and uIDlist
2) Added to new classes, the model class and the GDI render class
3) Added load model, render model, rotate model.
4) Added zoom to the view window

Nov 30, 2001
1) Added realistic keyboard control for movement
Note did not backup

Dec 1, 2001a
1) Added basic colision detection which works.

Dec 1, 2001b
1) Collision detection above was flawed (mostly in one sub function), fixed most of the flaws (I hope).

Dec 2, 2001
1) Fixed further errors in the collision. Still have a problems with moving the model as close as possible
   to simulate a collision

Dec 3, 2001
1) Still working on collision. As it turns out there are too many special cases in my models
   Anyways one thing left to do
   With two parallel lines it works if the direction of motion is perpidicular to the lines
   Does not work if the motion is identicle to lines
   Does not work if the two parallel lines aren't even touching, because the slope is the same 
   It says they are the same.

Dec 4, 2001
1) Uhh seem to have fixed around 99% of all problems, and all of the problems with the find
   collision.  Since there still are problems I created a new safety check to see if the
   new position is valid.  If not move back the model

Dec 6, 2001
1) Started on the Bump Sensor class

Dec 13, 2001
1) Finished off the bump sensors more or less.  Need to add global get byte though.

Dec 14, 2001
1) Changed the rotate point to round instead of type casting double to long variables.
   Huge improvement with the way things look at 0,90,180,270 degrees etc
2) Added lots of the IR support


Dec 15, 2001
1) Added speed control for both rendering and simulation in two seperate threads that have
   the same regulation algorithm.  It somewhat works.  It a question whether to use this or the 
   potentionally smoother robot speed scaling, while keeping the sim running as fast as possible
2) Seperated the Render and Simulation EnumObject functionality because of the two threads conflicting

Dec 20, 2001
Must have missed a backup somewhere
1) Fixed speed control and render speed.
2) Added TimeElapse to the movement to smooth things
3) Created some of the Sonar functionality such as render and stretch beam

Dec 22, 2001
1) Fixed the stretch beam functions and got a lot of the sonar stuff to work. 
   Still need to make proper collision detection where the beam is extended to the collision point
   And the time elapse is adjusted.

Dec 23, 2001
1) Completed the sonar (more or less) Some problems though
   a) Some extra needed in the simulation function to prevent a lock up in release mode only?
   b) The beam that is shown collided isn't quite accurate using an old scale factor.  There
      might not be a better way to do this without a lot more work

Dec 24, 2001
1)Added a line clipping function which solves the GDI rendering problem when 
  the lines are big due to scaling
2) Added some optical mouse support, I don't know if it works.
3) Added default loading when the program first starts up.
4) Fixed the sonar routine in a few ways.  Added extra sampling so the beam would look
   Nicer under my half ass collision.  And fixed the lockup problem
5) Added follow model
6) Added a lot of options in the sim control dialog

Dec 26, 2001
1) Finally fixed problem with previous sonar beams,  Switched to using an array
   for the display and a linked list for the logic.
2) Fixed zoom in on center problem
3) Added in minimum sonar distance
4) Made the simcontrol dialog restore the focus of the main dialog when it is shut down
5) Finished perlimanary work on the shaft encoders
6) Switched from CRect to FRect for viewable area (quadtree coords) so it doesn't jitter
   when following the model.
7) Fixed problem with the IR picking up objects in the opposite direction

Dec 29, 2001
1) Fixed Quadtree rendering sending it the FRect instead of a CRect which causes rounding problems
2) Started adding some basic subsumption AI, somewhat works

Dec 31, 2001
1) Added subsumptions concept two which seems to work, at least on the simulator

Jan 1, 2002a (Last backup before DirectX added)
1) Added a dialog for all (most) of the subsumptions options
2) Added IR error
NOTE Error in code, change sendupdatemessge() from default to ondefault in ssuboptions

Jan 1, 2002b (First DirectX build)
1) note in project settings  /Yu"stdafx.h" had to be removed for it to compile (both release and debug)
(1) Fixed)
2) Fixed the jitter problem again.  This time I force all of the sensors to use the same center, instead
   of relying on the model center which may change during the rendering.
3) Started on the directX work

Jan 5, 2002
1) Starting Adding the static directX stuff (walls, floor, and roofs) seems to work
2) Added a bit of help support to show what accelerator keys are available

Jan 6, 2002
1) Adds the model, sonar and IR directX rendering
2) Tried to add decent cameras mode

Jan 7, 2002
1) Fixed 3DGame camera mode, and added chase camera mode.  Looks good

Jan 8, 2002
1) Fixed 3DGame camera mode further with a simpler model that works, 
2) Added in some IR color cycling which doesn't look that good.

Jan 9, 2002
1) Added in subsumption arcturn so it will turn at an arc and never lose the wall
2) Added in the fix from the mapper, with opening 3DRoofs.

Jan 10,13, 2002
1) Added in load model support
2) Started on the explorer AI

Jan 15, 2002
1) Huge improvements to the explorer AI follow wall module
2) Fixed clip line routine a bit
3) Added double buffer for the stats, slowed down the gdi rendering

Jan 21, 2002
1) Added support for robot inital position

Jan 23, 2002
1) New AI planned.  Old version archived with old release

Jan 24, 2002 (a)
1) The new AI of Jan 23, didn't work.  It borrowed to heavly on the old subsumption to have
   a chance.  This not working AI is archived under jan24
2) Started work on a new AI.

Jan 24, 2002
1) New Wall following based on rate of change implemented.  HUGE IMPROVEMENT!!!!
2) Things to do with this WF AI
   a) Set minimum and maximum averages
   b) Ignore and Log spikes (including distance of spikes for the stack)

Jan 25, 2002 (a)
1) Decided to do something easy, so I make the 3D rendering treads, pretty cool

Jan 25, 2002 (b)
1) Added the tread tranformation so they are in the right place.
2) Added an offset model so the base of the robot isn't in the center.

Jan 26, 2002 (a)
1) Fixed some problems with the shaft encoders, that I notices that didn't work because the treads
   looked funny.

Jan 27-28, 2002
1) Started on the AI Graph structure, got some basic rending going too.

Jan 27-28, 2002 (b)
1) Got some basic mapping to work.  Pretty nice

Jan 31, 2002 (a)
1) Added some code to prevent the robot from moving when in pauses for a break point
2) Added simulation multiplier to speed things up.
3) Rejigging the turning functionality in next version, so backing up.

Jan 31, 2002 (b)
1) Adjusting everything to make it more module according too the new state charts
    This should allow for the mapper and navigator modules to be swappable in the same code.

Feb 2,2002
1) Continued working on graphing, added render current position for the display graph,
2) Changed the paradigm for decision nodes, could link to other decision nodes, and are used
   to signify dead ends (e.i decision to go away from the dead ends.
3) Added save and load graphs
4) Added global cheat position
5) Added graph rulers

Feb 3, 2002
1) Added more information graphically about landmarks, in terms of the RoC and direction
2) Fixed stuff graphing stuff
3) Added a dampening parameter to stop occilations in long stretches

Feb 5, 2002
1) Refined initial detection for logging turns etc
2) Added the sonar API

Feb 6, 2002
1) Added in select nodes, for the graph
2) Last build before AI switch to mapping and navigating.

Feb 7, 2002
1) Adding dedicated mapping module
2) Adding more stuff for locating landmarks, such as a minimum landmark displacement.
3) Added a bit extra code to impose a minimum distance away from the wall, to stop creeping towards
    a Collision
4) Added unknown nodes (previous hazard nodes) both graph and rendering support
5) Added rendering for not explored hallways
6) Starting working on close loop functionality

Feb 8, 2002
1) Started work on the close loop stuff, doesn't work that well yet.

Feb 9, 2002
1) Fixed a few bugs, close loop seems to work correctly.
2) Added in shortest path routines.  Seem to work properly on a single loop

Feb 10,11 2002
1) Finally got to navigation, seem to work pretty well, a few bugs still to fix
	Right now around 95% chance of working, some minor bugs, that I couldn't find
	Some unknown node support too!!

Feb 12, 2002
1) Fixed minor bug with close loop.  I noticed that it doesn't work all of the time if the error is great
	changed error factor to 3 times propagation for good measure.  Seems to have fixed it.
2) Added max away from wall distance

Feb 14,2002
1) Added xp command dialog
2) Added new closes loop scheme
3) Finally seemed to get close loop to work at 100%
4) Tried to solve that mysterious wall collision bug I think LMState = LMStage1 doesn't 
	always occur of NavigationLandmark, and that is why the problem occurs.  Can't confirm it 
	though
5) Added lots of support for adding in a second loop.  Looks like it should work.  Need full support,
    even when the loop is closed once, to finish off the loop.


	4) Get the outside turn working.  Test it to map an outside loop
	5) Add the sonar collision detection to the front.  Also add a variable for foward collision
	6) Improve what happens after a collision

Feb 16,2002
1) Added continous mapping for the second loop until the goal loop
2) Fixed navigation error, when coming off a mapping session
3) Added clusting correction, Yes!! (when four decision nodes are clustered in a square)
4) Fixed some more bugs here and there
5) Added fuzzy logic to is loop closed, for a 3 out of 4 judgement.
6) Added print functionality for the graph
7) Could navigate between decision nodes

Feb 18,2002
1) Got most of the algamation working.  Note that it might not work in all cases, when always trying
   to close the loop.  This options could be disabled, and algamations only will occur at the end
2) I think I fixed the mysterious collision.  I think it was the XPFWcheckfor collision, not giving a good
   value of Stage1distance, causing the decision node not to be logged, further on because of error checking
3) Added outside style turn if possible front collision, may have to edit out though

Feb 21,2002
1) Changes the setup with the way the outside world communicates with the robot to make it
	easier to add wireless communication.

Feb 27, 2002
1) Added Ascii file saving and loading for a talbe in a header file, which makes it possible
   to preload maps on the embedded system

March 10,2002
1) Added some more meshes and 3D stuff for presentation


FINAL NOTES
	
	When a collision occurs there is no real good recovery.
	
	Need more robust unknown navigation, expecially when we can't turn 180 degrees back.

	Am not implementing outside loop algorithm because of ambeguis situations where a room appear 
	at the end of the hallway. Or a hallway branch.  Without much more sonar reading I can't tell 
	which way to go



	
Coordinate Shaft Encoders and Optical mouse, and motor speed with real robot
Add min value to IR,
Add min value to Sonar

Possible problems
Questionable edge detection, especially after turns
also when minor edges are detected.  Noise may cause large problems in this.
Notes: design decision not to make any special provision for small areas of change, for spikes, because it
looks too much like noise.

Notes
Had "toolbar" exception when the sonar was added.  Seems to be GDI clipping related
Actually I think it is closing the simulator while debugging.

Dec 23, 2001
a) Some extra needed in the simulation function to prevent a lock up in release mode only?
b) The beam that is shown collided isn't quite accurate using an old scale factor.  There
      might not be a better way to do this without a lot more work

