diff -urdN ../Tekkotsu_2.2.1/Behaviors/BehaviorBase.h ./Behaviors/BehaviorBase.h
--- ../Tekkotsu_2.2.1/Behaviors/BehaviorBase.h	Mon Nov 15 17:46:19 2004
+++ ./Behaviors/BehaviorBase.h	Mon Nov 15 17:46:19 2004
@@ -113,7 +113,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controller.cc ./Behaviors/Controller.cc
--- ../Tekkotsu_2.2.1/Behaviors/Controller.cc	Sat Oct 16 21:16:10 2004
+++ ./Behaviors/Controller.cc	Sat Oct 16 21:16:10 2004
@@ -452,7 +452,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controller.h ./Behaviors/Controller.h
--- ../Tekkotsu_2.2.1/Behaviors/Controller.h	Wed Nov 10 20:45:31 2004
+++ ./Behaviors/Controller.h	Wed Nov 10 20:45:31 2004
@@ -211,7 +211,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/BatteryCheckControl.h ./Behaviors/Controls/BatteryCheckControl.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/BatteryCheckControl.h	Thu Oct  7 15:07:04 2004
+++ ./Behaviors/Controls/BatteryCheckControl.h	Thu Oct  7 15:07:04 2004
@@ -111,7 +111,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/BehaviorActivatorControl.h ./Behaviors/Controls/BehaviorActivatorControl.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/BehaviorActivatorControl.h	Thu Sep 25 11:26:10 2003
+++ ./Behaviors/Controls/BehaviorActivatorControl.h	Thu Sep 25 11:26:10 2003
@@ -62,7 +62,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/BehaviorReportControl.h ./Behaviors/Controls/BehaviorReportControl.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/BehaviorReportControl.h	Tue Nov 16 14:25:24 2004
+++ ./Behaviors/Controls/BehaviorReportControl.h	Tue Nov 16 14:25:24 2004
@@ -58,7 +58,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/BehaviorSwitchActivatorControl.h ./Behaviors/Controls/BehaviorSwitchActivatorControl.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/BehaviorSwitchActivatorControl.h	Thu Sep 25 11:26:10 2003
+++ ./Behaviors/Controls/BehaviorSwitchActivatorControl.h	Thu Sep 25 11:26:10 2003
@@ -54,7 +54,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/BehaviorSwitchControl.h ./Behaviors/Controls/BehaviorSwitchControl.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/BehaviorSwitchControl.h	Thu Nov 11 19:05:03 2004
+++ ./Behaviors/Controls/BehaviorSwitchControl.h	Thu Nov 11 19:05:03 2004
@@ -265,7 +265,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/ControlBase.cc ./Behaviors/Controls/ControlBase.cc
--- ../Tekkotsu_2.2.1/Behaviors/Controls/ControlBase.cc	Wed Nov  3 22:01:31 2004
+++ ./Behaviors/Controls/ControlBase.cc	Wed Nov  3 22:01:31 2004
@@ -411,7 +411,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/ControlBase.h ./Behaviors/Controls/ControlBase.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/ControlBase.h	Wed Nov  3 22:01:31 2004
+++ ./Behaviors/Controls/ControlBase.h	Wed Nov  3 22:01:31 2004
@@ -167,7 +167,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/DumpFileControl.h ./Behaviors/Controls/DumpFileControl.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/DumpFileControl.h	Thu Sep 25 11:26:10 2003
+++ ./Behaviors/Controls/DumpFileControl.h	Thu Sep 25 11:26:10 2003
@@ -40,7 +40,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/EventLogger.cc ./Behaviors/Controls/EventLogger.cc
--- ../Tekkotsu_2.2.1/Behaviors/Controls/EventLogger.cc	Wed Nov  3 22:01:32 2004
+++ ./Behaviors/Controls/EventLogger.cc	Wed Dec 22 18:53:34 2004
@@ -17,7 +17,7 @@
 		pushSlot(new NullControl(("[ ] "+tmp).c_str(),"Show/hide events from "+tmp));
 	}
 	pushSlot(NULL);
-	pushSlot(new ValueEditControl<unsigned int>("Verbosity","Controls verbosity level: 0=name,type; 1=0+duration,timestamp; 2=1+magnitude; 3=2+subclass info","Please enter a new verbosity level: 0=name,type; 1=0+duration,timestamp; 2=1+magnitude; 3=2+subclass info",&verbosity));
+	pushSlot(new ValueEditControl<unsigned int>("Verbosity","Controls verbosity level: 0=(gen,source,type); 1=0+gen_id,source_id,type_id; 2=1+duration,timestamp; 3=2+magnitude; additional columns may be added for subclass info","Please enter a new verbosity level: 0=(gen,source,type); 1=0+gen_id,source_id,type_id; 2=1+duration,timestamp; 3=2+magnitude; additional columns may be added for subclass info",&verbosity));
 	pushSlot(new ControlBase("[X] Console Output","If selected, outputs events to the console"));
 	pushSlot(new StringInputControl("[ ] File Output","Please enter the filename to log to (in /ms/...)"));
 }
@@ -109,8 +109,8 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/EventLogger.h ./Behaviors/Controls/EventLogger.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/EventLogger.h	Thu Oct  7 18:15:20 2004
+++ ./Behaviors/Controls/EventLogger.h	Thu Oct  7 18:15:20 2004
@@ -45,7 +45,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/FileBrowserControl.cc ./Behaviors/Controls/FileBrowserControl.cc
--- ../Tekkotsu_2.2.1/Behaviors/Controls/FileBrowserControl.cc	Wed Jan 14 15:43:43 2004
+++ ./Behaviors/Controls/FileBrowserControl.cc	Wed Jan 14 15:43:43 2004
@@ -158,7 +158,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/FileBrowserControl.h ./Behaviors/Controls/FileBrowserControl.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/FileBrowserControl.h	Wed Jan 14 15:43:44 2004
+++ ./Behaviors/Controls/FileBrowserControl.h	Wed Jan 14 15:43:44 2004
@@ -72,7 +72,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/FileInputControl.h ./Behaviors/Controls/FileInputControl.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/FileInputControl.h	Mon Mar 22 19:55:01 2004
+++ ./Behaviors/Controls/FileInputControl.h	Mon Mar 22 19:55:01 2004
@@ -48,7 +48,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/FreeMemReportControl.cc ./Behaviors/Controls/FreeMemReportControl.cc
--- ../Tekkotsu_2.2.1/Behaviors/Controls/FreeMemReportControl.cc	Thu Sep 25 11:26:11 2003
+++ ./Behaviors/Controls/FreeMemReportControl.cc	Thu Sep 25 11:26:11 2003
@@ -63,7 +63,7 @@
  * @author ejt (object), alokl (core function)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/FreeMemReportControl.h ./Behaviors/Controls/FreeMemReportControl.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/FreeMemReportControl.h	Wed Nov 10 20:45:35 2004
+++ ./Behaviors/Controls/FreeMemReportControl.h	Wed Nov 10 20:45:35 2004
@@ -66,7 +66,7 @@
  * @author ejt (object), alokl (core function)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/HelpControl.cc ./Behaviors/Controls/HelpControl.cc
--- ../Tekkotsu_2.2.1/Behaviors/Controls/HelpControl.cc	Tue Jul 13 20:50:26 2004
+++ ./Behaviors/Controls/HelpControl.cc	Wed Nov 17 19:04:16 2004
@@ -36,7 +36,12 @@
 	if(slots.size()>1)
 		numlen=(int)(log(slots.size()-1)/log(10))+1;
 #ifdef HelpControl_HTML_
-	sout->printf("<ol>\n");
+	unsigned int ngoodslots=0;
+	for(unsigned int i=0; i<slots.size(); i++)
+		if(slots[i]!=NULL)
+			ngoodslots++;
+	if(ngoodslots>0)
+		sout->printf("<ol>\n");
 #endif
 	for(unsigned int i=0; i<slots.size(); i++) {
 		if(slots[i]==NULL)
@@ -52,7 +57,7 @@
 		else
 			while(len>0 && !isspace(desc[len-1])) len--;
 #ifdef HelpControl_HTML_
-		fmt="%s<li><!--%*d--><code><b>%s</b>: %s";
+		fmt="%s<li value=\"%*d\"><code><b>%s</b>: %s";
 #else
 		if(config->main.use_VT100)
 			fmt="\33[1m%s%*d. %s\33[0m: %s\n";
@@ -89,7 +94,8 @@
 		report(slots[i],pre,depth_remain-1);
 	}
 #ifdef HelpControl_HTML_
-	sout->printf("</ol>\n");
+	if(ngoodslots>0)
+		sout->printf("</ol>\n");
 #endif
 }
 
@@ -98,9 +104,9 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/HelpControl.h ./Behaviors/Controls/HelpControl.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/HelpControl.h	Mon Jan 19 17:03:58 2004
+++ ./Behaviors/Controls/HelpControl.h	Mon Jan 19 17:03:58 2004
@@ -45,7 +45,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/LoadCalibration.h ./Behaviors/Controls/LoadCalibration.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/LoadCalibration.h	Wed Feb 25 20:02:25 2004
+++ ./Behaviors/Controls/LoadCalibration.h	Wed Feb 25 20:02:25 2004
@@ -86,7 +86,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/LoadPostureControl.h ./Behaviors/Controls/LoadPostureControl.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/LoadPostureControl.h	Sat Oct 16 21:16:10 2004
+++ ./Behaviors/Controls/LoadPostureControl.h	Sat Oct 16 21:16:10 2004
@@ -60,7 +60,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/LoadWalkControl.h ./Behaviors/Controls/LoadWalkControl.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/LoadWalkControl.h	Sat Jan 10 15:10:27 2004
+++ ./Behaviors/Controls/LoadWalkControl.h	Sat Jan 10 15:10:27 2004
@@ -56,7 +56,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/MCValueEditControl.h ./Behaviors/Controls/MCValueEditControl.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/MCValueEditControl.h	Thu Sep 25 11:26:11 2003
+++ ./Behaviors/Controls/MCValueEditControl.h	Thu Sep 25 11:26:11 2003
@@ -29,7 +29,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/NullControl.h ./Behaviors/Controls/NullControl.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/NullControl.h	Thu Sep 25 11:26:11 2003
+++ ./Behaviors/Controls/NullControl.h	Thu Sep 25 11:26:11 2003
@@ -32,7 +32,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/PlaySoundControl.h ./Behaviors/Controls/PlaySoundControl.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/PlaySoundControl.h	Thu Sep 25 11:26:11 2003
+++ ./Behaviors/Controls/PlaySoundControl.h	Thu Sep 25 11:26:11 2003
@@ -32,7 +32,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/PostureEditor.cc ./Behaviors/Controls/PostureEditor.cc
--- ../Tekkotsu_2.2.1/Behaviors/Controls/PostureEditor.cc	Mon Oct 18 15:53:02 2004
+++ ./Behaviors/Controls/PostureEditor.cc	Tue Dec 21 16:49:50 2004
@@ -3,21 +3,22 @@
 #include "Motion/EmergencyStopMC.h"
 #include "Motion/MotionSequenceMC.h"
 #include "Motion/LedMC.h"
+#include "SoundPlay/SoundManager.h"
 #include "Events/EventRouter.h"
 #include "ValueEditControl.h"
 #include "NullControl.h"
-#include "SoundPlay/SoundManager.h"
-
-typedef MotionSequenceMC<MotionSequence::SizeSmall> reach_t; //!< just to save some typing
+#include "StringInputControl.h"
+#include "FileInputControl.h"
 
 PostureEditor::PostureEditor(MotionManager::MC_ID estop_ID)
 	: ControlBase("Posture Editor","Allows you to load, save, and numerically edit the posture"), 
 	  pose(), reachID(MotionManager::invalid_MC_ID),
-	  estopID(estop_ID), lastSlot(NULL), loadPose(NULL), savePose(NULL), pauseCalled(false)
+	  estopID(estop_ID), loadPose(NULL), disabledLoadPose(NULL), savePose(NULL), pauseCalled(false)
 {
 	// add load and save menus
 	pushSlot(loadPose=new FileInputControl("Load Posture","Select a posture to open",config->motion.root));
 	loadPose->setFilter("*.pos");
+	disabledLoadPose=new NullControl("[Load disabled by EStop]","Cannot load new postures while EStop is active");
 	pushSlot(savePose=new StringInputControl("Save Posture","Please enter the filename to save to (in "+config->motion.root+")"));
 
 	// add submenu for weight editors
@@ -33,6 +34,12 @@
 		pushSlot(new ValueEditControl<float>(outputNames[i],&pose(i).value));
 }
 
+PostureEditor::~PostureEditor() {
+	delete loadPose;
+	delete disabledLoadPose;
+	options[0]=NULL;
+}
+
 ControlBase *
 PostureEditor::activate(MotionManager::MC_ID disp_id, Socket * gui) {
 	//cout << "activate" << endl;
@@ -42,7 +49,7 @@
 	for(unsigned int i=LEDOffset; i<LEDOffset+NumLEDs; i++)
 		pose.setOutputCmd(i,0);
 	// add it the motion sequence we'll be using to move to changes
-	SharedObject<reach_t> reach;
+	SharedObject<SmallMotionSequenceMC> reach;
 	reachID=motman->addPersistentMotion(reach);
 	// we'll need to know when estop is turned on or off
 	erouter->addListener(this,EventBase::estopEGID);
@@ -55,29 +62,31 @@
 	//cout << "refresh" << endl;
 	if(isEStopped()) {
 		erouter->addTimer(this,0,500);
-		options[0]=NULL;
+		options[0]=disabledLoadPose;
 	} else {
 		options[0]=loadPose;
 	}
-	if(lastSlot==loadPose) {
-		// we just got back from the load menu
+	if(loadPose->getLastInput().size()>0) {
 		pose.LoadFile(loadPose->getLastInput().c_str());
 		updatePose(moveTime);
-	} else if(lastSlot==savePose || savePose->getLastInput().size()>0) {
+		loadPose->clearLastInput();
+	} else if(savePose->getLastInput().size()>0) {
 		// we just got back from the save menu
-		pose.SaveFile(config->motion.makePath(savePose->getLastInput()).c_str());
+		std::string filename=savePose->getLastInput();
+		if(filename.find(".")==std::string::npos)
+			filename+=".pos";
+		pose.SaveFile(config->motion.makePath(filename).c_str());
 		savePose->takeInput("");
 	} else {
 		updatePose(moveTime/2);
 	}
-	lastSlot=NULL;
 	pauseCalled=false;
 	ControlBase::refresh();
 }
 
 void
 PostureEditor::pause() {
-	//cout << "paused" << endl;
+	refresh(); //one last time, in case this pause is due to un-estop putting Controller into low-profile mode
 	pauseCalled=true;
 	erouter->removeListener(this,EventBase::timerEGID);
 }
@@ -91,26 +100,18 @@
 	ControlBase::deactivate();
 }
 
-ControlBase*
-PostureEditor::doSelect() {
-	// record the option that is being selected, in case it's the load or save
-	lastSlot=options[hilights.front()];
-	// but do what we'd normally do (select that option)
-	return ControlBase::doSelect();
-}
-
 void
 PostureEditor::processEvent(const EventBase& e) {
 	if(e.getGeneratorID()==EventBase::estopEGID) {
 		if(e.getTypeID()==EventBase::deactivateETID) {
-			MMAccessor<reach_t>(reachID)->play();
+			MMAccessor<SmallMotionSequenceMC>(reachID)->play();
 			erouter->removeListener(this,EventBase::timerEGID);
 			if(!pauseCalled)
 				refresh();
 		} else {
 			if(!pauseCalled) {
-				erouter->addTimer(this,0,500);
-				processEvent(EventBase(EventBase::timerEGID,0,EventBase::statusETID));
+				erouter->addTimer(this,0,500); // timer to allow updates on joint positions
+				processEvent(EventBase(EventBase::timerEGID,0,EventBase::statusETID)); // but also do one right now
 			}
 		}
 	} else if(e.getGeneratorID()==EventBase::timerEGID) {
@@ -131,11 +132,11 @@
 void
 PostureEditor::updatePose(unsigned int delay) {
 	bool paused=isEStopped();
-	MMAccessor<reach_t> reach_acc(reachID);
+	MMAccessor<SmallMotionSequenceMC> reach_acc(reachID);
 	reach_acc->clear();
-	reach_acc->setPlayTime(delay);
+	reach_acc->setTime(delay);
 	reach_acc->setPose(pose);
-	reach_acc->setPlayTime(delay+100);
+	reach_acc->advanceTime(100);
 	reach_acc->setPose(pose);
 	if(paused)
 		reach_acc->pause();
@@ -149,8 +150,8 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/PostureEditor.h ./Behaviors/Controls/PostureEditor.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/PostureEditor.h	Mon Oct 18 15:53:02 2004
+++ ./Behaviors/Controls/PostureEditor.h	Thu Dec  2 13:48:56 2004
@@ -6,8 +6,6 @@
 #include "Shared/SharedObject.h"
 #include "Motion/PostureEngine.h"
 #include "Motion/MotionManager.h"
-#include "StringInputControl.h"
-#include "FileInputControl.h"
 #include "Events/EventListener.h"
 
 //! allows logging of events to the console or a file
@@ -16,14 +14,14 @@
 	//! constructor
 	explicit PostureEditor(MotionManager::MC_ID estop_ID);
 
+	//! destructor
+	virtual ~PostureEditor();
+
 	virtual ControlBase * activate(MotionManager::MC_ID disp_id, Socket * gui);
 	virtual void refresh(); //!< if we're back from a child slot, it's either load or save, so we need to handle it
 	virtual void pause();
 	virtual void deactivate();
 
-	//! opens a custom (embedded) menu edit outputs
-	virtual ControlBase* doSelect();
-	
 	//! listens for the EStop to be turned off before moving
 	virtual void processEvent(const EventBase& e);
 	
@@ -32,9 +30,9 @@
 	MotionManager::MC_ID reachID; //!< id of motion sequence used to slow "snapping" to positions
 	MotionManager::MC_ID estopID; //!< so we can check if the estop is active
 
-	ControlBase* lastSlot; //!< the last accessed slot
-	FileInputControl* loadPose; //!< the control for loading postures
-	StringInputControl* savePose; //!< the control for saving postures
+	class FileInputControl* loadPose; //!< the control for loading postures
+	class NullControl* disabledLoadPose; //!< a message to display instead of loadPose when EStop is on
+	class StringInputControl* savePose; //!< the control for saving postures
 	bool pauseCalled; //!< true if refresh hasn't been called since pause
 	
 	static const unsigned int moveTime=1500; //!< number of milliseconds to take to load a posture - individual joint changes will be done in half the time
@@ -52,10 +50,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/ProfilerCheckControl.h ./Behaviors/Controls/ProfilerCheckControl.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/ProfilerCheckControl.h	Thu Nov 11 15:34:59 2004
+++ ./Behaviors/Controls/ProfilerCheckControl.h	Thu Nov 11 15:34:59 2004
@@ -24,7 +24,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/RebootControl.cc ./Behaviors/Controls/RebootControl.cc
--- ../Tekkotsu_2.2.1/Behaviors/Controls/RebootControl.cc	Thu Sep 25 11:26:11 2003
+++ ./Behaviors/Controls/RebootControl.cc	Thu Sep 25 11:26:11 2003
@@ -12,7 +12,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/RebootControl.h ./Behaviors/Controls/RebootControl.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/RebootControl.h	Thu Sep 25 11:26:11 2003
+++ ./Behaviors/Controls/RebootControl.h	Thu Sep 25 11:26:11 2003
@@ -23,7 +23,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/RunSequenceControl.h ./Behaviors/Controls/RunSequenceControl.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/RunSequenceControl.h	Mon Oct 18 13:01:38 2004
+++ ./Behaviors/Controls/RunSequenceControl.h	Mon Oct 18 13:01:38 2004
@@ -77,7 +77,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/SavePostureControl.h ./Behaviors/Controls/SavePostureControl.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/SavePostureControl.h	Thu Jan 29 20:29:41 2004
+++ ./Behaviors/Controls/SavePostureControl.h	Thu Dec  2 16:29:45 2004
@@ -16,6 +16,8 @@
 	virtual ControlBase * takeInput(const std::string& msg) {
 		if(msg.size()>0) {
 			std::string filename;
+			if(filename.find(".")==std::string::npos)
+				filename+=".pos";
 			filename=config->motion.makePath(msg);
 			PostureEngine post;
 			post.takeSnapshot();
@@ -30,10 +32,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/SaveWalkControl.h ./Behaviors/Controls/SaveWalkControl.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/SaveWalkControl.h	Thu Mar 25 19:28:41 2004
+++ ./Behaviors/Controls/SaveWalkControl.h	Thu Dec  2 16:29:45 2004
@@ -19,6 +19,8 @@
 	virtual ControlBase * takeInput(const std::string& msg) {
 		if(msg.size()>0) {
 			std::string filename=config->motion.makePath(msg);
+			if(filename.find(".")==std::string::npos)
+				filename+=".prm";
 			MotionManager::MC_ID id = (thewalk==NULL ? walk_id : thewalk->getID() );
 			WalkMC* walk=thewalk;
 			if(id!=MotionManager::invalid_MC_ID)
@@ -47,9 +49,9 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 #endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/SensorObserverControl.cc ./Behaviors/Controls/SensorObserverControl.cc
--- ../Tekkotsu_2.2.1/Behaviors/Controls/SensorObserverControl.cc	Wed Nov  3 22:01:32 2004
+++ ./Behaviors/Controls/SensorObserverControl.cc	Wed Nov  3 22:01:32 2004
@@ -133,7 +133,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/SensorObserverControl.h ./Behaviors/Controls/SensorObserverControl.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/SensorObserverControl.h	Sun Jan 18 05:16:56 2004
+++ ./Behaviors/Controls/SensorObserverControl.h	Sun Jan 18 05:16:56 2004
@@ -53,7 +53,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/ShutdownControl.cc ./Behaviors/Controls/ShutdownControl.cc
--- ../Tekkotsu_2.2.1/Behaviors/Controls/ShutdownControl.cc	Thu Sep 25 11:26:11 2003
+++ ./Behaviors/Controls/ShutdownControl.cc	Thu Sep 25 11:26:11 2003
@@ -12,7 +12,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/ShutdownControl.h ./Behaviors/Controls/ShutdownControl.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/ShutdownControl.h	Thu Sep 25 11:26:11 2003
+++ ./Behaviors/Controls/ShutdownControl.h	Thu Sep 25 11:26:11 2003
@@ -23,7 +23,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/StringInputControl.cc ./Behaviors/Controls/StringInputControl.cc
--- ../Tekkotsu_2.2.1/Behaviors/Controls/StringInputControl.cc	Mon Jul 28 01:54:32 2003
+++ ./Behaviors/Controls/StringInputControl.cc	Mon Jul 28 01:54:32 2003
@@ -42,7 +42,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/StringInputControl.h ./Behaviors/Controls/StringInputControl.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/StringInputControl.h	Mon Mar 22 19:55:01 2004
+++ ./Behaviors/Controls/StringInputControl.h	Mon Mar 22 19:55:01 2004
@@ -44,7 +44,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/ToggleControl.h ./Behaviors/Controls/ToggleControl.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/ToggleControl.h	Mon Mar 22 19:55:01 2004
+++ ./Behaviors/Controls/ToggleControl.h	Mon Mar 22 19:55:01 2004
@@ -141,7 +141,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/ValueEditControl.h ./Behaviors/Controls/ValueEditControl.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/ValueEditControl.h	Thu Oct  7 15:07:04 2004
+++ ./Behaviors/Controls/ValueEditControl.h	Wed Dec 15 23:50:48 2004
@@ -133,6 +133,7 @@
 
 	virtual ControlBase * takeInput(const std::string& str) {
 		cur = (T)atof(str.c_str());
+		StringInputControl::takeInput(str);
 		return doSelect();
 	}
 
@@ -166,10 +167,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/ValueSetControl.h ./Behaviors/Controls/ValueSetControl.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/ValueSetControl.h	Sun Jan 18 05:16:56 2004
+++ ./Behaviors/Controls/ValueSetControl.h	Sun Jan 18 05:16:56 2004
@@ -50,7 +50,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/WalkCalibration.cc ./Behaviors/Controls/WalkCalibration.cc
--- ../Tekkotsu_2.2.1/Behaviors/Controls/WalkCalibration.cc	Wed Nov  3 22:01:32 2004
+++ ./Behaviors/Controls/WalkCalibration.cc	Wed Nov  3 22:01:32 2004
@@ -913,7 +913,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/WalkCalibration.h ./Behaviors/Controls/WalkCalibration.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/WalkCalibration.h	Thu Oct  7 15:07:04 2004
+++ ./Behaviors/Controls/WalkCalibration.h	Thu Oct  7 15:07:04 2004
@@ -124,7 +124,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/WaypointWalkControl.cc ./Behaviors/Controls/WaypointWalkControl.cc
--- ../Tekkotsu_2.2.1/Behaviors/Controls/WaypointWalkControl.cc	Wed Nov  3 22:01:32 2004
+++ ./Behaviors/Controls/WaypointWalkControl.cc	Thu Dec  2 16:29:45 2004
@@ -41,8 +41,11 @@
 void
 WaypointWalkControl::refresh() {
 	if(saveCtl->getLastInput().size()>0) {
-		sout->printf("Attempting save to %s...\n",saveCtl->getLastInput().c_str());
-		std::string path=config->motion.makePath(saveCtl->getLastInput());
+		std::string filename=saveCtl->getLastInput();
+		if(filename.find(".")==std::string::npos)
+			filename+=".wyp";
+		std::string path=config->motion.makePath(filename);
+		sout->printf("Attempting save to %s...\n",path.c_str());
 		MMAccessor<WaypointWalkMC>(walk_id)->SaveWaypointFile(path.c_str());
 		saveCtl->clearLastInput();
 	}
@@ -244,9 +247,9 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Controls/WaypointWalkControl.h ./Behaviors/Controls/WaypointWalkControl.h
--- ../Tekkotsu_2.2.1/Behaviors/Controls/WaypointWalkControl.h	Tue Jul 27 10:33:28 2004
+++ ./Behaviors/Controls/WaypointWalkControl.h	Tue Jul 27 10:33:28 2004
@@ -75,7 +75,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/ASCIIVisionBehavior.cc ./Behaviors/Demos/ASCIIVisionBehavior.cc
--- ../Tekkotsu_2.2.1/Behaviors/Demos/ASCIIVisionBehavior.cc	Tue Oct 19 12:37:00 2004
+++ ./Behaviors/Demos/ASCIIVisionBehavior.cc	Fri Dec  3 19:10:24 2004
@@ -4,7 +4,7 @@
 #include "Wireless/Socket.h"
 
 const char ASCIIVisionBehavior::charMap[ASCIIVisionBehavior::charMapSize] = {
-	' ','.','\'','`','^','"',',',':',';','~','-','!','i','l','I','>','<','+','?',')',
+	' ','.',',','\'','~','-','"','^',':',';','!','i','l','I','>','+','?',')',
 	'1',']','|','/','t','f','j','r','n','u','v','c','z','x','Y','U','J','C','L','Q',
 	'0','O','Z','X','m','w','q','p','d','b','k','h','a','o','*','#','M','W','&','8',
 	'%','B','$','@'
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/ASCIIVisionBehavior.h ./Behaviors/Demos/ASCIIVisionBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/ASCIIVisionBehavior.h	Wed Nov 10 20:45:35 2004
+++ ./Behaviors/Demos/ASCIIVisionBehavior.h	Wed Dec 22 20:47:06 2004
@@ -15,8 +15,8 @@
 	//! constructor
 	ASCIIVisionBehavior() : BehaviorBase("ASCIIVisionBehavior") {}
 
-	static const unsigned int charMapSize=64;
-	static const char charMap[charMapSize];
+	static const unsigned int charMapSize=62;  //!< the number of available characters for levels of "gray"
+	static const char charMap[charMapSize]; //!< the included characters sorted in order of darkness - could be improved... (less is more sometimes)
 
 	virtual void DoStart() {
 		BehaviorBase::DoStart(); // do this first
@@ -42,10 +42,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/AlanBehavior.h ./Behaviors/Demos/AlanBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/AlanBehavior.h	Wed Nov 10 20:45:35 2004
+++ ./Behaviors/Demos/AlanBehavior.h	Wed Nov 10 20:45:35 2004
@@ -115,7 +115,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/AutoGetupBehavior.h ./Behaviors/Demos/AutoGetupBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/AutoGetupBehavior.h	Wed Nov 10 20:45:35 2004
+++ ./Behaviors/Demos/AutoGetupBehavior.h	Tue Dec 21 15:29:07 2004
@@ -52,7 +52,7 @@
 				gu=config->motion.makePath("gu_back.mot");
 			else
 				gu=config->motion.makePath("gu_front.mot");
-			SharedObject< MotionSequenceMC<MotionSequence::SizeMedium> > getup(gu.c_str());
+			SharedObject<MediumMotionSequenceMC> getup(gu.c_str());
 			MotionManager::MC_ID id=motman->addPrunableMotion(getup,MotionManager::kHighPriority);
 			erouter->addListener(this,EventBase::motmanEGID,id,EventBase::deactivateETID);
 			waiting=true;
@@ -74,10 +74,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/BanditMachine.h ./Behaviors/Demos/BanditMachine.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/BanditMachine.h	Thu Nov 11 16:32:14 2004
+++ ./Behaviors/Demos/BanditMachine.h	Tue Dec 21 16:49:50 2004
@@ -21,14 +21,14 @@
 public:
 	//!constructor
 	BanditMachine()
-		: StateNode("BanditMachine","BanditMachine",NULL), stare(NULL), start(NULL), liedown(MotionManager::invalid_MC_ID), bandit(2)
+		: StateNode("BanditMachine","BanditMachine"), stare(NULL), start(NULL), liedown(MotionManager::invalid_MC_ID), bandit(2)
 	{
 		stare=new StareAtBallBehavior();
 		stare->AddReference();
 	}
 	//!constructor
-	BanditMachine(const char* n, StateNode* p=NULL)
-		: StateNode(n,p), stare(), start(NULL), liedown(MotionManager::invalid_MC_ID), bandit(2)
+	BanditMachine(const char* n)
+		: StateNode("BanditMachine",n), stare(), start(NULL), liedown(MotionManager::invalid_MC_ID), bandit(2)
 	{
 		stare=new StareAtBallBehavior();
 		stare->AddReference();
@@ -42,12 +42,12 @@
 	virtual std::string getDescription() const { return getClassDescription(); }
 
 	virtual void setup() {
-		StateNode *wait=start=addNode(new WaitNode("Wait",this,bandit));
-		StateNode *left=addNode(new PressNode("Left",this,LFrLegOffset+KneeOffset));
-		StateNode *right=addNode(new PressNode("Right",this,RFrLegOffset+KneeOffset));
-		StateNode *decide=addNode(new DecideNode("Decide",this,bandit,left,right));
-		StateNode *recoverl=addNode(new OutputNode("\nBadPressLeft",this,std::cout,wait));
-		StateNode *recoverr=addNode(new OutputNode("\nBadPressRight",this,std::cout,wait));
+		StateNode *wait=start=addNode(new WaitNode("Wait",bandit));
+		StateNode *left=addNode(new PressNode("Left",LFrLegOffset+KneeOffset));
+		StateNode *right=addNode(new PressNode("Right",RFrLegOffset+KneeOffset));
+		StateNode *decide=addNode(new DecideNode("Decide",bandit,left,right));
+		StateNode *recoverl=addNode(new OutputNode("\nBadPressLeft",std::cout,wait));
+		StateNode *recoverr=addNode(new OutputNode("\nBadPressRight",std::cout,wait));
 		left->addTransition(new SmoothCompareTrans<float>(wait,&state->pidduties[LFrLegOffset+RotatorOffset],CompareTrans<float>::LT,-.07,EventBase(EventBase::sensorEGID,SensorSourceID::UpdatedSID,EventBase::statusETID),.7));
 		right->addTransition(new SmoothCompareTrans<float>(wait,&state->pidduties[RFrLegOffset+RotatorOffset],CompareTrans<float>::LT,-.07,EventBase(EventBase::sensorEGID,SensorSourceID::UpdatedSID,EventBase::statusETID),.7));
 		wait->addTransition(new TimeOutTrans(decide,2000));
@@ -81,18 +81,17 @@
 	public:
 		//! constructor
 		/*! @param n name of the node
-		 *  @param p the parent node
 		 *  @param idx the joint index of the paw to move
 		 */
-		PressNode(const char* n, StateNode* p, unsigned int idx) : StateNode("PressNode",n,p), press_id(MotionManager::invalid_MC_ID), index(idx) {
-			SharedObject<MotionSequenceMC<MotionSequence::SizeSmall> > press;
-			press->setPlayTime(0);
+		PressNode(const char* n, unsigned int idx) : StateNode("PressNode",n), press_id(MotionManager::invalid_MC_ID), index(idx) {
+			SharedObject<SmallMotionSequenceMC> press;
+			press->setTime(0);
 			press->setOutputCmd(idx,.6);
-			press->setPlayTime(1);
+			press->setTime(1);
 			press->setOutputCmd(idx,.6);
-			press->setPlayTime(200);
+			press->setTime(200);
 			press->setOutputCmd(idx,.3);
-			press->setPlayTime(1500);
+			press->setTime(1500);
 			press->setOutputCmd(idx,outputRanges[idx][MinRange]);
 			press_id=motman->addPersistentMotion(press,MotionManager::kStdPriority+1);
 		}
@@ -102,16 +101,16 @@
 		}
 		virtual void DoStart() {
 			StateNode::DoStart();
-			MMAccessor<MotionSequenceMC<MotionSequence::SizeSmall> > press(press_id);
+			MMAccessor<SmallMotionSequenceMC> press(press_id);
 			press->play();
 			press->setOutputCmd(index,.6);
-			//			press->setPlaySpeed(1);
+			//			press->setSpeed(1);
 		}
 		virtual void DoStop() {
-			MMAccessor<MotionSequenceMC<MotionSequence::SizeSmall> > press(press_id);
-			//			press->setPlaySpeed(-1);
+			MMAccessor<SmallMotionSequenceMC> press(press_id);
+			//			press->setSpeed(-1);
 			press->pause();
-			press->setPlayTime(0);
+			press->setTime(0);
 			StateNode::DoStop();
 		}
 	protected:
@@ -124,13 +123,12 @@
 	public:
 		//! constructor
 		/*! @param n name of the node
-		 *  @param p the parent node
 		 *  @param bandito the decision making algorithm to use (look in karmedbandit.h)
 		 *  @param left the PressNode to go to if the left paw is chosen
 		 *  @param right the PressNode to go to if the right paw is chosen
 		 */
-		DecideNode(const char* n, StateNode* p, karmedbanditExp3_1& bandito, StateNode* left, StateNode* right)
-			: StateNode("DecideNode",n,p), b(bandito), l(left), r(right)
+		DecideNode(const char* n, karmedbanditExp3_1& bandito, StateNode* left, StateNode* right)
+			: StateNode("DecideNode",n), b(bandito), l(left), r(right)
 		{}
 		virtual void DoStart() {
 			StateNode::DoStart();
@@ -159,11 +157,10 @@
 	public:
 		//! constructor
 		/* @param n name to use for the node
-		 * @param p parent node
 		 * @param bandito the class to pass the reward to (if it comes)
 		 */
-		WaitNode(const char* n, StateNode* p, karmedbanditExp3_1& bandito)
-			: StateNode("WaitNode",n,p), b(bandito), reward(false), leds_id(MotionManager::invalid_MC_ID)
+		WaitNode(const char* n, karmedbanditExp3_1& bandito)
+			: StateNode("WaitNode",n), b(bandito), reward(false), leds_id(MotionManager::invalid_MC_ID)
 		{
 			leds_id=motman->addPersistentMotion(SharedObject<LedMC>());
 		}
@@ -217,10 +214,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/BatteryMonitorBehavior.h ./Behaviors/Demos/BatteryMonitorBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/BatteryMonitorBehavior.h	Wed Nov 10 20:45:35 2004
+++ ./Behaviors/Demos/BatteryMonitorBehavior.h	Wed Nov 10 20:45:35 2004
@@ -156,7 +156,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/CameraBehavior.cc ./Behaviors/Demos/CameraBehavior.cc
--- ../Tekkotsu_2.2.1/Behaviors/Demos/CameraBehavior.cc	Sat Oct 16 21:16:10 2004
+++ ./Behaviors/Demos/CameraBehavior.cc	Sat Oct 16 21:16:10 2004
@@ -196,7 +196,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/CameraBehavior.h ./Behaviors/Demos/CameraBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/CameraBehavior.h	Wed Nov 10 20:45:35 2004
+++ ./Behaviors/Demos/CameraBehavior.h	Wed Nov 10 20:45:35 2004
@@ -61,7 +61,7 @@
  * @author ejt (rewrite for new vision system)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/ChaseBallBehavior.cc ./Behaviors/Demos/ChaseBallBehavior.cc
--- ../Tekkotsu_2.2.1/Behaviors/Demos/ChaseBallBehavior.cc	Sat Oct 16 21:16:10 2004
+++ ./Behaviors/Demos/ChaseBallBehavior.cc	Sat Oct 16 21:16:10 2004
@@ -64,7 +64,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/ChaseBallBehavior.h ./Behaviors/Demos/ChaseBallBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/ChaseBallBehavior.h	Wed Nov 10 20:45:35 2004
+++ ./Behaviors/Demos/ChaseBallBehavior.h	Wed Nov 10 20:45:35 2004
@@ -37,7 +37,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/CrashTestBehavior.h ./Behaviors/Demos/CrashTestBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/CrashTestBehavior.h	Wed Nov 10 20:45:35 2004
+++ ./Behaviors/Demos/CrashTestBehavior.h	Wed Nov 10 20:45:35 2004
@@ -37,7 +37,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/DriveMeBehavior.cc ./Behaviors/Demos/DriveMeBehavior.cc
--- ../Tekkotsu_2.2.1/Behaviors/Demos/DriveMeBehavior.cc	Wed Nov 10 20:45:35 2004
+++ ./Behaviors/Demos/DriveMeBehavior.cc	Tue Dec 21 16:49:50 2004
@@ -25,7 +25,7 @@
     last_dx(0), last_dy(0), last_da(0), last_time(5000)
 {
   // Construct the standing up motion that the aibo does after it's done moving
-  stand->setPlayTime(700); // 700 milliseconds to stand up
+  stand->setTime(700); // 700 milliseconds to stand up
   stand->setPose(PostureEngine("/ms/data/motion/stand.pos"));
 }
 
@@ -60,7 +60,7 @@
   using namespace std;
 
   WalkMC *walker;
-  MotionSequenceMC<MotionSequence::SizeSmall> *standp;
+  SmallMotionSequenceMC *standp;
 
   // oh, OK, make sure it's a timer event
   if(event.getGeneratorID() != EventBase::timerEGID) return;
@@ -71,7 +71,7 @@
   motman->checkinMotion(walker_id);
 
   // Stand us up right now.
-  standp = (MotionSequenceMC<MotionSequence::SizeSmall>*)motman->checkoutMotion(stand_id);
+  standp = (SmallMotionSequenceMC*)motman->checkoutMotion(stand_id);
   standp->play();
   motman->checkinMotion(stand_id);
 
@@ -109,9 +109,9 @@
  * @author tss (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/DriveMeBehavior.h ./Behaviors/Demos/DriveMeBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/DriveMeBehavior.h	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Demos/DriveMeBehavior.h	Tue Dec 21 15:29:07 2004
@@ -26,7 +26,7 @@
 protected:
 	MotionManager::MC_ID walker_id; //!< walks
 	MotionManager::MC_ID stand_id;  //!< stands up first
-	SharedObject< MotionSequenceMC<MotionSequence::SizeSmall> > stand; //!< for standing
+	SharedObject<SmallMotionSequenceMC> stand; //!< for standing
 
 	double last_dx; //!< the last dx received
 	double last_dy; //!< the last dy received
@@ -39,10 +39,10 @@
  * @author tss (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/ExploreMachine.cc ./Behaviors/Demos/ExploreMachine.cc
--- ../Tekkotsu_2.2.1/Behaviors/Demos/ExploreMachine.cc	Wed Dec 31 19:00:00 1969
+++ ./Behaviors/Demos/ExploreMachine.cc	Fri Dec  3 19:10:38 2004
@@ -0,0 +1,79 @@
+#include "ExploreMachine.h"
+#include "Behaviors/Nodes/WalkNode.h"
+#include "Behaviors/Transitions/SmoothCompareTrans.h"
+#include "Behaviors/Transitions/TimeOutTrans.h"
+#include "Shared/ERS210Info.h"
+#include "Shared/ERS220Info.h"
+#include "Shared/ERS7Info.h"
+#include "Wireless/Socket.h"
+#include "Shared/WorldState.h"
+
+void ExploreMachine::setup() {
+	//cout << "Explore SETUP " << issetup << "...";
+	unsigned int IRDistOffset;
+	if(state->robotDesign&WorldState::ERS210Mask)
+		IRDistOffset=ERS210Info::IRDistOffset;
+	else if(state->robotDesign&WorldState::ERS220Mask)
+		IRDistOffset=ERS220Info::IRDistOffset;
+	else if(state->robotDesign&WorldState::ERS7Mask)
+		IRDistOffset=ERS7Info::NearIRDistOffset;
+	else {
+		serr->printf("ExploreMachine: Unsupported model!\n");
+		return;
+	}
+
+	SharedObject<WalkMC> walk;
+	walkid=motman->addPersistentMotion(walk);
+
+	WalkNode * move=NULL;
+	addNode(move=new WalkNode(getName()+"::move",150,0,0));
+	move->setWalkID(walkid);
+	start=addNode(turn=new WalkNode(getName()+"::turn",0,0,0.5f));
+	turn->setWalkID(walkid);
+
+	move->addTransition(new SmoothCompareTrans<float>(turn,&state->sensors[IRDistOffset],CompareTrans<float>::LT,350,EventBase(EventBase::sensorEGID,SensorSourceID::UpdatedSID,EventBase::statusETID),.7));
+	turn->addTransition(new TimeOutTrans(move,2000));
+
+	StateNode::setup();
+	//cout << issetup << endl;
+}
+
+void ExploreMachine::DoStart() {
+	StateNode::DoStart();
+	start->DoStart();
+	//erouter->addListener(this,EventBase::sensorEGID,SensorSourceID::UpdatedSID);
+	erouter->addListener(this,EventBase::stateMachineEGID,(unsigned int)turn,EventBase::activateETID);
+}
+
+void ExploreMachine::DoStop() {
+	erouter->removeListener(this);
+	StateNode::DoStop();
+}
+
+void ExploreMachine::teardown() {
+	//cout << "Explore TEARDOWN " << issetup << "...";
+	motman->removeMotion(walkid);
+	StateNode::teardown();
+	//cout << issetup << endl;
+}
+
+void ExploreMachine::processEvent(const EventBase& /*e*/) {
+	//sout->printf("IR: %g\n",state->sensors[IRDistOffset]);
+	float vel=rand()/(float)RAND_MAX*2.0f-1;
+	if(vel<0)
+		vel-=.25;
+	if(vel>0)
+		vel+=.25;
+	turn->setAVelocity(vel);
+}
+
+/*! @file
+ * @brief Describes ExploreMachine, a state machine for exploring an environment (or searching for an object)
+ * @author ejt (Creator)
+ *
+ * $Author: ejt $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
+ * $State: Exp $
+ * $Date: 2004/12/23 08:41:24 $
+ */
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/ExploreMachine.h ./Behaviors/Demos/ExploreMachine.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/ExploreMachine.h	Thu Nov 11 16:32:14 2004
+++ ./Behaviors/Demos/ExploreMachine.h	Fri Dec  3 19:10:38 2004
@@ -3,13 +3,7 @@
 #define INCLUDED_ExploreMachine_h_
 
 #include "Behaviors/StateNode.h"
-#include "Behaviors/Nodes/WalkNode.h"
-#include "Behaviors/Transitions/SmoothCompareTrans.h"
-#include <stdlib.h>
-#include "Shared/ERS210Info.h"
-#include "Shared/ERS220Info.h"
-#include "Shared/ERS7Info.h"
-#include "Wireless/Socket.h"
+#include "Motion/MotionManager.h"
 
 //! A state machine for exploring an environment (or searching for an object)
 class ExploreMachine : public StateNode {
@@ -17,79 +11,24 @@
 	//!constructor
 	ExploreMachine()
 		: StateNode("ExploreMachine","ExploreMachine"), start(NULL), turn(NULL), walkid(MotionManager::invalid_MC_ID)
-	{
-		setRetain(false);
-	}
+	{}
 
 	//!constructor
-	ExploreMachine(const std::string& nm, StateNode* p=NULL)
-		: StateNode("ExploreMachine",nm,p), start(NULL), turn(NULL), walkid(MotionManager::invalid_MC_ID)
-	{
-		setRetain(false);
-	}
-
-	virtual void setup() {
-		//cout << "Explore SETUP " << issetup << "...";
-		unsigned int IRDistOffset;
-		if(state->robotDesign&WorldState::ERS210Mask)
-			IRDistOffset=ERS210Info::IRDistOffset;
-		else if(state->robotDesign&WorldState::ERS220Mask)
-			IRDistOffset=ERS220Info::IRDistOffset;
-		else if(state->robotDesign&WorldState::ERS7Mask)
-			IRDistOffset=ERS7Info::NearIRDistOffset;
-		else {
-			serr->printf("ExploreMachine: Unsupported model!\n");
-			return;
-		}
-
-		SharedObject<WalkMC> walk;
-		walkid=motman->addPersistentMotion(walk);
-		WalkNode * move=NULL;
-		start=addNode(turn=new WalkNode(0,0,0.5f,this));
-		turn->setName(getName()+"::turn");
-		addNode(move=new WalkNode(150,0,0,this));
-		move->setName(getName()+"::move");
-		turn->addTransition(new TimeOutTrans(move,2000));
-		move->addTransition(new SmoothCompareTrans<float>(turn,&state->sensors[IRDistOffset],CompareTrans<float>::LT,350,EventBase(EventBase::sensorEGID,SensorSourceID::UpdatedSID,EventBase::statusETID),.7));
-		turn->setWalkID(walkid);
-		move->setWalkID(walkid);
-		StateNode::setup();
-		
-		//cout << issetup << endl;
-	}
-
-	virtual void DoStart() {
-		StateNode::DoStart();
-		start->DoStart();
-		//erouter->addListener(this,EventBase::sensorEGID,SensorSourceID::UpdatedSID);
-		erouter->addListener(this,EventBase::stateMachineEGID,(unsigned int)turn);
-	}
-
-	virtual void DoStop() {
-		erouter->removeListener(this);
-		StateNode::DoStop();
-	}
+	ExploreMachine(const std::string& nm)
+		: StateNode("ExploreMachine",nm), start(NULL), turn(NULL), walkid(MotionManager::invalid_MC_ID)
+	{}
 
-	virtual void teardown() {
-		//cout << "Explore TEARDOWN " << issetup << "...";
-		motman->removeMotion(walkid);
-		StateNode::teardown();
-		//cout << issetup << endl;
-	}
+	virtual void setup();
+	virtual void DoStart();
+	virtual void DoStop();
+	virtual void teardown();
 
-	virtual void processEvent(const EventBase& /*e*/) {
-		//sout->printf("IR: %g\n",state->sensors[IRDistOffset]);
-		float vel=rand()/(float)RAND_MAX*2.0f-1;
-		if(vel<0)
-			vel-=.25;
-		if(vel>0)
-			vel+=.25;
-		turn->setAVelocity(vel);
-	}
+	//! called each time the turn node is activated, sets a new random turn direction and speed
+	virtual void processEvent(const EventBase& /*e*/);
 
 protected:
 	StateNode * start; //!< the node to begin within on DoStart() (turn)
-	WalkNode * turn; //!< walk node to use when turning
+	class WalkNode * turn; //!< walk node to use when turning
 	MotionManager::MC_ID walkid; //!< we want to share a walk between turning and walking nodes
 
 private:
@@ -102,10 +41,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/FollowHeadBehavior.h ./Behaviors/Demos/FollowHeadBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/FollowHeadBehavior.h	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Demos/FollowHeadBehavior.h	Wed Nov 10 20:45:36 2004
@@ -54,7 +54,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/FreezeTestBehavior.h ./Behaviors/Demos/FreezeTestBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/FreezeTestBehavior.h	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Demos/FreezeTestBehavior.h	Wed Nov 10 20:45:36 2004
@@ -42,7 +42,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/GroundPlaneBehavior.h ./Behaviors/Demos/GroundPlaneBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/GroundPlaneBehavior.h	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Demos/GroundPlaneBehavior.h	Wed Dec 22 20:47:06 2004
@@ -75,7 +75,9 @@
 	virtual std::string getDescription() const { return getClassDescription(); }
 	
 protected:
-	EventBase head_release, head_lock, clock;
+	EventBase head_release; //!< event template to match to signal the head's PID joints should be relaxed
+	EventBase head_lock;    //!< event template to match to signal the head's PID joints should be powered up again
+	EventBase clock;        //!< event template to match to signal a new round of calculations should be performed
 };
 
 /*! @file
@@ -83,10 +85,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/HeadLevelBehavior.h ./Behaviors/Demos/HeadLevelBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/HeadLevelBehavior.h	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Demos/HeadLevelBehavior.h	Wed Nov 10 20:45:36 2004
@@ -85,7 +85,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/HelloWorldBehavior.h ./Behaviors/Demos/HelloWorldBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/HelloWorldBehavior.h	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Demos/HelloWorldBehavior.h	Wed Nov 10 20:45:36 2004
@@ -50,7 +50,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/KinematicSampleBehavior.h ./Behaviors/Demos/KinematicSampleBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/KinematicSampleBehavior.h	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Demos/KinematicSampleBehavior.h	Wed Dec 22 20:47:06 2004
@@ -87,8 +87,8 @@
 				}
 			
 			//If you would like to verify the positiions of the back toes... (relative to body center)
-			//cout << "L: " << kine->getFrameInterestPoint(BaseFrameOffset,"ToeLBkPaw").t();
-			//cout << "R: " << kine->getFrameInterestPoint(BaseFrameOffset,"ToeRBkPaw").t();
+			//cout << "L: " << kine->getJointInterestPoint(BaseFrameOffset,"ToeLBkPaw").t();
+			//cout << "R: " << kine->getJointInterestPoint(BaseFrameOffset,"ToeRBkPaw").t();
 			
 		} else {
 			serr->printf("KinematicSampleBehavior: Unhandled event %s\n",e.getName().c_str());
@@ -99,12 +99,13 @@
 	virtual std::string getDescription() const { return getClassDescription(); }
 	
 protected:
+	//! returns the index of the knee for the requested @a leg
 	unsigned int getIndex(LegOrder_t leg) {
 		//or try: return PawFrameOffset+leg;
 		return LegOffset+leg*JointsPerLeg+KneeOffset;
 	}
-	LegOrder_t lastLeg;
-	MotionManager::MC_ID poseID;
+	LegOrder_t lastLeg; //!< the last leg to have its button pressed, i.e. the "source"
+	MotionManager::MC_ID poseID; //!< the PostureMC which does all the computation
 };
 
 /*! @file
@@ -112,10 +113,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/KinematicSampleBehavior2.h ./Behaviors/Demos/KinematicSampleBehavior2.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/KinematicSampleBehavior2.h	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Demos/KinematicSampleBehavior2.h	Wed Dec 22 20:47:06 2004
@@ -66,13 +66,13 @@
 			NEWMAT::ColumnVector obj(4);
 			switch(lastLeg) {
 			case LFrLegOrder:
-				obj=kine->getFrameInterestPoint(BaseFrameOffset,"LowerInnerBackLFrThigh,LowerOuterBackLFrThigh"); break;
+				obj=kine->getJointInterestPoint(BaseFrameOffset,"LowerInnerBackLFrThigh,LowerOuterBackLFrThigh"); break;
 			case RFrLegOrder:
-				obj=kine->getFrameInterestPoint(BaseFrameOffset,"LowerInnerBackRFrThigh,LowerOuterBackRFrThigh"); break;
+				obj=kine->getJointInterestPoint(BaseFrameOffset,"LowerInnerBackRFrThigh,LowerOuterBackRFrThigh"); break;
 			case LBkLegOrder:
-				obj=kine->getFrameInterestPoint(BaseFrameOffset,"LowerInnerFrontLBkThigh"); break;
+				obj=kine->getJointInterestPoint(BaseFrameOffset,"LowerInnerFrontLBkThigh"); break;
 			case RBkLegOrder:
-				obj=kine->getFrameInterestPoint(BaseFrameOffset,"LowerInnerFrontRBkThigh"); break;
+				obj=kine->getJointInterestPoint(BaseFrameOffset,"LowerInnerFrontRBkThigh"); break;
 			}
 			if(obj(4)!=1)
 				return;
@@ -108,13 +108,13 @@
 			NEWMAT::ColumnVector obj(4);
 			switch(lastLeg) {
 			case LFrLegOrder:
-				obj=kine->getFrameInterestPoint(BaseFrameOffset,"LowerLeftBackLFrShin,LowerRightBackLFrShin"); break;
+				obj=kine->getJointInterestPoint(BaseFrameOffset,"LowerLeftBackLFrShin,LowerRightBackLFrShin"); break;
 			case RFrLegOrder:
-				obj=kine->getFrameInterestPoint(BaseFrameOffset,"LowerLeftBackRFrShin,LowerRightBackRFrShin"); break;
+				obj=kine->getJointInterestPoint(BaseFrameOffset,"LowerLeftBackRFrShin,LowerRightBackRFrShin"); break;
 			case LBkLegOrder:
-				obj=kine->getFrameInterestPoint(BaseFrameOffset,"ToeLBkPaw"); break;
+				obj=kine->getJointInterestPoint(BaseFrameOffset,"ToeLBkPaw"); break;
 			case RBkLegOrder:
-				obj=kine->getFrameInterestPoint(BaseFrameOffset,"ToeRBkPaw"); break;
+				obj=kine->getJointInterestPoint(BaseFrameOffset,"ToeRBkPaw"); break;
 			}
 			if(obj(4)!=1)
 				return;
@@ -139,11 +139,11 @@
 			pose_acc->solveLinkPosition(obj,solveLink,link);
 
 			//If you would like to verify the positiions of the back toes... (relative to body center)
-			//cout << "L: " << kine->getFrameInterestPoint(BaseFrameOffset,"ToeLBkPaw").t();
-			//cout << "R: " << kine->getFrameInterestPoint(BaseFrameOffset,"ToeRBkPaw").t();
-			//cout << "Toe: " << pose_acc->getFrameInterestPoint(BaseFrameOffset,"ToeLBkPaw").t();
-			//cout << "PawA: " << pose_acc->getFrameInterestPoint(BaseFrameOffset,"LBkPaw").t();
-			//cout << "PawB: " << (pose_acc->frameToFrame(PawFrameOffset+LBkLegOrder,BaseFrameOffset)*Kinematics::pack(0,0,0)).t();
+			//cout << "L: " << kine->getJointInterestPoint(BaseFrameOffset,"ToeLBkPaw").t();
+			//cout << "R: " << kine->getJointInterestPoint(BaseFrameOffset,"ToeRBkPaw").t();
+			//cout << "Toe: " << pose_acc->getJointInterestPoint(BaseFrameOffset,"ToeLBkPaw").t();
+			//cout << "PawA: " << pose_acc->getJointInterestPoint(BaseFrameOffset,"LBkPaw").t();
+			//cout << "PawB: " << (pose_acc->jointToJoint(PawFrameOffset+LBkLegOrder,BaseFrameOffset)*Kinematics::pack(0,0,0)).t();
 			
 		} else {
 			serr->printf("KinematicSampleBehavior2: Unhandled event %s\n",e.getName().c_str());
@@ -154,8 +154,8 @@
 	virtual std::string getDescription() const { return getClassDescription(); }
 	
 protected:
-	LegOrder_t lastLeg;
-	MotionManager::MC_ID poseID;
+	LegOrder_t lastLeg; //!< the last leg to have its button pressed, i.e. the "source"
+	MotionManager::MC_ID poseID; //!< the PostureMC which does all the computation
 };
 
 /*! @file
@@ -163,10 +163,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/LookForSoundBehavior.h ./Behaviors/Demos/LookForSoundBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/LookForSoundBehavior.h	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Demos/LookForSoundBehavior.h	Wed Dec 22 20:47:06 2004
@@ -62,11 +62,22 @@
 		}
 	}
 
-	static std::string getClassDescription() { return "Looking for Sound Behavior Class"; }
+	static std::string getClassDescription() { return "Turns head to sound source, estimated by average volume difference between left and right ears"; }
 	virtual std::string getDescription() const { return getClassDescription(); }
 	
 protected:
-	MotionManager::MC_ID mc_id;
+	MotionManager::MC_ID mc_id; //!< the id of the HeadPointerMC which does the looking
 };
+
+/*! @file
+ * @brief Defines LookForSoundBehavior, which turns head to sound source, estimated by average volume difference between left and right ears
+ * @author Paris Smaragdis (paris AT media mit edu) (Creator)
+ *
+ * $Author: ejt $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
+ * $State: Exp $
+ * $Date: 2004/12/23 08:41:24 $
+ */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/MCRepeater.h ./Behaviors/Demos/MCRepeater.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/MCRepeater.h	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Demos/MCRepeater.h	Wed Nov 10 20:45:36 2004
@@ -46,7 +46,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/MotionStressTestBehavior.h ./Behaviors/Demos/MotionStressTestBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/MotionStressTestBehavior.h	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Demos/MotionStressTestBehavior.h	Wed Dec 22 20:47:07 2004
@@ -17,8 +17,8 @@
 	virtual void DoStart() {
 		BehaviorBase::DoStart(); // do this first
 
-		SharedObject<MotionSequenceMC<MotionSequence::SizeSmall> > ms;
-		ms->setPlayTime(3000);
+		SharedObject<SmallMotionSequenceMC> ms;
+		ms->setTime(3000);
 		ms->setOutputCmd(LFrLegOffset+ElevatorOffset,outputRanges[LFrLegOffset+ElevatorOffset][MaxRange]);
 		ms->setOutputCmd(RFrLegOffset+ElevatorOffset,outputRanges[RFrLegOffset+ElevatorOffset][MaxRange]);
 		ms->setOutputCmd(LBkLegOffset+ElevatorOffset,outputRanges[LBkLegOffset+ElevatorOffset][MaxRange]);
@@ -62,12 +62,12 @@
 
 	void addMS(LegOrder_t leg,unsigned int delay=0) {
 		unsigned int index=leg*JointsPerLeg+RotatorOffset;
-		SharedObject<MotionSequenceMC<MotionSequence::SizeSmall> > ms;
-		ms->setPlayTime(delay);
+		SharedObject<SmallMotionSequenceMC> ms;
+		ms->setTime(delay);
 		ms->setOutputCmd(index,outputRanges[index][MaxRange]);
-		ms->setPlayTime(delay+2000);
+		ms->advanceTime(2000);
 		ms->setOutputCmd(index,outputRanges[index][MinRange]);
-		ms->setPlayTime(delay+4000);
+		ms->advanceTime(4000);
 		ms->setOutputCmd(index,outputRanges[index][MaxRange]);
 		MotionManager::MC_ID id=motman->addPrunableMotion(ms);
 		curMotions.push(id);
@@ -78,8 +78,8 @@
 	virtual std::string getDescription() const { return getClassDescription(); }
 	
 protected:
-	LegOrder_t nextLeg;
-	std::queue<MotionManager::MC_ID> curMotions;
+	LegOrder_t nextLeg; //!< the next leg to start moving
+	std::queue<MotionManager::MC_ID> curMotions; //!< a queue of IDs of SmallMotionSequenceMC's
 };
 
 /*! @file
@@ -87,10 +87,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/PaceTargetsMachine.cc ./Behaviors/Demos/PaceTargetsMachine.cc
--- ../Tekkotsu_2.2.1/Behaviors/Demos/PaceTargetsMachine.cc	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Demos/PaceTargetsMachine.cc	Tue Dec 21 15:29:07 2004
@@ -1,6 +1,6 @@
 #include "PaceTargetsMachine.h"
 #include "Behaviors/Transition.h"
-#include "WalkToTargetMachine.h"
+#include "Behaviors/Nodes/WalkToTargetNode.h"
 #include "Behaviors/Nodes/WalkNode.h"
 #include "ExploreMachine.h"
 #include "Behaviors/Transitions/TimeOutTrans.h"
@@ -13,20 +13,20 @@
 void PaceTargetsMachine::setup() {
 	StateNode::setup();
 
-	WalkNode * turnAround = new WalkNode(0,0,1,this);
+	WalkNode * turnAround = new WalkNode(0,0,1);
 	turnAround->setName(getName()+"::TurnAround");
 	addNode(turnAround);
 
-	GroupNode * explGrp = new GroupNode(getName()+"::ExplGroup",this);
+	GroupNode * explGrp = new GroupNode(getName()+"::ExplGroup");
 	addNode(explGrp);
 	{
-		ExploreMachine * explore = new ExploreMachine(explGrp->getName()+"::Explore",explGrp);
+		ExploreMachine * explore = new ExploreMachine(explGrp->getName()+"::Explore");
 		explGrp->addNode(explore);
-		PlayMotionSequenceNode<MotionSequence::SizeSmall> * panhead = new PlayMotionSequenceNode<MotionSequence::SizeSmall>(explGrp->getName()+"::PanHead",explGrp,"/ms/data/motion/pan_head.mot",true);
+		SmallPlayMotionSequenceNode * panhead = new SmallPlayMotionSequenceNode(explGrp->getName()+"::PanHead","/ms/data/motion/pan_head.mot",true);
 		explGrp->addNode(panhead);
 	}
 
-	WalkToTargetMachine * chase = new WalkToTargetMachine(ProjectInterface::visPinkBallSID,turnAround,explGrp,this);
+	WalkToTargetNode * chase = new WalkToTargetNode(ProjectInterface::visPinkBallSID);
 	chase->setName(getName()+"::Chase");
 	addNode(chase);
 
@@ -39,16 +39,18 @@
 	explGrp->addTransition(tmptrans=new VisualTargetTrans(chase,ProjectInterface::visPinkBallSID));
 	tmptrans->setSound("cutey.wav");
 
+	//if you lose it, explore some more
+	chase->addTransition(tmptrans=chase->newDefaultLostTrans(explGrp));
+	tmptrans->setSound("whimper.wav");
+	
+	//if you get there, turn around
+	chase->addTransition(tmptrans=chase->newDefaultCloseTrans(turnAround));
+	tmptrans->setSound("fart.wav");
+	
 	//once you've turned around, explore
 	turnAround->addTransition(tmptrans=new TimeOutTrans(explGrp,3500));
 	tmptrans->setSound("barkmed.wav");
-
-	//add some more sounds
-	//!@todo extract these transitions from within chase - i don't like this way of doing things anymore...
-	chase->setup();
-	chase->getLostTrans()->setSound("whimper.wav");
-	chase->getCloseTrans()->setSound("fart.wav");
-
+	
 	//preload the sounds so we don't pause on tranisitions
 	sndman->LoadFile("cutey.wav");
 	sndman->LoadFile("barkmed.wav");
@@ -75,9 +77,9 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/PaceTargetsMachine.h ./Behaviors/Demos/PaceTargetsMachine.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/PaceTargetsMachine.h	Thu Nov 11 16:32:14 2004
+++ ./Behaviors/Demos/PaceTargetsMachine.h	Thu Nov 11 16:32:14 2004
@@ -29,7 +29,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/RelaxBehavior.h ./Behaviors/Demos/RelaxBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/RelaxBehavior.h	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Demos/RelaxBehavior.h	Wed Nov 10 20:45:36 2004
@@ -50,7 +50,7 @@
  * @author ejt (Modifications)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/SimpleChaseBallBehavior.h ./Behaviors/Demos/SimpleChaseBallBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/SimpleChaseBallBehavior.h	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Demos/SimpleChaseBallBehavior.h	Wed Nov 10 20:45:36 2004
@@ -58,7 +58,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/SoundTestBehavior.h ./Behaviors/Demos/SoundTestBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/SoundTestBehavior.h	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Demos/SoundTestBehavior.h	Wed Nov 10 20:45:36 2004
@@ -121,7 +121,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/StareAtBallBehavior.h ./Behaviors/Demos/StareAtBallBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/StareAtBallBehavior.h	Thu Nov 11 19:05:03 2004
+++ ./Behaviors/Demos/StareAtBallBehavior.h	Thu Nov 11 19:05:03 2004
@@ -36,7 +36,7 @@
  * @author tss (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/StareAtPawBehavior.h ./Behaviors/Demos/StareAtPawBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/StareAtPawBehavior.h	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Demos/StareAtPawBehavior.h	Wed Dec 22 20:47:07 2004
@@ -10,7 +10,8 @@
 #include "Shared/SharedObject.h"
 
 
-//! Uses kinematics to track the paw which last received a button press with the camera
+//! Uses CMPack kinematics to track the paw which last received a button press with the camera
+/*! This is the "old" way of doing things, using CMPack kinematics... compare to StareAtPawBehavior2 for new-style kinematics */
 class StareAtPawBehavior : public BehaviorBase {
 public:
 	//! constructor
@@ -82,20 +83,20 @@
 	virtual std::string getDescription() const { return getClassDescription(); }
 	
 protected:
-	LegOrder_t lastLeg;
-	MotionManager::MC_ID pointID;
-	double head_angles[JointsPerLeg];
+	LegOrder_t lastLeg; //!< last leg to have it's button pressed, i.e. the one we are looking at
+	MotionManager::MC_ID pointID; //!< the HeadPointerMC we are using to do the looking
+	double head_angles[JointsPerLeg]; //!< temporary storage of the head angles we desire
 };
 
 /*! @file
- * @brief Defines StareAtPawBehavior, which uses kinematics to track the paw which last received a button press with the camera
+ * @brief Defines StareAtPawBehavior, which uses CMPack kinematics to track the paw which last received a button press with the camera
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/StareAtPawBehavior2.h ./Behaviors/Demos/StareAtPawBehavior2.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/StareAtPawBehavior2.h	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Demos/StareAtPawBehavior2.h	Wed Dec 22 20:47:07 2004
@@ -13,7 +13,7 @@
 #include "Motion/Kinematics.h"
 
 
-//! Uses kinematics to track the paw which last received a button press with the camera
+//! Uses new-style ROBOOP kinematics to track the paw which last received a button press with the camera
 class StareAtPawBehavior2 : public BehaviorBase {
 public:
 	//! constructor
@@ -27,10 +27,10 @@
 		erouter->addListener(this,EventBase::sensorEGID);
 		erouter->addListener(this,EventBase::buttonEGID);
 		if(state->robotDesign == WorldState::ERS7Mask)
-			cout << "NOTICE: The ERS-7 has a rather \"sticky\" nod joint\n"
-					 << "(the upper tilt joint).  This can cause it to hesitate\n"
-					 << "or altogether fail to precisely center the target position\n"
-					 << "vertically in the center of the image...\n" << endl;
+			sout->printf("NOTICE: The ERS-7 has a rather \"sticky\" nod joint\n"
+									 "(the upper tilt joint).  This can cause it to hesitate\n"
+									 "or altogether fail to precisely center the target position\n"
+									 "vertically in the center of the image...\n");
 	}
 
 	virtual void DoStop() {
@@ -61,18 +61,17 @@
 
 		} else if(e.getGeneratorID()==EventBase::sensorEGID) {
 
-			//Find paw location
-			const char * ipname=(lastLeg==LFrLegOrder?"ToeLFrPaw":"ToeRFrPaw");
-			NEWMAT::ColumnVector Pobj=kine->getFrameInterestPoint(BaseFrameOffset,ipname);
+			//Which paw do we want?
+			const char * ipname= (lastLeg==LFrLegOrder) ? "ToeLFrPaw" : "ToeRFrPaw";
+
+			//Ask kinematics for current location of that paw (this is the "objective" aka target)
+			NEWMAT::ColumnVector Pobj=kine->getJointInterestPoint(BaseFrameOffset,ipname);
+
+			//Now point the head there
+			MMAccessor<HeadPointerMC>(pointID)->lookAtPoint(Pobj(1),Pobj(2),Pobj(3)); //keep head as far away as possible
+			//Alternative method:
+			// MMAccessor<HeadPointerMC>(pointID)->lookAtPoint(Pobj(1),Pobj(2),Pobj(3),80); //keep head 80mm away
 
-			//Compute neck angles
-			PostureEngine pose;
-			NEWMAT::ColumnVector Plink=Kinematics::pack(0,0,1,0); //infinite ray along z axis - maximize distance from paw
-			//NEWMAT::ColumnVector Plink=Kinematics::pack(0,0,80,1); //or, keep head 8cm away from paw
-			pose.solveLinkVector(Pobj,CameraFrameOffset,Plink);
-			
-			//Set joint values
-			MMAccessor<HeadPointerMC>(pointID)->setJoints(pose(HeadOffset+0).value,pose(HeadOffset+1).value,pose(HeadOffset+2).value);
 		} else {
 			serr->printf("StareAtPawBehavior2: Unhandled event %s\n",e.getName().c_str());
 		}
@@ -82,19 +81,19 @@
 	virtual std::string getDescription() const { return getClassDescription(); }
 	
 protected:
-	LegOrder_t lastLeg;
-	MotionManager::MC_ID pointID;
+	LegOrder_t lastLeg; //!< last leg to have it's button pressed, i.e. the one we are looking at
+	MotionManager::MC_ID pointID; //!< the HeadPointerMC we are using to do the looking
 };
 
 /*! @file
- * @brief Defines StareAtPawBehavior2, which uses kinematics to track the paw which last received a button press with the camera
+ * @brief Defines StareAtPawBehavior2, which uses new-style ROBOOP kinematics to track the paw which last received a button press with the camera
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/ToggleHeadLightBehavior.h ./Behaviors/Demos/ToggleHeadLightBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/ToggleHeadLightBehavior.h	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Demos/ToggleHeadLightBehavior.h	Wed Nov 10 20:45:36 2004
@@ -39,7 +39,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/WalkToTargetMachine.cc ./Behaviors/Demos/WalkToTargetMachine.cc
--- ../Tekkotsu_2.2.1/Behaviors/Demos/WalkToTargetMachine.cc	Sat Oct 16 21:16:10 2004
+++ ./Behaviors/Demos/WalkToTargetMachine.cc	Wed Dec 31 19:00:00 1969
@@ -1,90 +0,0 @@
-#include "WalkToTargetMachine.h"
-#include "Motion/HeadPointerMC.h"
-#include "Motion/WalkMC.h"
-#include "Events/VisionObjectEvent.h"
-#include "Shared/WorldState.h"
-
-//! Converts degrees to radians
-inline double DtoR(double deg) { return (deg/180.0*M_PI); }
-
-void WalkToTargetMachine::setup() {
-	StateNode::setup();
-	if(close!=NULL)
-		addTransition(closeTrans=new VisualTargetCloseTrans(close,tracking));
-	if(lost!=NULL)
-		addTransition(timeout=new TimeOutTrans(lost,500));
-}
-
-
-void WalkToTargetMachine::DoStart() {
-	StateNode::DoStart();
-
-	headpointer_id = motman->addPersistentMotion(SharedObject<HeadPointerMC>());
-	walker_id = motman->addPersistentMotion(SharedObject<WalkMC>());
-
-	erouter->addListener(this,EventBase::visObjEGID,tracking);
-}
-
-void WalkToTargetMachine::DoStop() {
-	erouter->removeListener(this);
-
-	motman->removeMotion(headpointer_id);
-	headpointer_id=MotionManager::invalid_MC_ID;
-	motman->removeMotion(walker_id);
-	walker_id=MotionManager::invalid_MC_ID;
-
-	StateNode::DoStop();
-}
-
-void WalkToTargetMachine::teardown() {
-	closeTrans=NULL;
-	timeout=NULL;
-}
-
-//this could be cleaned up event-wise (only use a timer when out of view)
-void WalkToTargetMachine::processEvent(const EventBase& event) {
-	if(timeout)
-		timeout->resetTimer();
-	static float horiz=0,vert=0;
-	const VisionObjectEvent *ve = dynamic_cast<const VisionObjectEvent*>(&event);
-	if(ve!=NULL && event.getTypeID()==EventBase::statusETID) {
-		horiz=ve->getCenterX();
-		vert=ve->getCenterY();
-	} else
-		return;
-
-	//cout << "Pos: " << horiz << ' ' << vert << endl;
-
-	double tilt=state->outputs[HeadOffset+TiltOffset]-vert*M_PI/6;
-	double pan=state->outputs[HeadOffset+PanOffset]-horiz*M_PI/7.5;
-	if(tilt>outputRanges[HeadOffset+TiltOffset][MaxRange])
-		tilt=outputRanges[HeadOffset+TiltOffset][MaxRange];
-	if(tilt<outputRanges[HeadOffset+TiltOffset][MinRange]*3/4)
-		tilt=outputRanges[HeadOffset+TiltOffset][MinRange]*3/4;
-	if(pan>outputRanges[HeadOffset+PanOffset][MaxRange]*2/3)
-		pan=outputRanges[HeadOffset+PanOffset][MaxRange]*2/3;
-	if(pan<outputRanges[HeadOffset+PanOffset][MinRange]*2/3)
-		pan=outputRanges[HeadOffset+PanOffset][MinRange]*2/3;
-	HeadPointerMC * headpointer= (HeadPointerMC*)motman->checkoutMotion(headpointer_id);
-	headpointer->setJoints(tilt,pan,0);
-	motman->checkinMotion(headpointer_id);
-
-	WalkMC * walker = (WalkMC*)motman->checkoutMotion(walker_id);
-	if(pan<-.05 || pan>.05)
-		walker->setTargetVelocity(100,0,pan);
-	else
-		walker->setTargetVelocity(160,0,0);
-	motman->checkinMotion(walker_id);
-}
-
-/*! @file
- * @brief Implements WalkToTargetMachine, a state machine for walking towards a visual target
- * @author ejt (Creator)
- *
- * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
- * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
- */
-
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/WalkToTargetMachine.h ./Behaviors/Demos/WalkToTargetMachine.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/WalkToTargetMachine.h	Thu Nov 11 16:32:14 2004
+++ ./Behaviors/Demos/WalkToTargetMachine.h	Wed Dec 31 19:00:00 1969
@@ -1,61 +0,0 @@
-//-*-c++-*-
-#ifndef INCLUDED_WalkToTargetMachine_h_
-#define INCLUDED_WalkToTargetMachine_h_
-
-#include "Behaviors/StateNode.h"
-#include "Behaviors/Transitions/TimeOutTrans.h"
-#include "Behaviors/Transitions/VisualTargetCloseTrans.h"
-#include "Motion/MotionManager.h"
-
-//! a state machine for walking towards a visual target
-class WalkToTargetMachine : public StateNode {
-public:
-	//!constructor, pass success (close), failure (lost), and parent nodes, and VisionObjectSourceID_t
-	WalkToTargetMachine(unsigned int obj,StateNode* c=NULL, StateNode* l=NULL,StateNode* p=NULL)
-		: StateNode("WalkToTarget","WalkToTarget",p),tracking(obj),timeout(NULL),closeTrans(NULL),close(c),lost(l),
-			walker_id(MotionManager::invalid_MC_ID), headpointer_id(MotionManager::invalid_MC_ID) 
-	{}
-	
-	virtual void setup();
-
-	virtual void DoStart();
-	virtual void DoStop();
-
-	virtual void teardown();
-
-	static std::string getClassDescription() { return "walks towards a visual target until it gets \"close\""; }
-	virtual std::string getDescription() const { return getClassDescription(); }
-
-	//uses head to watch ball, walks towards it
-	virtual void processEvent(const EventBase& event);
-	
-	virtual Transition* getLostTrans() { return timeout; } //!< returns the transition controlling "lost" designation
-	virtual Transition* getCloseTrans() { return closeTrans; } //!< returns the transition controlling "close to target" designation
-
-
-protected:
-	unsigned int tracking; //!< the object being tracked
-	TimeOutTrans* timeout; //!< transition in case we lose the target
-	Transition* closeTrans; //!< transition in case we get close
-	StateNode* close; //!< dest if we get close to the object
-	StateNode* lost; //!< dest if we get lost
-	MotionManager::MC_ID walker_id; //!< so we can walk
-	MotionManager::MC_ID headpointer_id; //!< so we can point the head at the object
-
-private:
-	WalkToTargetMachine(const WalkToTargetMachine&); //!< don't call this
-	WalkToTargetMachine operator=(const WalkToTargetMachine&); //!< don't call this
-};
-
-/*! @file
- * @brief Describes WalkToTargetMachine, a state machine for walking towards a visual target
- * @author ejt (Creator)
- *
- * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
- * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
- */
-
-#endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/WallTestBehavior.cc ./Behaviors/Demos/WallTestBehavior.cc
--- ../Tekkotsu_2.2.1/Behaviors/Demos/WallTestBehavior.cc	Tue Nov 16 14:22:42 2004
+++ ./Behaviors/Demos/WallTestBehavior.cc	Tue Dec 21 18:51:15 2004
@@ -13,21 +13,21 @@
 WallTestBehavior::DoStart() {
 	BehaviorBase::DoStart(); // do this first
 	int startrec,stoprec;
-	SharedObject<MotionSequenceMC<MotionSequence::SizeSmall> > pan;
-	pan->setPlayTime(startrec=reposTime);
+	SharedObject<SmallMotionSequenceMC> pan;
+	pan->setTime(startrec=reposTime);
 	pan->setPose(PostureEngine(config->motion.makePath("stand.pos").c_str()));
 	pan->setOutputCmd(HeadOffset+TiltOffset,0);
 	pan->setOutputCmd(HeadOffset+PanOffset,outputRanges[HeadOffset+PanOffset][MaxRange]);
 	pan->setOutputCmd(HeadOffset+RollOffset,0);
-	pan->setPlayTime(stoprec=pan->getPlayTime()+panTime);
+	stoprec=pan->advanceTime(panTime);
 	pan->setOutputCmd(HeadOffset+TiltOffset,0);
 	pan->setOutputCmd(HeadOffset+PanOffset,outputRanges[HeadOffset+PanOffset][MinRange]);
 	pan->setOutputCmd(HeadOffset+RollOffset,0);
-	pan->setPlayTime(pan->getPlayTime()+reposTime);
+	pan->advanceTime(reposTime);
 	pan->setOutputCmd(HeadOffset+TiltOffset,0);
 	pan->setOutputCmd(HeadOffset+PanOffset,0);
 	pan->setOutputCmd(HeadOffset+RollOffset,0);
-	pan->setPlayTime(pan->getPlayTime()+reposTime);
+	pan->advanceTime(reposTime);
 	pan->setOutputCmd(HeadOffset+TiltOffset,0);
 	pan->setOutputCmd(HeadOffset+PanOffset,0);
 	pan->setOutputCmd(HeadOffset+RollOffset,0);
@@ -68,7 +68,7 @@
 				
 		PostureEngine pose;
 		pose.clear();
-		//float legheight=NEWMAT::ColumnVector(pose.getFrameInterestPoint(BaseFrameOffset,"LFrPaw"))(3);
+		//float legheight=NEWMAT::ColumnVector(pose.getJointInterestPoint(BaseFrameOffset,"LFrPaw"))(3);
 
 		cout << "Logging Non-Kinematic calculations to /data/raw_xy.txt" << endl;
 		{
@@ -91,14 +91,14 @@
 			} else {
 #ifdef TGT_ERS7
 				cout << "Columns are:\tx\ty\tz\tis_using_near" << endl;
-				float off=NEWMAT::ColumnVector(pose.getFrameInterestPoint(CameraFrameOffset,"NearIR"))(3);
+				float off=NEWMAT::ColumnVector(pose.getJointInterestPoint(CameraFrameOffset,"NearIR"))(3);
 #else //not TGT_ERS7
 				cout << "Columns are:\tx\ty\tz" << endl;
-				float off=NEWMAT::ColumnVector(pose.getFrameInterestPoint(CameraFrameOffset,"IR"))(3);
+				float off=NEWMAT::ColumnVector(pose.getJointInterestPoint(CameraFrameOffset,"IR"))(3);
 #endif //not TGT_ERS7
 				for(unsigned int i=0; i<d.size(); i++) {
 					pose(HeadOffset+PanOffset)=a[i];
-					NEWMAT::ColumnVector hit=pose.frameToBase(CameraFrameOffset)*Kinematics::pack(0,0,d[i]+off);
+					NEWMAT::ColumnVector hit=pose.jointToBase(CameraFrameOffset)*Kinematics::pack(0,0,d[i]+off);
 #ifdef TGT_ERS7
 					kxys << hit(1) << '\t' << hit(2) << '\t' << hit(3) << '\t' << usedNear[i] << '\n';
 #else //not TGT_ERS7
@@ -123,10 +123,10 @@
 					pose(HeadOffset+PanOffset)=a[i];
 #ifdef TGT_ERS7
 					unsigned int frame=usedNear[i]?NearIRFrameOffset:FarIRFrameOffset;
-					NEWMAT::ColumnVector hit=pose.frameToBase(frame)*Kinematics::pack(0,0,d[i]);
+					NEWMAT::ColumnVector hit=pose.jointToBase(frame)*Kinematics::pack(0,0,d[i]);
 					ckxys << hit(1) << '\t' << hit(2) << '\t' << hit(3) << '\t' << usedNear[i] << '\n';
 #else //not TGT_ERS7
-					NEWMAT::ColumnVector hit=pose.frameToBase(IRFrameOffset)*Kinematics::pack(0,0,d[i]);
+					NEWMAT::ColumnVector hit=pose.jointToBase(IRFrameOffset)*Kinematics::pack(0,0,d[i]);
 					ckxys << hit(1) << '\t' << hit(2) << '\t' << hit(3) << '\n';
 #endif //not TGT_ERS7
 				}
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/WallTestBehavior.h ./Behaviors/Demos/WallTestBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/WallTestBehavior.h	Mon Nov 15 19:11:46 2004
+++ ./Behaviors/Demos/WallTestBehavior.h	Mon Nov 15 19:11:46 2004
@@ -46,7 +46,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/WorldStateVelDaemon.h ./Behaviors/Demos/WorldStateVelDaemon.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/WorldStateVelDaemon.h	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Demos/WorldStateVelDaemon.h	Wed Nov 10 20:45:36 2004
@@ -85,7 +85,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Demos/karmedbandit.h ./Behaviors/Demos/karmedbandit.h
--- ../Tekkotsu_2.2.1/Behaviors/Demos/karmedbandit.h	Thu Sep 18 18:40:27 2003
+++ ./Behaviors/Demos/karmedbandit.h	Thu Sep 18 18:40:27 2003
@@ -132,7 +132,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Mon/Aibo3DControllerBehavior.h ./Behaviors/Mon/Aibo3DControllerBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Mon/Aibo3DControllerBehavior.h	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Mon/Aibo3DControllerBehavior.h	Wed Nov 10 20:45:36 2004
@@ -131,7 +131,7 @@
  * @author alokl (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Mon/EStopControllerBehavior.cc ./Behaviors/Mon/EStopControllerBehavior.cc
--- ../Tekkotsu_2.2.1/Behaviors/Mon/EStopControllerBehavior.cc	Thu Oct  7 15:07:04 2004
+++ ./Behaviors/Mon/EStopControllerBehavior.cc	Thu Oct  7 15:07:04 2004
@@ -72,7 +72,7 @@
  * @author tss (Creator)
  * 
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Mon/EStopControllerBehavior.h ./Behaviors/Mon/EStopControllerBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Mon/EStopControllerBehavior.h	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Mon/EStopControllerBehavior.h	Fri Dec 10 18:18:10 2004
@@ -14,9 +14,8 @@
 class EStopControllerBehavior : public BehaviorBase {
 
 public:	
-	//! Points to the one EStopControllerBehavior object that the input
-	//! command stream is talking to. A kludge. Dunno how you're gonna
-	//! make sure you're not using this uninitialized.
+	//! Points to the one EStopControllerBehavior object that the input command stream is talking to.
+	/*! A kludge. Dunno how you're gonna make sure you're not using this uninitialized. */
 	static EStopControllerBehavior * theOne;
 	static int callback(char *buf, int bytes); //!< called by wireless when there's new data
 
@@ -67,10 +66,10 @@
  * @author tss (Creator)
  * 
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif 
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Mon/HeadPointControllerBehavior.cc ./Behaviors/Mon/HeadPointControllerBehavior.cc
--- ../Tekkotsu_2.2.1/Behaviors/Mon/HeadPointControllerBehavior.cc	Sat Oct 16 21:16:10 2004
+++ ./Behaviors/Mon/HeadPointControllerBehavior.cc	Sat Oct 16 21:16:10 2004
@@ -124,7 +124,7 @@
  * @author tss (Creator)
  * 
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Mon/HeadPointControllerBehavior.h ./Behaviors/Mon/HeadPointControllerBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Mon/HeadPointControllerBehavior.h	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Mon/HeadPointControllerBehavior.h	Wed Nov 10 20:45:36 2004
@@ -82,7 +82,7 @@
  * @author tss (Creator)
  * 
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Mon/RawCamBehavior.cc ./Behaviors/Mon/RawCamBehavior.cc
--- ../Tekkotsu_2.2.1/Behaviors/Mon/RawCamBehavior.cc	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Mon/RawCamBehavior.cc	Wed Nov 10 20:45:36 2004
@@ -293,7 +293,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Mon/RawCamBehavior.h ./Behaviors/Mon/RawCamBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Mon/RawCamBehavior.h	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Mon/RawCamBehavior.h	Wed Nov 10 20:45:36 2004
@@ -73,7 +73,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Mon/SegCamBehavior.cc ./Behaviors/Mon/SegCamBehavior.cc
--- ../Tekkotsu_2.2.1/Behaviors/Mon/SegCamBehavior.cc	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Mon/SegCamBehavior.cc	Wed Nov 10 20:45:36 2004
@@ -171,7 +171,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Mon/SegCamBehavior.h ./Behaviors/Mon/SegCamBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Mon/SegCamBehavior.h	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Mon/SegCamBehavior.h	Wed Nov 10 20:45:36 2004
@@ -84,7 +84,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Mon/SpiderMachineBehavior.cc ./Behaviors/Mon/SpiderMachineBehavior.cc
--- ../Tekkotsu_2.2.1/Behaviors/Mon/SpiderMachineBehavior.cc	Wed Dec 31 19:00:00 1969
+++ ./Behaviors/Mon/SpiderMachineBehavior.cc	Fri Dec 17 15:18:54 2004
@@ -0,0 +1,239 @@
+#include "SpiderMachineBehavior.h"
+#include "Events/EventRouter.h"
+#include "Behaviors/StateNode.h"
+#include "Wireless/Wireless.h"
+
+SpiderMachineBehavior * SpiderMachineBehavior::theOne=NULL;
+unsigned int SpiderMachineBehavior::port=10080;
+
+void SpiderMachineBehavior::DoStart() {
+	BehaviorBase::DoStart(); // do this first
+	theOne=this;
+	// Turn on wireless
+	cmdsock=wireless->socket(SocketNS::SOCK_STREAM, 1024, 1024*10);
+	wireless->setDaemon(cmdsock,true);
+	wireless->setReceiver(cmdsock->sock, callback);
+	wireless->listen(cmdsock->sock, port);
+	erouter->addListener(this,EventBase::stateMachineEGID);
+	erouter->addListener(this,EventBase::stateTransitionEGID);
+}
+
+void SpiderMachineBehavior::DoStop() {
+	erouter->removeListener(this);
+	expected.clear();
+	while(!queuedEvents.empty())
+		queuedEvents.pop();
+	// Close socket; turn wireless off
+	wireless->setDaemon(cmdsock,false);
+	wireless->close(cmdsock);
+	if(theOne==this)
+		theOne=NULL;
+	BehaviorBase::DoStop(); // do this last
+}
+
+void SpiderMachineBehavior::processEvent(const EventBase& e) {
+	if(!wireless->isConnected(cmdsock->sock) || listen.size()==0)
+		return;
+
+	if(e.getGeneratorID()==EventBase::stateTransitionEGID) {
+		bool care=false;
+		const Transition * trans = reinterpret_cast<Transition*>(e.getSourceID());
+		const std::vector<StateNode*>& incoming=trans->getSources();
+		const std::vector<StateNode*>& outgoing=trans->getDestinations();
+		for(std::vector<StateNode*>::const_iterator it=incoming.begin(); it!=incoming.end() && !care; it++)
+			care=isListening(*it);
+		for(std::vector<StateNode*>::const_iterator it=outgoing.begin(); it!=outgoing.end() && !care; it++)
+			care=isListening(*it);
+		if(!care)
+			return;
+
+		if(expected.size()!=0) {
+			queuedEvents.push(e);
+		} else {
+			cmdsock->printf("<event>\n");
+			indent(1);
+			cmdsock->printf("<fire id=\"%s\" time=\"%d\" />\n",trans->getName().c_str(),e.getTimeStamp());
+			expected.insert(incoming.begin(),incoming.end());
+			expected.insert(outgoing.begin(),outgoing.end());
+			while(queuedEvents.size()>0) {
+				EventBase qe=queuedEvents.front();
+				queuedEvents.pop();
+				processEvent(qe);
+			}
+		}
+
+	} else if(e.getGeneratorID()==EventBase::stateMachineEGID) {
+		if(e.getTypeID()==EventBase::statusETID)
+			return;
+		const StateNode * beh=reinterpret_cast<StateNode*>(e.getSourceID());
+		expected_t::iterator it=expected.find(beh);
+		char * format;
+		if(isListening(beh)) {
+			if(it==expected.end()) { //if not found
+				if(queuedEvents.size()==0)
+					format="<event><state%s id=\"%s\" time=\"%d\" /></event>\n"; // unexpected
+				else {
+					queuedEvents.push(e);
+					return;
+				}
+			} else
+				format="  <state%s id=\"%s\" time=\"%d\" />\n"; // expected as part of transition
+			if(e.getTypeID()==EventBase::activateETID)
+				cmdsock->printf(format,"start",beh->getName().c_str(),e.getTimeStamp());
+			else if(e.getTypeID()==EventBase::deactivateETID)
+				cmdsock->printf(format,"stop",beh->getName().c_str(),e.getTimeStamp());
+			else
+				serr->printf("WARNING: Unrecognized TypeID %d\n",e.getTypeID());
+		}
+		if(it!=expected.end()) { //was found
+			expected.erase(it);
+			if(expected.size()==0) {
+				cmdsock->printf("</event>\n");
+				while(queuedEvents.size()>0) {
+					EventBase qe=queuedEvents.front();
+					queuedEvents.pop();
+					processEvent(qe);
+				}
+			}
+		}
+
+	} else {
+		serr->printf("WARNING: Unknown event %s (%s)\n",e.getName().c_str(),e.getDescription().c_str());
+	}
+}
+
+void SpiderMachineBehavior::spider(const StateNode* n, unsigned int depth/*=0*/) {
+	if(n==NULL)
+		return;
+
+	const std::vector<StateNode*>& subnodes=n->getNodes();
+	if(subnodes.size()==0) {
+		// it's a leaf node, no subnodes or transitions between them
+		indent(depth);
+		cmdsock->printf("<state class=\"%s\" id=\"%s\" />\n", n->getClassName().c_str(), n->getName().c_str());
+	} else {
+
+		// first output current node's info
+		indent(depth);
+		cmdsock->printf("<state class=\"%s\" id=\"%s\">\n", n->getClassName().c_str(), n->getName().c_str());
+
+		std::set<const Transition*> transitions;
+		// now recurse on sub-nodes, extracting all of the subnodes transitions
+		for(unsigned int i=0; i<subnodes.size(); i++) {
+			spider(subnodes[i],depth+1);
+			const std::vector<Transition*>& curt=subnodes[i]->getTransitions();
+			transitions.insert(curt.begin(),curt.end());
+		}
+
+		// now output transitions between subnodes we collected in previous step
+		for(std::set<const Transition*>::const_iterator it=transitions.begin(); it!=transitions.end(); it++) {
+			indent(depth+1);
+			cmdsock->printf("<transition class=\"%s\" id=\"%s\">\n", (*it)->getClassName().c_str(), (*it)->getName().c_str());
+			const std::vector<StateNode*>& incoming=(*it)->getSources();
+			for(unsigned int i=0; i<incoming.size(); i++) {
+				indent(depth+2);
+				cmdsock->printf("<source>%s</source>\n",incoming[i]->getName().c_str());
+			}
+			const std::vector<StateNode*>& outgoing=(*it)->getDestinations();
+			for(unsigned int i=0; i<outgoing.size(); i++) {
+				indent(depth+2);
+				cmdsock->printf("<destination>%s</destination>\n",outgoing[i]->getName().c_str());
+			}
+			indent(depth+1);
+			cmdsock->printf("</transition>\n");
+		}
+
+		indent(depth);
+		cmdsock->printf("</state>\n");
+	}
+}
+	
+bool SpiderMachineBehavior::isListening(const StateNode* n) {
+	while(n!=NULL) {
+		if(listen.find(n->getName())!=listen.end())
+			return true;
+		n=n->getParent();
+	}
+	return false;
+}
+
+void SpiderMachineBehavior::indent(unsigned int level) {
+	for(unsigned int i=0; i<level; i++)
+		cmdsock->printf("  ");
+}
+
+const StateNode * SpiderMachineBehavior::find(const std::string& name) {
+	for(registry_t::const_iterator it=registry.begin(); it!=registry.end(); it++) {
+		const StateNode * cur=dynamic_cast<const StateNode*>(*it);
+		if(cur!=NULL && cur->getName()==name)
+			return cur;
+	}
+	//serr->printf("WARNING: SpiderMachineBehavior Could not find StateNode named `%s'\n",name.c_str());
+	return NULL;
+}
+
+void SpiderMachineBehavior::runCommand(const std::string& s) {
+	if(s==std::string("list")) {
+		unsigned int numstate=0;
+		for(registry_t::const_iterator it=registry.begin(); it!=registry.end(); it++) {
+			const StateNode * cur=dynamic_cast<const StateNode*>(*it);
+			if(cur!=NULL)
+				numstate++;
+		}
+		cmdsock->printf("%d\n",numstate);
+		for(registry_t::const_iterator it=registry.begin(); it!=registry.end(); it++) {
+			const StateNode * cur=dynamic_cast<const StateNode*>(*it);
+			if(cur!=NULL)
+				cmdsock->printf("%s\n",cur->getName().c_str());
+		}
+
+	} else if(s.find("spider ")==0) {
+		const StateNode * n=find(s.substr(7));
+		if(n==NULL) {
+			serr->printf("WARNING: SpiderMachineBehavior could not find \"%s\" for spidering\n",s.substr(7).c_str());
+			cmdsock->printf("<model></model>\n");
+		} else {
+			cmdsock->printf("<model>\n");
+			spider(n);
+			cmdsock->printf("</model>\n");
+		}
+
+	} else if(s.find("listen ")==0) {
+		listen.insert(s.substr(7));
+
+	} else if(s.find("ignore ")==0) {
+		listen.erase(s.substr(7));
+
+	} else if(s=="clear") {
+		listen.clear();
+
+	} else {
+		serr->printf("SpiderMachineBehavior::runCommand() - bad message: '%s'\n",s.c_str());
+	}
+}
+
+// The command packet reassembly mechanism
+int SpiderMachineBehavior::callback(char *buf, int bytes) {
+	if(SpiderMachineBehavior::theOne==NULL)
+		return 0;
+	static std::string cmd;
+	for(int i=0; i<bytes; i++) {
+		if(buf[i]=='\n') {
+			SpiderMachineBehavior::theOne->runCommand(cmd);
+			cmd.clear();
+		} else if(buf[i]!='\r')
+			cmd+=buf[i];
+	}
+  return 0;
+}
+
+/*! @file
+ * @brief Implements SpiderMachineBehavior, which when active, active and connected over network socket, outputs structure of requested state machine(s)
+ * @author ejt (Creator)
+ *
+ * $Author: ejt $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
+ * $State: Exp $
+ * $Date: 2004/12/23 08:41:24 $
+ */
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Mon/SpiderMachineBehavior.h ./Behaviors/Mon/SpiderMachineBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Mon/SpiderMachineBehavior.h	Wed Dec 31 19:00:00 1969
+++ ./Behaviors/Mon/SpiderMachineBehavior.h	Wed Dec 22 20:47:07 2004
@@ -0,0 +1,136 @@
+//-*-c++-*-
+#ifndef INCLUDED_SpiderMachineBehavior_h_
+#define INCLUDED_SpiderMachineBehavior_h_
+
+#include "Behaviors/BehaviorBase.h"
+#include <queue>
+
+class StateNode;
+
+//! When active and connected over network socket, outputs structure of requested state machine(s)
+/*! The protocol is:
+ *  - '<tt>list</tt>' - send list of all instantiated StateNodes
+ *  - '<tt>spider </tt><i>name</i>' - spider the current structure of StateNode named <i>name</i>
+ *  - '<tt>listen </tt><i>name</i>' - send updates regarding the activation status of <i>name</i> and its subnodes; you can specify a state which is not yet running
+ *  - '<tt>ignore </tt><i>name</i>' - cancels a previous listen command
+ *  - '<tt>clear</tt>' - cancels all previous listen commands; should be called at the beginning or end of each connection, preferably both
+ *  
+ *  Each of those commands should be terminated with a newline -
+ *  i.e. one command per line
+ *
+ *  After a <tt>list</tt> command, the first line will be the number
+ *  of StateNodes, followed by that number of lines, one StateNode
+ *  name per line.
+ *
+ *  After a <tt>spider</tt> command, an XML description of the model
+ *  will be sent.  If no matching StateNode is found, an warning will
+ *  be displayed on #serr, and an empty model
+ *  ("<model></model>") returned over the network
+ *  connection.
+ *
+ *  All other commands give no direct response - listen can be
+ *  executed before the specified StateNode is yet running, and ignore
+ *  doesn't care whether or not the specified StateNode was actually
+ *  being listened for.
+ *
+ *  The format of the model is:
+ @verbatim
+ <!DOCTYPE model [
+ <!ELEMENT model (state*, transition*)>
+ <!ELEMENT state (state*, transition*)>
+ <!ELEMENT transition (source+, dest+)>
+ <!ELEMENT source (#PCDATA)>
+ <!ELEMENT dest (#PCDATA)>
+ 
+ <!ATTLIST state id CDATA #REQUIRED>
+ <!ATTLIST state class CDATA #REQUIRED>
+ <!ATTLIST transition id CDATA #REQUIRED>
+ <!ATTLIST transition class CDATA #REQUIRED>
+ ]>@endverbatim
+ *
+ *  The format of status updates following a listen command is:
+ @verbatim
+ <!DOCTYPE event [
+ <!ELEMENT event (fire*, statestart*, statestop*)>
+ <!ELEMENT fire (EMPTY)>
+ <!ELEMENT statestart (EMPTY)>
+ <!ELEMENT statestop (EMPTY)>
+
+ <!ATTLIST fire id CDATA #REQUIRED>
+ <!ATTLIST fire time CDATA #REQUIRED>
+ <!ATTLIST statestart id CDATA #REQUIRED>
+ <!ATTLIST statestart time CDATA #REQUIRED>
+ <!ATTLIST statestop id CDATA #REQUIRED>
+ <!ATTLIST statestop time CDATA #REQUIRED>
+ ]>@endverbatim
+*/
+class SpiderMachineBehavior : public BehaviorBase {
+public:	
+	//! Points to the one SpiderMachineBehavior object that the input command stream is talking to.
+	/*! A kludge. Dunno how you're gonna make sure you're not using this uninitialized. */
+	static SpiderMachineBehavior * theOne;
+	static unsigned int port; //!< the port to listen on (10080 by default)
+	static int callback(char *buf, int bytes); //!< called by wireless when there's new data
+
+public:
+	//! constructor
+	SpiderMachineBehavior() : BehaviorBase("SpiderMachineBehavior"), cmdsock(NULL), expected(), listen(), queuedEvents() {}
+
+	virtual void DoStart();
+	virtual void DoStop();
+	virtual void processEvent(const EventBase& e);
+
+	//! dumps all of the transitions and subnodes of a given statenode
+	void spider(const StateNode* n, unsigned int depth=0);
+
+	//! returns true iff @a n or one of its parents is found in #listen
+	bool isListening(const StateNode* n);
+
+	static std::string getClassDescription() {
+		char tmp[20];
+		sprintf(tmp,"%d",port);
+		return std::string("When active and connected over network socket on port ")+tmp
+			+std::string(", outputs structure of requested state machine(s)");
+	}
+	virtual std::string getDescription() const { return getClassDescription(); }
+	
+	//! parses commands sent from callback()
+	void runCommand(const std::string& s);
+
+protected:
+	//!just to prettify the data sent out - probably should make this a null-op to save bandwidth after debugging is done
+	void indent(unsigned int level);
+
+	//!searches currently instantiated StateNodes to find the one named @a name
+	const StateNode * find(const std::string& name);
+
+	class Socket *cmdsock; //!< the socket for communication
+
+	typedef std::set<BehaviorBase*> registry_t; //!< the type of the behavior registry (BehaviorBase::registry)
+	typedef std::multiset<const StateNode*> expected_t; //!< the type of #ignore
+	typedef std::set<std::string> listen_t; //!< the type of #listen
+	typedef std::queue<EventBase> queuedEvents_t; //!< the type of #queuedEvents
+
+	expected_t expected; //!< a set of behaviors which are involved with an impending transition - their next stateMachineEGID event should be ignored
+
+	listen_t listen; //!< a set of state machine names which should have their subnodes monitored
+
+	queuedEvents_t queuedEvents; //!< used if a transition causes other transitions, those transitions need to be remembered
+
+private:
+	SpiderMachineBehavior(const SpiderMachineBehavior&); //!< don't call
+	SpiderMachineBehavior operator=(const SpiderMachineBehavior&); //!< don't call
+};
+
+/*! @file
+ * @brief Defines SpiderMachineBehavior, which active and connected over network socket, outputs structure of requested state machine(s)
+ * @author ejt (Creator)
+ *
+ * $Author: ejt $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
+ * $State: Exp $
+ * $Date: 2004/12/23 08:41:24 $
+ */
+
+#endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Mon/ViewWMVarsBehavior.h ./Behaviors/Mon/ViewWMVarsBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Mon/ViewWMVarsBehavior.h	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Mon/ViewWMVarsBehavior.h	Wed Nov 10 20:45:36 2004
@@ -38,7 +38,7 @@
  * @author ejt (Creator)
  * 
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Mon/WMMonitorBehavior.cc ./Behaviors/Mon/WMMonitorBehavior.cc
--- ../Tekkotsu_2.2.1/Behaviors/Mon/WMMonitorBehavior.cc	Fri Apr 16 16:17:22 2004
+++ ./Behaviors/Mon/WMMonitorBehavior.cc	Fri Apr 16 16:17:22 2004
@@ -146,7 +146,7 @@
  * @author alokl (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Mon/WMMonitorBehavior.h ./Behaviors/Mon/WMMonitorBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Mon/WMMonitorBehavior.h	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Mon/WMMonitorBehavior.h	Wed Nov 10 20:45:36 2004
@@ -136,7 +136,7 @@
  * @author alokl (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Mon/WalkControllerBehavior.cc ./Behaviors/Mon/WalkControllerBehavior.cc
--- ../Tekkotsu_2.2.1/Behaviors/Mon/WalkControllerBehavior.cc	Wed Nov  3 22:01:32 2004
+++ ./Behaviors/Mon/WalkControllerBehavior.cc	Wed Nov  3 22:01:32 2004
@@ -158,7 +158,7 @@
  * @author PA Gov. School for the Sciences 2003 Team Project - Haoqian Chen, Yantian Martin, Jon Stahlman (modifications)
  * 
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Mon/WalkControllerBehavior.h ./Behaviors/Mon/WalkControllerBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Mon/WalkControllerBehavior.h	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Mon/WalkControllerBehavior.h	Wed Nov 10 20:45:36 2004
@@ -103,7 +103,7 @@
  * @author PA Gov. School for the Sciences 2003 Team Project - Haoqian Chen, Yantian Martin, Jon Stahlman (modifications)
  * 
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Mon/WorldStateSerializerBehavior.cc ./Behaviors/Mon/WorldStateSerializerBehavior.cc
--- ../Tekkotsu_2.2.1/Behaviors/Mon/WorldStateSerializerBehavior.cc	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Mon/WorldStateSerializerBehavior.cc	Wed Nov 10 20:45:36 2004
@@ -53,7 +53,7 @@
  * @author alokl (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Mon/WorldStateSerializerBehavior.h ./Behaviors/Mon/WorldStateSerializerBehavior.h
--- ../Tekkotsu_2.2.1/Behaviors/Mon/WorldStateSerializerBehavior.h	Wed Nov 10 20:45:36 2004
+++ ./Behaviors/Mon/WorldStateSerializerBehavior.h	Wed Nov 10 20:45:36 2004
@@ -55,7 +55,7 @@
  * @author alokl (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Nodes/GroupNode.h ./Behaviors/Nodes/GroupNode.h
--- ../Tekkotsu_2.2.1/Behaviors/Nodes/GroupNode.h	Thu Nov 11 16:32:14 2004
+++ ./Behaviors/Nodes/GroupNode.h	Fri Dec  3 19:10:42 2004
@@ -16,13 +16,19 @@
  *  In essence, this is a fork - one transition can activate several
  *  states, which are then separate branches of execution.  (Although
  *  only one is actually being executed at a time)
+ *
+ *  Another (probably better) way to do this is with a
+ *  multi-destination transition - after the initialization of the
+ *  transition (usually specifying the first transition) you can call
+ *  the Transition::addDestination() function to add addition
+ *  destinations, replicating the functionality of this class.
  */
 class GroupNode : public StateNode {
 public:
 	//!constructor
 	GroupNode() : StateNode("GroupNode","GroupNode") {}
 	//!constructor
-	explicit GroupNode(const std::string& nm, StateNode* p=NULL) : StateNode("GroupNode",nm,p) {}
+	explicit GroupNode(const std::string& nm) : StateNode("GroupNode",nm) {}
 
 	//! activates all of the sub nodes
 	virtual void DoStart() {
@@ -42,10 +48,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Nodes/HeadPointerNode.h ./Behaviors/Nodes/HeadPointerNode.h
--- ../Tekkotsu_2.2.1/Behaviors/Nodes/HeadPointerNode.h	Tue Nov 16 20:31:06 2004
+++ ./Behaviors/Nodes/HeadPointerNode.h	Fri Dec  3 19:10:42 2004
@@ -14,7 +14,7 @@
 
 public:
   //! constructor
-  HeadPointerNode(std::string nodename="HeadPointerNode") : 
+  HeadPointerNode(const std::string & nodename="HeadPointerNode") : 
     StateNode("HeadPointerNode",nodename), head_mc(), head_id(MotionManager::invalid_MC_ID) {}
 
   //! activate the node
@@ -45,7 +45,7 @@
 
 protected:
   //! constructor
-  HeadPointerNode(std::string &classname, std::string &nodename) : 
+  HeadPointerNode(const std::string &classname, const std::string &nodename) : 
     StateNode(classname,nodename), head_mc(), head_id(MotionManager::invalid_MC_ID) {}
 
 
@@ -55,11 +55,11 @@
  * @brief Defines HeadPointerNode, a simple StateNode that runs a HeadPointerMC motion command and throws a status event upon completion
  * @author dst (Creator)
  *
- * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Author: ejt $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Nodes/LedNode.h ./Behaviors/Nodes/LedNode.h
--- ../Tekkotsu_2.2.1/Behaviors/Nodes/LedNode.h	Tue Nov 16 20:31:06 2004
+++ ./Behaviors/Nodes/LedNode.h	Tue Nov 16 20:31:06 2004
@@ -56,7 +56,7 @@
  * @author dst (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Nodes/OutputNode.h ./Behaviors/Nodes/OutputNode.h
--- ../Tekkotsu_2.2.1/Behaviors/Nodes/OutputNode.h	Thu Nov 11 15:35:00 2004
+++ ./Behaviors/Nodes/OutputNode.h	Fri Dec  3 19:10:42 2004
@@ -7,14 +7,15 @@
 #include <ostream>
 
 //! A very simple StateNode that outputs its name to a given ostream upon activation, handy for debugging
+/*! The Event Logger controller item (Status Reports menu) is a much better tool for debugging */
 class OutputNode : public StateNode {
 public:
 	//!constructor, sets name and ostream to use for output
-	OutputNode(const char* nm, StateNode* par, ostream& output) : StateNode("OutputNode",nm,par), next(NULL), out(output), msg(nm) {}
+	OutputNode(const char* nm, ostream& output) : StateNode("OutputNode",nm), next(NULL), out(output), msg(nm) {}
 	//!constructor, sets name and another state which will immediately be transitioned to upon activation
-	OutputNode(const char* nm, StateNode* par, ostream& output, StateNode * nextstate) : StateNode("OutputNode",nm,par), next(nextstate), out(output), msg(nm) {}
+	OutputNode(const char* nm, ostream& output, StateNode * nextstate) : StateNode("OutputNode",nm), next(nextstate), out(output), msg(nm) {}
 	//!constructor, sets name, message, and another state which will immediately be transitioned to upon activation
-	OutputNode(const char* nm, const std::string& mg, StateNode* par, ostream& output, StateNode * nextstate) : StateNode("OutputNode",nm,par), next(nextstate), out(output), msg(mg) {}
+	OutputNode(const char* nm, const std::string& mg, ostream& output, StateNode * nextstate) : StateNode("OutputNode",nm), next(nextstate), out(output), msg(mg) {}
 
 	//!outputs this state's name, will transition to #next if non-NULL
 	/*!if #next is NULL, the state will simply stay active until some other transition causes it to leave*/
@@ -42,10 +43,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Nodes/PlayMotionSequenceNode.h ./Behaviors/Nodes/PlayMotionSequenceNode.h
--- ../Tekkotsu_2.2.1/Behaviors/Nodes/PlayMotionSequenceNode.h	Thu Nov 11 16:32:14 2004
+++ ./Behaviors/Nodes/PlayMotionSequenceNode.h	Tue Dec 21 16:49:50 2004
@@ -18,8 +18,8 @@
 	{}
 
 	//!constructor
-	PlayMotionSequenceNode(const std::string& nm, StateNode* par, const std::string& file, bool loop=false)
-		: StateNode("PlayMotionSequenceNode",nm,par), msid(MotionManager::invalid_MC_ID), msidIsMine(false), looping(false), filename(file)
+	PlayMotionSequenceNode(const std::string& nm, const std::string& file, bool loop=false)
+		: StateNode("PlayMotionSequenceNode",nm), msid(MotionManager::invalid_MC_ID), msidIsMine(false), looping(false), filename(file)
 	{
 		setLooping(loop);
 	}
@@ -104,7 +104,7 @@
 			MMAccessor<MotionSequenceMC<SIZE> > ms(msid);
 			ms->clear();
 			ms->LoadFile(file.c_str());
-			ms->setPlayTime(1);
+			ms->setTime(1);
 		}
 		filename=file;
 	}
@@ -115,15 +115,21 @@
 	std::string filename; //!< filename of current motion sequence
 };
 
+typedef PlayMotionSequenceNode<TinyMotionSequenceMC::CAPACITY> TinyPlayMotionSequenceNode; //!< streamlined access to the standard template sizes
+typedef PlayMotionSequenceNode<SmallMotionSequenceMC::CAPACITY> SmallPlayMotionSequenceNode; //!< streamlined access to the standard template sizes
+typedef PlayMotionSequenceNode<MediumMotionSequenceMC::CAPACITY> MediumPlayMotionSequenceNode; //!< streamlined access to the standard template sizes
+typedef PlayMotionSequenceNode<LargeMotionSequenceMC::CAPACITY> LargePlayMotionSequenceNode; //!< streamlined access to the standard template sizes
+typedef PlayMotionSequenceNode<XLargeMotionSequenceMC::CAPACITY> XLargePlayMotionSequenceNode; //!< streamlined access to the standard template sizes
+
 /*! @file
  * @brief Describes PlayMotionSequenceNode, a StateNode for playing a MotionSequence (and looping it if desired)
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Nodes/SoundNode.h ./Behaviors/Nodes/SoundNode.h
--- ../Tekkotsu_2.2.1/Behaviors/Nodes/SoundNode.h	Tue Nov 16 20:31:06 2004
+++ ./Behaviors/Nodes/SoundNode.h	Fri Dec  3 19:10:42 2004
@@ -7,31 +7,48 @@
 #include "SoundPlay/SoundManager.h"
 
 //! A simple StateNode that plays a sound upon startup and throws a status event on completion
+/*! Doesn't automatically preload the sound buffer - if you want the sound file
+ *  to be preloaded, you'll have to make the
+ *  SoundManager::LoadFile() / SoundManager::ReleaseFile() calls yourself.
+ *  
+ *  By default, sound playback will continue even after this node has been deactivated.
+ *  If this is not the behavior you desire, set the #autostop flag (through setAutoStop())
+ */
 class SoundNode : public StateNode {
 protected:
-  std::string filename;
-  SoundManager::Play_ID curplay_id;
+  std::string filename; //!< filename of sound to play, accessed through setFileName() and getFileName()
+  SoundManager::Play_ID curplay_id; //!< holds the playback identification so it can be halted any time
+	bool autostop; //!< if set to true by setAutoStop(), when this node is deactivated, playback will be halted.  Otherwise, playback will continue even after the node is deactivated
 
 public:
-  //! constructor
-  SoundNode(std::string nodename="SoundNode", std::string soundfilename="") : 
-    StateNode("SoundNode",nodename), filename(soundfilename), curplay_id(SoundManager::invalid_Play_ID) {}
+  //! constructor, specify a sound file to play
+  SoundNode(const std::string& soundfilename="") : 
+    StateNode("SoundNode","SoundNode"), filename(soundfilename), curplay_id(SoundManager::invalid_Play_ID), autostop(false) {}
 
-  //! activate the node
+  //! constructor, specify instance name and sound file to play
+  SoundNode(const std::string& nodename, const std::string& soundfilename) : 
+    StateNode("SoundNode",nodename), filename(soundfilename), curplay_id(SoundManager::invalid_Play_ID), autostop(false) {}
+
+  //! activate the node, starts playing the sound
   virtual void DoStart() {
-    curplay_id = sndman->PlayFile(filename);
-    erouter->addListener(this,EventBase::audioEGID,curplay_id,EventBase::deactivateETID);
     StateNode::DoStart();  // don't activate transitions until our listener has been added
+		if(filename.size()>0) {
+			curplay_id = sndman->PlayFile(filename);
+			erouter->addListener(this,EventBase::audioEGID,curplay_id,EventBase::deactivateETID);
+		}
   }
 
-  //! deactivate the node
+  //! deactivate the node, doesn't stop the sound playback unless the #autostop flag has been set
   virtual void DoStop() {
+		if(autostop)
+			StopPlay();
     erouter->removeListener(this);
     StateNode::DoStop();
   }
 
   //! receive audioEGID status event and throw stateMachineEGID status event
   virtual void processEvent(const EventBase&) {
+		curplay_id = SoundManager::invalid_Play_ID;
 		erouter->postEvent(EventBase::stateMachineEGID,reinterpret_cast<unsigned int>(this),EventBase::statusETID,0,getName(),1);
   }
 
@@ -47,24 +64,27 @@
   //! sets the name of the sound file associated with this node
   void setFileName(std::string &soundfilename) { filename = soundfilename; }
 
-protected:
-  //! constructor
-  SoundNode(std::string &classname, std::string &nodename, std::string &soundfilename) : 
-    StateNode(classname,nodename), filename(soundfilename), curplay_id(SoundManager::invalid_Play_ID) {}
-
+	//! returns the current status of the #autostop flag
+	bool getAutoStop() { return autostop; }
 
+	//! sets the #autostop flag
+	void setAutoStop(bool stop) { autostop=stop; }
 
+protected:
+  //! constructor
+  SoundNode(const std::string &classname, const std::string &nodename, const std::string &soundfilename) : 
+    StateNode(classname,nodename), filename(soundfilename), curplay_id(SoundManager::invalid_Play_ID), autostop(false) {}
 };
 
 /*! @file
  * @brief Defines SoundNode, a simple StateNode that plays a sound and throws a status event upon completion
  * @author dst (Creator)
  *
- * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Author: ejt $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Nodes/TailWagNode.h ./Behaviors/Nodes/TailWagNode.h
--- ../Tekkotsu_2.2.1/Behaviors/Nodes/TailWagNode.h	Mon Nov 15 17:22:36 2004
+++ ./Behaviors/Nodes/TailWagNode.h	Mon Nov 15 17:22:36 2004
@@ -51,7 +51,7 @@
  * @author dst, ejt (Creators)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Nodes/WalkNode.h ./Behaviors/Nodes/WalkNode.h
--- ../Tekkotsu_2.2.1/Behaviors/Nodes/WalkNode.h	Thu Nov 11 15:35:00 2004
+++ ./Behaviors/Nodes/WalkNode.h	Fri Dec  3 19:10:42 2004
@@ -11,25 +11,19 @@
 class WalkNode : public StateNode {
 public:
 	//!constructor
-	WalkNode(StateNode * p=NULL)
-		: StateNode("WalkNode",p), walkid(MotionManager::invalid_MC_ID), walkidIsMine(true), x(0), y(0), a(0)
-	{
-		setRetain(false);
-	}
+	WalkNode()
+		: StateNode("WalkNode"), walkid(MotionManager::invalid_MC_ID), walkidIsMine(true), x(0), y(0), a(0)
+	{}
 
 	//!constructor, positive @a yvel is counter-clockwise from above (to match coordinate system)
-	WalkNode(float xvel, float yvel, float avel, StateNode * p=NULL)
-		: StateNode("WalkNode",p), walkid(MotionManager::invalid_MC_ID), walkidIsMine(true), x(xvel), y(yvel), a(avel)
-	{
-		setRetain(false);
-	}
+	WalkNode(float xvel, float yvel, float avel)
+		: StateNode("WalkNode"), walkid(MotionManager::invalid_MC_ID), walkidIsMine(true), x(xvel), y(yvel), a(avel)
+	{}
 
 	//!constructor, positive @a yvel is counter-clockwise from above (to match coordinate system)
-	WalkNode(const std::string& name, float xvel, float yvel, float avel, StateNode * p=NULL)
-		: StateNode("WalkNode",name,p), walkid(MotionManager::invalid_MC_ID), walkidIsMine(true), x(xvel), y(yvel), a(avel)
-	{
-		setRetain(false);
-	}
+	WalkNode(const std::string& name, float xvel, float yvel, float avel)
+		: StateNode("WalkNode",name), walkid(MotionManager::invalid_MC_ID), walkidIsMine(true), x(xvel), y(yvel), a(avel)
+	{}
 
 	//! sets the velocity of the walk
 	void setVelocity(float xvel, float yvel, float avel) {
@@ -117,10 +111,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Nodes/WalkToTargetNode.cc ./Behaviors/Nodes/WalkToTargetNode.cc
--- ../Tekkotsu_2.2.1/Behaviors/Nodes/WalkToTargetNode.cc	Wed Dec 31 19:00:00 1969
+++ ./Behaviors/Nodes/WalkToTargetNode.cc	Sat Dec  4 23:47:53 2004
@@ -0,0 +1,82 @@
+#include "WalkToTargetNode.h"
+#include "Motion/HeadPointerMC.h"
+#include "Motion/WalkMC.h"
+#include "Motion/MMAccessor.h"
+#include "Events/VisionObjectEvent.h"
+#include "Shared/WorldState.h"
+#include "Behaviors/Transitions/TimeOutTrans.h"
+#include "Behaviors/Transitions/VisualTargetCloseTrans.h"
+
+void WalkToTargetNode::DoStart() {
+	StateNode::DoStart();
+
+	headpointer_id = motman->addPersistentMotion(SharedObject<HeadPointerMC>());
+	walker_id = motman->addPersistentMotion(SharedObject<WalkMC>());
+
+	erouter->addListener(this,EventBase::visObjEGID,tracking);
+}
+
+void WalkToTargetNode::DoStop() {
+	erouter->removeListener(this);
+
+	motman->removeMotion(headpointer_id);
+	headpointer_id=MotionManager::invalid_MC_ID;
+	motman->removeMotion(walker_id);
+	walker_id=MotionManager::invalid_MC_ID;
+
+	StateNode::DoStop();
+}
+
+//this could be cleaned up event-wise (only use a timer when out of view)
+void WalkToTargetNode::processEvent(const EventBase& event) {
+	static float horiz=0,vert=0;
+	const VisionObjectEvent *ve = dynamic_cast<const VisionObjectEvent*>(&event);
+	if(ve!=NULL && event.getTypeID()==EventBase::statusETID) {
+		horiz=ve->getCenterX();
+		vert=ve->getCenterY();
+	} else
+		return;
+
+	//cout << "Pos: " << horiz << ' ' << vert << endl;
+
+	double tilt=state->outputs[HeadOffset+TiltOffset]-vert*M_PI/6;
+	double pan=state->outputs[HeadOffset+PanOffset]-horiz*M_PI/7.5;
+	if(tilt>outputRanges[HeadOffset+TiltOffset][MaxRange])
+		tilt=outputRanges[HeadOffset+TiltOffset][MaxRange];
+	if(tilt<outputRanges[HeadOffset+TiltOffset][MinRange]*3/4)
+		tilt=outputRanges[HeadOffset+TiltOffset][MinRange]*3/4;
+	if(pan>outputRanges[HeadOffset+PanOffset][MaxRange]*2/3)
+		pan=outputRanges[HeadOffset+PanOffset][MaxRange]*2/3;
+	if(pan<outputRanges[HeadOffset+PanOffset][MinRange]*2/3)
+		pan=outputRanges[HeadOffset+PanOffset][MinRange]*2/3;
+	{MMAccessor<HeadPointerMC>(headpointer_id)->setJoints(tilt,pan,0);} //note use of {}'s to limit scope
+	
+	{
+		MMAccessor<WalkMC> walker(walker_id);
+		if(pan<-.05 || pan>.05)
+			walker->setTargetVelocity(100,0,pan);
+		else
+			walker->setTargetVelocity(160,0,0);
+	}
+}
+
+Transition* WalkToTargetNode::newDefaultLostTrans(StateNode* dest) {
+	return new TimeOutTrans(dest,1500,EventBase::visObjEGID,tracking);
+}
+
+Transition* WalkToTargetNode::newDefaultCloseTrans(StateNode* dest) {
+	return new VisualTargetCloseTrans(dest,tracking);
+}
+
+
+/*! @file
+ * @brief Implements WalkToTargetNode, a state node for walking towards a visual target
+ * @author ejt (Creator)
+ *
+ * $Author: ejt $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
+ * $State: Exp $
+ * $Date: 2004/12/23 08:41:24 $
+ */
+
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Nodes/WalkToTargetNode.h ./Behaviors/Nodes/WalkToTargetNode.h
--- ../Tekkotsu_2.2.1/Behaviors/Nodes/WalkToTargetNode.h	Wed Dec 31 19:00:00 1969
+++ ./Behaviors/Nodes/WalkToTargetNode.h	Wed Dec  8 14:05:50 2004
@@ -0,0 +1,63 @@
+//-*-c++-*-
+#ifndef INCLUDED_WalkToTargetNode_h_
+#define INCLUDED_WalkToTargetNode_h_
+
+#include "Behaviors/StateNode.h"
+#include "Motion/MotionManager.h"
+
+//! a state node for walking towards a visual target
+class WalkToTargetNode : public StateNode {
+public:
+	//!constructor, pass VisionObjectSourceID_t
+	WalkToTargetNode(unsigned int obj)
+		: StateNode("WalkToTargetNode","WalkToTarget"),tracking(obj),
+			walker_id(MotionManager::invalid_MC_ID), headpointer_id(MotionManager::invalid_MC_ID) 
+	{}
+	
+	//!constructor, pass instance name and VisionObjectSourceID_t
+	WalkToTargetNode(const std::string& nodename, unsigned int obj)
+		: StateNode("WalkToTargetNode",nodename),tracking(obj),
+			walker_id(MotionManager::invalid_MC_ID), headpointer_id(MotionManager::invalid_MC_ID) 
+	{}
+	
+	virtual void DoStart();
+	virtual void DoStop();
+
+	static std::string getClassDescription() { return "walks towards a visual target, using some basic logic for moving the head to track it"; }
+	virtual std::string getDescription() const { return getClassDescription(); }
+
+	//uses head to watch ball, walks towards it
+	virtual void processEvent(const EventBase& event);
+	
+	virtual Transition* newDefaultLostTrans(StateNode* dest);  //!< returns a suggested transition for detecting "lost" condition, but you don't have to use it
+	virtual Transition* newDefaultCloseTrans(StateNode* dest); //!< returns a suggested transition for detecting "close to target" condition, but you don't have to use it
+
+
+protected:
+	//!constructor, pass class name, instance name, and VisionObjectSourceID_t
+	WalkToTargetNode(const std::string& classname, const std::string& nodename, unsigned int obj)
+		: StateNode(classname,nodename),tracking(obj),
+			walker_id(MotionManager::invalid_MC_ID), headpointer_id(MotionManager::invalid_MC_ID) 
+	{}
+	
+	unsigned int tracking; //!< the object being tracked
+	MotionManager::MC_ID walker_id; //!< so we can walk
+	MotionManager::MC_ID headpointer_id; //!< so we can point the head at the object
+
+private:
+	WalkToTargetNode(const WalkToTargetNode&); //!< don't call this
+	WalkToTargetNode operator=(const WalkToTargetNode&); //!< don't call this
+};
+
+/*! @file
+ * @brief Describes WalkToTargetNode, a state node for walking towards a visual target
+ * @author ejt (Creator)
+ *
+ * $Author: ejt $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
+ * $State: Exp $
+ * $Date: 2004/12/23 08:41:24 $
+ */
+
+#endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/StateNode.cc ./Behaviors/StateNode.cc
--- ../Tekkotsu_2.2.1/Behaviors/StateNode.cc	Wed Nov 10 20:45:31 2004
+++ ./Behaviors/StateNode.cc	Fri Dec 17 00:50:56 2004
@@ -15,10 +15,11 @@
 	}
 }
 
-void StateNode::addTransition(Transition* trans) {
+Transition* StateNode::addTransition(Transition* trans) {
 	transitions.push_back(trans);
 	trans->AddReference();
 	trans->addSource(this);
+	return trans;
 }
 
 StateNode* StateNode::addNode(StateNode* node) {
@@ -76,9 +77,9 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
diff -urdN ../Tekkotsu_2.2.1/Behaviors/StateNode.h ./Behaviors/StateNode.h
--- ../Tekkotsu_2.2.1/Behaviors/StateNode.h	Mon Nov 15 17:46:19 2004
+++ ./Behaviors/StateNode.h	Fri Dec 17 00:50:56 2004
@@ -14,24 +14,30 @@
 	//! deprecated, behavior constructors should take a name argument (which by default should be the name of the type of the class)
 	StateNode() __attribute__((deprecated));
 
-	//!constructor, pass a name to use and the parent node if applicable (usually 'this' within setup())
-	StateNode(const std::string& name, StateNode* p=NULL) : BehaviorBase("StateNode",name), parent(p), transitions(), issetup(false), retain(true), nodes() {}
+	//!constructor, pass a name to use
+	StateNode(const std::string& name) : BehaviorBase("StateNode",name), parent(NULL), transitions(), issetup(false), retain(true), nodes() {}
 
 	//!destructor, removes references to its outgoing transitions (be careful of incoming ones - they're still around!), and calls RemoveReference() on subnodes
 	virtual ~StateNode();
 
 	//!Adds the specified StateTransition to the transition table
-	virtual void addTransition(Transition* trans);
+	virtual Transition* addTransition(Transition* trans);
 
 	//!Returns the std::vector of transitions so you can modify them yourself if need be
 	std::vector<Transition*>& getTransitions() { return transitions; }
 
+	//!Returns the const std::vector of transitions so you can read through them if need be
+	const std::vector<Transition*>& getTransitions() const { return transitions; }
+
 	//!Adds a StateNode to #nodes so it can be automatically dereferenced later, returns what it's passed (for convenience), calls AddReference() on @a node.  Also sets the node's parent to #this if it is null.
 	virtual StateNode* addNode(StateNode* node);
 
-	//!Returns the std::vector of nodes so you can modify them yourself if need be
+	//!Returns the std::vector of sub-nodes so you can modify them yourself if need be
 	std::vector<StateNode*>& getNodes() { return nodes; }
 
+	//!Returns the const std::vector of sub-nodes so you can read through them if need be
+	const std::vector<StateNode*>& getNodes() const { return nodes; }
+
 	//!Sets the retain flag - if not retained, will RemoveReference() subnodes upon DoStop() and recreate them on DoStart (by calling setup()) - may be too expensive to be worth saving memory...
 	void setRetain(bool f) { retain=f; }
 
@@ -47,9 +53,12 @@
 	//!This is called by DoStop() when you should destruct subnodes
 	virtual void teardown() { issetup=false; /*std::cout << "Teardown!!!!!!!!" << std::endl;*/ }
 
+	//!returns #parent
+	virtual StateNode* getParent() const { return parent; }
+
 protected:
-	//!constructor, pass a name to use and the parent node if applicable (usually 'this' within setup())
-	StateNode(const std::string& classname, const std::string& name, StateNode* p=NULL) : BehaviorBase(classname,name), parent(p), transitions(), issetup(false), retain(true), nodes() {}
+	//!constructor, pass the class name and instance name to use 
+	StateNode(const std::string& classname, const std::string& name) : BehaviorBase(classname,name), parent(NULL), transitions(), issetup(false), retain(true), nodes() {}
 
 	//!called by a subnode when it is being DoStart()'ed
 	virtual void transitionTo(StateNode* n);
@@ -81,10 +90,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Transition.cc ./Behaviors/Transition.cc
--- ../Tekkotsu_2.2.1/Behaviors/Transition.cc	Thu Nov 11 15:34:59 2004
+++ ./Behaviors/Transition.cc	Fri Dec 17 00:51:32 2004
@@ -2,6 +2,7 @@
 #include "StateNode.h"
 #include "Wireless/Wireless.h"
 #include "SoundPlay/SoundManager.h"
+#include "Events/EventRouter.h"
 
 /*! @deprecated, use the version of the constructor where you can pass a name */
 Transition::Transition() : BehaviorBase("Transition"), srcs(), dsts(), sound() {}
@@ -28,6 +29,8 @@
 	if(sound.size()!=0)
 		sndman->PlayFile(sound);
 
+	erouter->postEvent(EventBase::stateTransitionEGID,reinterpret_cast<int>(this),EventBase::statusETID,0,getName(),1);
+
 	for(unsigned int i=0; i<srcs.size(); i++)
 		if(srcs[i]->isActive()) //It's usually a bad idea to call DoStop/DoStart when it's already stopped/started...
 			srcs[i]->DoStop();
@@ -60,9 +63,9 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Transition.h ./Behaviors/Transition.h
--- ../Tekkotsu_2.2.1/Behaviors/Transition.h	Mon Nov 15 17:46:19 2004
+++ ./Behaviors/Transition.h	Mon Nov 15 17:46:19 2004
@@ -95,7 +95,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Transitions/CompareTrans.h ./Behaviors/Transitions/CompareTrans.h
--- ../Tekkotsu_2.2.1/Behaviors/Transitions/CompareTrans.h	Mon Nov 15 17:46:19 2004
+++ ./Behaviors/Transitions/CompareTrans.h	Mon Nov 15 17:46:19 2004
@@ -95,7 +95,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Transitions/CompletionTrans.h ./Behaviors/Transitions/CompletionTrans.h
--- ../Tekkotsu_2.2.1/Behaviors/Transitions/CompletionTrans.h	Mon Nov 15 17:46:19 2004
+++ ./Behaviors/Transitions/CompletionTrans.h	Wed Dec 22 20:47:07 2004
@@ -9,13 +9,15 @@
 //! causes a transition when at least @e n sources have signalled completion;  @e n = 0 means "all" (default)
 class CompletionTrans : public Transition {
 protected:
-  int minsrcs;
+  int minsrcs; //!< the minimum number of sources which must signal completion before this transition will fire
   bool *completions;  //!< pointer to array for recording completion events for all sources
 
 public:
+	//! constructor, pass @a destination and the minimum number of sources which must signal completion before this transition will fire
   CompletionTrans(StateNode* destination, int n=0) :
     Transition("CompletionTrans",destination), minsrcs(n), completions(NULL) {};
 
+	//! constructor, pass @a name, @a destination and the minimum number of times the source must signal completion beyond the first (@a n)
   CompletionTrans(const std::string& name, StateNode* destination, int n=0) :
     Transition("CompletionTrans",name,destination), minsrcs(n), completions(NULL) {};
 
@@ -70,10 +72,10 @@
  * @author dst (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Transitions/EventTrans.h ./Behaviors/Transitions/EventTrans.h
--- ../Tekkotsu_2.2.1/Behaviors/Transitions/EventTrans.h	Mon Nov 15 17:46:19 2004
+++ ./Behaviors/Transitions/EventTrans.h	Wed Dec 22 20:47:07 2004
@@ -9,12 +9,14 @@
 
 class EventTrans : public Transition {
 private:
-  int argcount;
-  EventBase::EventGeneratorID_t egid;
-  unsigned int esid;
-  EventBase::EventTypeID_t etid;
+  int argcount; //!< the number of arguments which were supplied to the constructor (granularity of filtering)
+  EventBase::EventGeneratorID_t egid; //!< the requested generator
+  unsigned int esid; //!< the requested source
+  EventBase::EventTypeID_t etid; //!< the requested type
 
 public:
+	//!@name Constructors
+	//! follows general pattern of EventRouter::addListener()
   EventTrans(StateNode* destination, EventBase::EventGeneratorID_t gid)
 		: Transition("EventTrans",destination), argcount(1), egid(gid), esid(0), etid(EventBase::statusETID)
 	{}
@@ -38,6 +40,7 @@
   EventTrans(const std::string& name, StateNode* destination, EventBase::EventGeneratorID_t gid, unsigned int sid, EventBase::EventTypeID_t tid)
 		: Transition("EventTrans",name,destination), argcount(3), egid(gid), esid(sid), etid(tid)
 	{}
+	//@}
 
   //! starts listening
   virtual void DoStart() {
@@ -65,10 +68,10 @@
  * @author dst (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Transitions/LostTargetTrans.h ./Behaviors/Transitions/LostTargetTrans.h
--- ../Tekkotsu_2.2.1/Behaviors/Transitions/LostTargetTrans.h	Tue Nov 16 21:51:49 2004
+++ ./Behaviors/Transitions/LostTargetTrans.h	Wed Dec 22 20:47:07 2004
@@ -49,6 +49,7 @@
   virtual void set_minframes(int minframes) { minf = minframes; }
 
 protected:
+	//! constructor, only to be called by subclasses (which need to specify their own @a classname)
   LostTargetTrans(const std::string &classname, const std::string &instancename, 
 		  StateNode* destination, unsigned int source_id,
 		  unsigned int delay, int minframes=5) :
@@ -57,7 +58,7 @@
 
 
  private:
-  unsigned int sid;
+  unsigned int sid; //!< the source id from the detector of the object which is being monitored
   int minf;   //!< number of frames that target must be seen before resetting the timer
   int counter; //!< number of frames target has been seen so far
 };
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Transitions/NullTrans.h ./Behaviors/Transitions/NullTrans.h
--- ../Tekkotsu_2.2.1/Behaviors/Transitions/NullTrans.h	Mon Nov 15 17:46:19 2004
+++ ./Behaviors/Transitions/NullTrans.h	Wed Dec 22 20:47:07 2004
@@ -12,7 +12,8 @@
   NullTrans(StateNode* destination) : Transition("NullTrans",destination) {}
 	
   //! constructor
-  NullTrans(const std::string& name, StateNode* destination) : Transition("NullTrans",name,destination) {}
+  NullTrans(const std::string& name, StateNode* destination) : 
+    Transition("NullTrans",name,destination) {}
 	
   //!starts 0 msec timer, so transition will occur very soon
   virtual void DoStart() {
@@ -25,6 +26,13 @@
 
   //!when timer event is received, fire() the transition
   virtual void processEvent(const EventBase&) { fire(); }
+
+protected:
+	//! constructor, only to be called by subclasses (which need to specify their own @a classname)
+  NullTrans(const std::string &classname, const std::string &instancename, 
+	    StateNode* destination) :
+    Transition(classname,instancename,destination) {}
+
 };
 
 /*! @file
@@ -32,10 +40,10 @@
  * @author dst (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Transitions/RandomTrans.cc ./Behaviors/Transitions/RandomTrans.cc
--- ../Tekkotsu_2.2.1/Behaviors/Transitions/RandomTrans.cc	Wed Dec 31 19:00:00 1969
+++ ./Behaviors/Transitions/RandomTrans.cc	Sun Nov 28 00:58:38 2004
@@ -0,0 +1,61 @@
+#include <stdlib.h>
+#include <vector>
+
+#include "../BehaviorBase.h"
+#include "../../SoundPlay/SoundManager.h"
+#include "../StateNode.h"
+#include "RandomTrans.h"
+
+// Constructors
+
+RandomTrans::RandomTrans(StateNode* destination, float weight) :
+  NullTrans("RandomTrans",destination), weights()
+   { if (destination!=NULL) addWeight(weight); }
+
+RandomTrans::RandomTrans(const std::string& name, StateNode* destination, float weight) : 
+  NullTrans("RandomTrans",name,destination), weights()
+   { if (destination!=NULL) addWeight(weight); }
+
+RandomTrans::RandomTrans(const std::string &classname, const std::string &instancename, 
+			 StateNode* destination, float weight) :
+  NullTrans(classname,instancename,destination), weights()
+   { if (destination!=NULL) 
+     addWeight(weight>0 ? weight : 0); }
+
+void RandomTrans::addDestination(StateNode* destination, float weight) {
+  NullTrans::addDestination(destination);
+  addWeight(weight);
+}
+
+void RandomTrans::addWeight(float weight) {
+  weights.push_back(weight);
+}
+
+void RandomTrans::fire() {
+  AddReference(); // for safety
+  if ( sound.size()!=0 )
+    sndman->PlayFile(sound);
+
+  for(size_t i=0; i<srcs.size(); i++)
+    if(srcs[i]->isActive())  // don't deactivate a non-active node
+      srcs[i]->DoStop();
+
+  float weightsum = 0;
+  for  (size_t i = 0; i < dsts.size(); i++)
+    weightsum += weights[i]; // could check if not in history list, if we had one
+  if (weightsum == 0)
+    std::cerr << getName() << " has no non-zero-weighted destinations!" << std::endl;
+  else {
+    const float randval = weightsum * (rand()/(RAND_MAX+1.0));
+    float s = weights[0];
+    for  (size_t i = 0; i < dsts.size(); s+=weights[++i])
+      if (randval <= s) {
+	if (!dsts[i]->isActive())
+	  dsts[i]->DoStart();
+	break;
+      };
+  }
+
+  RemoveReference();
+}
+    
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Transitions/RandomTrans.h ./Behaviors/Transitions/RandomTrans.h
--- ../Tekkotsu_2.2.1/Behaviors/Transitions/RandomTrans.h	Wed Dec 31 19:00:00 1969
+++ ./Behaviors/Transitions/RandomTrans.h	Wed Dec 22 20:47:07 2004
@@ -0,0 +1,44 @@
+//-*-c++-*-
+#ifndef INCLUDED_RandomTrans_h_
+#define INCLUDED_RandomTrans_h_
+
+#include "Behaviors/Transitions/NullTrans.h"
+#include "Events/EventRouter.h"
+
+//! A transition that fires immediately, randomly choosing one destination node to activate.
+
+/*! This class should be extended in the following way:
+ *
+ *  setHistoryLength(int n) to maintain a history of recent choices that are
+ *  not to be reused, i.e., drawing without replacement
+ */
+
+class RandomTrans : public NullTrans {
+public:
+  //! constructor
+  RandomTrans(StateNode* destination, float weight=1);
+	
+  //! constructor
+  RandomTrans(const std::string& name, StateNode* destination, float weight=1);
+
+  //! Add a destination node with an optional weight.
+  virtual void RandomTrans::addDestination(StateNode* destination) {
+    addDestination(destination,1); }
+
+  void addDestination(StateNode* destination, float weight);
+
+  //! Firing this type of transition activates one destination node at random, 
+  //! instead of all nodes.
+  virtual void fire();
+
+protected:
+	//! constructor, only to be called by subclasses (which need to specify their own @a classname)
+  RandomTrans(const std::string &classname, const std::string &instancename, 
+	    StateNode* destination, float weight=1);
+
+private:
+  std::vector<float> weights; //!< the probably of selection for each source
+  void addWeight(float weight); //!< adds a weight entry to the back of the queue
+};
+
+#endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Transitions/SmoothCompareTrans.h ./Behaviors/Transitions/SmoothCompareTrans.h
--- ../Tekkotsu_2.2.1/Behaviors/Transitions/SmoothCompareTrans.h	Mon Nov 15 17:46:19 2004
+++ ./Behaviors/Transitions/SmoothCompareTrans.h	Mon Dec 13 22:24:57 2004
@@ -16,7 +16,7 @@
 public:
 	//! constructor, see SmoothCompareTrans class notes for information
   SmoothCompareTrans(StateNode* destination, const T* monitor, typename SmoothCompareTrans<T>::Test_t test, const T& value, const EventBase& poll, float gammap=0)
-		: CompareTrans<T>("SmoothCompareTrans",destination,&avg,test,value,poll), avg(*monitor), realmon(monitor),
+		: CompareTrans<T>("SmoothCompareTrans","SmoothCompareTrans",destination,&avg,test,value,poll), avg(*monitor), realmon(monitor),
 		burnin((unsigned int)(1/(1-gammap))), tests(0), g(gammap)
 	{ }
 
@@ -73,10 +73,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Transitions/TimeOutTrans.h ./Behaviors/Transitions/TimeOutTrans.h
--- ../Tekkotsu_2.2.1/Behaviors/Transitions/TimeOutTrans.h	Mon Nov 15 17:46:19 2004
+++ ./Behaviors/Transitions/TimeOutTrans.h	Fri Dec  3 19:11:19 2004
@@ -6,22 +6,47 @@
 #include "Events/EventRouter.h"
 
 //! causes a transition after a specified amount of time has passed
+/*! If any event parameters are specified, this transition will listen
+ *  for matching events, and if any are received, it will reset the
+ *  timer */
 class TimeOutTrans : public Transition {
 public:
   //! constructor, specify delay in milliseconds
-  TimeOutTrans(StateNode* destination, unsigned int delay) : Transition("TimeOutTrans",destination), d(delay) {}
+  TimeOutTrans(StateNode* destination, unsigned int delay)
+		: Transition("TimeOutTrans","TimeOutTrans",destination), d(delay),
+			eventargcount(0), egid(EventBase::unknownEGID), esid(0), etid(EventBase::statusETID) {}
 
-  //! constructor, specify delay in milliseconds
-  TimeOutTrans(const std::string& name, StateNode* destination, unsigned int delay) : Transition("TimeOutTrans",name,destination), d(delay) {}
+  //! constructor, specify delay in milliseconds, if any events matching given parameters are received, the timer will be reset
+  TimeOutTrans(StateNode* destination, unsigned int delay, EventBase::EventGeneratorID_t gid)
+		: Transition("TimeOutTrans","TimeOutTrans",destination), d(delay),
+			eventargcount(1), egid(gid), esid(0), etid(EventBase::statusETID) {}
+
+  //! constructor, specify delay in milliseconds, if any events matching given parameters are received, the timer will be reset
+  TimeOutTrans(StateNode* destination, unsigned int delay, EventBase::EventGeneratorID_t gid, unsigned int sid)
+		: Transition("TimeOutTrans","TimeOutTrans",destination), d(delay),
+			eventargcount(2), egid(gid), esid(sid), etid(EventBase::statusETID) {}
+
+  //! constructor, specify delay in milliseconds, if any events matching given parameters are received, the timer will be reset
+  TimeOutTrans(StateNode* destination, unsigned int delay, EventBase::EventGeneratorID_t gid, unsigned int sid, EventBase::EventTypeID_t tid)
+		: Transition("TimeOutTrans","TimeOutTrans",destination), d(delay),
+			eventargcount(3), egid(gid), esid(sid), etid(tid) {}
 
   //!starts timer
   virtual void DoStart() {
     Transition::DoStart();
+    switch (eventargcount) {
+    case 1: erouter->addListener(this,egid); break;
+    case 2: erouter->addListener(this,egid,esid); break;
+    case 3: erouter->addListener(this,egid,esid,etid); break;
+    };
     resetTimer(); 
   }
 
   //!stops timer
-  virtual void DoStop() { erouter->removeListener(this); Transition::DoStop(); }
+  virtual void DoStop() {
+		erouter->removeListener(this);
+		Transition::DoStop();
+	}
   
   //!resets timer
   void resetTimer() {
@@ -30,17 +55,30 @@
   }
 
   //!if we receive the timer event, fire()
-  virtual void processEvent(const EventBase&) {
+  virtual void processEvent(const EventBase& e) {
     // std::cout << "Timeout @ " << get_time() << " from " << event.getName() << ' ' << this << std::endl;
-    fire();
+		if(e.getGeneratorID()==EventBase::timerEGID)
+			fire();
+		else
+			resetTimer();
   }
 
 protected:
-  //! constructor, specify delay in milliseconds
-  TimeOutTrans(const std::string& classname, const std::string& instancename, StateNode* destination, unsigned int delay) : Transition(classname,instancename,destination), d(delay) {}
+  //! constructor, specify delay in milliseconds - use assignment in your subclass's constructor if you want set #egid,#esid,#etid (don't forget #eventargcount!)
+  TimeOutTrans(const std::string& classname, const std::string& instancename, StateNode* destination, unsigned int delay)
+		: Transition(classname,instancename,destination), d(delay),
+			eventargcount(0), egid(EventBase::unknownEGID), esid(0), etid(EventBase::statusETID) {}
 
   //!amount to delay (in milliseconds) before transition
   unsigned int d;
+
+	//!level of specificity of events to listen for
+	unsigned int eventargcount;
+
+  EventBase::EventGeneratorID_t egid; //!< the event generator to listen for
+  unsigned int esid; //!< the source to listen for
+  EventBase::EventTypeID_t etid; //!< the type to listen for
+
 };
 
 /*! @file
@@ -48,10 +86,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Transitions/VisualTargetCloseTrans.h ./Behaviors/Transitions/VisualTargetCloseTrans.h
--- ../Tekkotsu_2.2.1/Behaviors/Transitions/VisualTargetCloseTrans.h	Mon Nov 15 17:46:19 2004
+++ ./Behaviors/Transitions/VisualTargetCloseTrans.h	Mon Nov 15 17:46:19 2004
@@ -54,7 +54,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Behaviors/Transitions/VisualTargetTrans.h ./Behaviors/Transitions/VisualTargetTrans.h
--- ../Tekkotsu_2.2.1/Behaviors/Transitions/VisualTargetTrans.h	Mon Nov 15 17:46:19 2004
+++ ./Behaviors/Transitions/VisualTargetTrans.h	Mon Nov 15 17:46:19 2004
@@ -62,7 +62,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Events/ButtonEvent.cc ./Events/ButtonEvent.cc
--- ../Tekkotsu_2.2.1/Events/ButtonEvent.cc	Thu Sep 16 16:39:53 2004
+++ ./Events/ButtonEvent.cc	Wed Dec 31 19:00:00 1969
@@ -1,86 +0,0 @@
-#include "ButtonEvent.h"
-#include <sstream>
-
-std::string
-ButtonEvent::getDescription(bool /*showTypeSpecific=true*/, unsigned int verbosity/*=0*/) const {
-	std::ostringstream logdata;
-	logdata << getName();
-	char hexstring[30];
-	snprintf(hexstring,sizeof(hexstring),"0x%x",getSourceID());
-	logdata << '\t' << hexstring;
-	switch(getTypeID()) {
-	case EventBase::activateETID:
-		logdata << "\tA"; break;
-	case EventBase::statusETID:
-		logdata << "\tS"; break;
-	case EventBase::deactivateETID:
-		logdata << "\tD"; break;
-	case EventBase::numETIDs:
-		logdata << "\tU"; break;  //UNKNOWN TYPE
-	}
-	if(verbosity>=1)
-		logdata << '\t' << getDuration() << '\t' << getTimeStamp();
-	if(verbosity>=2)
-		logdata << '\t' << getMagnitude();
-	return logdata.str();
-}
-
-unsigned int
-ButtonEvent::getBinSize() const {
-	unsigned int used=0;
-	used+=creatorSize("ButtonEvent");
-	used+=EventBase::getBinSize();
-	return used;
-}
-
-unsigned int
-ButtonEvent::LoadBuffer(const char buf[], unsigned int len) {
-	unsigned int origlen=len;
-	unsigned int used=0;
-	if(0==(used=checkCreator("ButtonEvent",buf,len,true))) return 0;
-	len-=used; buf+=used;
-	if(0==(used=EventBase::LoadBuffer(buf,len))) return 0;
-	len-=used; buf+=used;
-	return origlen-len;	
-}
-
-unsigned int
-ButtonEvent::SaveBuffer(char buf[], unsigned int len) const {
-	unsigned int origlen=len;
-	unsigned int used=0;
-	if(0==(used=saveCreator("ButtonEvent",buf,len))) return 0;
-	len-=used; buf+=used;
-	if(0==(used=EventBase::SaveBuffer(buf,len))) return 0;
-	len-=used; buf+=used;
-	return origlen-len;
-}
-
-void
-ButtonEvent::genName() {
-	if(!nameisgen)
-		return;
-	if(genID<numEGIDs) {
-		stim_id=std::string("Evt_");
-		stim_id+=EventGeneratorNames[genID];
-	} else {
-		stim_id=std::string("Evt_InvalidGen");
-		stim_id+=genID; 
-	}
-	stim_id+="::";
-	char tmp[16];
-	snprintf(tmp,16,"0x%x",sourceID);
-	stim_id+=tmp;
-}
-
-
-/*! @file
- * @brief 
- * @author YOURNAMEHERE (Creator)
- *
- * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
- * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
- */
-
diff -urdN ../Tekkotsu_2.2.1/Events/ButtonEvent.h ./Events/ButtonEvent.h
--- ../Tekkotsu_2.2.1/Events/ButtonEvent.h	Thu Sep 16 16:39:53 2004
+++ ./Events/ButtonEvent.h	Wed Dec 31 19:00:00 1969
@@ -1,41 +0,0 @@
-//-*-c++-*-
-#ifndef INCLUDED_ButtonEvent_h_
-#define INCLUDED_ButtonEvent_h_
-
-#include "EventBase.h"
-
-//! redefines getName and getDescription to use the button names instead of numerical source IDs (doesn't define any new data members - magnitude is used for pressure sensitive buttons)
-class ButtonEvent : public EventBase {
-public:
-	/*! @name Constructors/Destructors */
-	//! constructor
-	/*! @see EventRouter::postEvent() */
-	ButtonEvent() : EventBase() {}
-	ButtonEvent(unsigned int sid, EventTypeID_t tid, unsigned int dur, float mag) : EventBase(buttonEGID,sid,tid) { setDuration(dur); setMagnitude(mag); }
-	virtual ~ButtonEvent() {} //!< destructor
-	//@}
-	
-	virtual std::string getDescription(bool showTypeSpecific=true, unsigned int verbosity=0) const; 
-
-	//! Useful for serializing events to send between processes
-	/*! @name LoadSave interface */
-	virtual unsigned int getBinSize() const;
-	virtual unsigned int LoadBuffer(const char buf[], unsigned int len);
-	virtual unsigned int SaveBuffer(char buf[], unsigned int len) const;
-	//@}
-protected:
-	virtual void genName();
-};
-
-/*! @file
- * @brief Describes ButtonEvent, redefines getName and getDescription to use the button names instead of numerical source IDs
- * @author ejt (Creator)
- *
- * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
- * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
- */
-
-#endif
diff -urdN ../Tekkotsu_2.2.1/Events/DataEvent.h ./Events/DataEvent.h
--- ../Tekkotsu_2.2.1/Events/DataEvent.h	Sun Jan 18 05:16:57 2004
+++ ./Events/DataEvent.h	Sun Jan 18 05:16:57 2004
@@ -32,7 +32,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Events/EventBase.cc ./Events/EventBase.cc
--- ../Tekkotsu_2.2.1/Events/EventBase.cc	Tue Sep 28 19:07:02 2004
+++ ./Events/EventBase.cc	Wed Dec 22 18:54:07 2004
@@ -17,6 +17,7 @@
 	"powerEGID",
 	"sensorEGID",
 	"stateMachineEGID",
+	"stateTransitionEGID",
 	"testmsgEGID",
 	"timerEGID",
 	"visOFbkEGID",
@@ -49,31 +50,49 @@
 }
 
 EventBase::EventBase(EventGeneratorID_t gid, unsigned int sid, EventTypeID_t tid, unsigned int dur, const std::string& n, float mag)
-	: LoadSave(), stim_id(n), magnitude(mag), timestamp(get_time()), nameisgen(false), genID(gid), typeID(tid), sourceID(sid), duration(dur)
+	: LoadSave(), stim_id(), magnitude(mag), timestamp(get_time()), nameisgen(true), genID(gid), typeID(tid), sourceID(sid), duration(dur)
 {
-	
+	setName(n);
 }
 
-std::string
-EventBase::getDescription(bool /*showTypeSpecific=true*/, unsigned int verbosity/*=0*/) const {
-	std::ostringstream logdata;
-	logdata << getName();
-	char hexstring[30];
-	snprintf(hexstring,sizeof(hexstring),"0x%x",getSourceID());
-	logdata << '\t' << hexstring;
+EventBase&
+EventBase::setName(const std::string& sourcename) {
+	stim_id='(';
+	if(genID<numEGIDs) {
+		stim_id+=EventGeneratorNames[genID];
+	} else {
+		stim_id+=std::string("InvalidGen");
+		char tmp2[16];
+		snprintf(tmp2,16,"(%d)",genID);
+		stim_id+=tmp2; 
+	}
+	stim_id+=',';
+	stim_id+=sourcename;
+	stim_id+=',';
 	switch(getTypeID()) {
 	case EventBase::activateETID:
-		logdata << "\tA"; break;
+		stim_id+='A'; break;
 	case EventBase::statusETID:
-		logdata << "\tS"; break;
+		stim_id+='S'; break;
 	case EventBase::deactivateETID:
-		logdata << "\tD"; break;
-	case EventBase::numETIDs:
-		logdata << "\tU"; break;  //UNKNOWN TYPE
+		stim_id+='D'; break;
+	default:
+		stim_id+='U'; break; //unknown
 	}
+	stim_id+=')';
+	nameisgen=false;
+	return *this;
+}
+
+std::string
+EventBase::getDescription(bool /*showTypeSpecific=true*/, unsigned int verbosity/*=0*/) const {
+	std::ostringstream logdata;
+	logdata << getName();
 	if(verbosity>=1)
-		logdata << '\t' << getDuration() << '\t' << getTimeStamp();
+		logdata << '\t' << getGeneratorID() << '\t' << getSourceID() << '\t' << getTypeID();
 	if(verbosity>=2)
+		logdata << '\t' << getDuration() << '\t' << getTimeStamp();
+	if(verbosity>=3)
 		logdata << '\t' << getMagnitude();
 	return logdata.str();
 }
@@ -150,17 +169,10 @@
 EventBase::genName() {
 	if(!nameisgen)
 		return;
-	if(genID<numEGIDs) {
-		stim_id=std::string("Evt_");
-		stim_id+=EventGeneratorNames[genID];
-	} else {
-		stim_id=std::string("Evt_InvalidGen");
-		stim_id+=genID; 
-	}
-	stim_id+="::";
 	char tmp[16];
-	snprintf(tmp,16,"0x%x",sourceID);
-	stim_id+=tmp;
+	snprintf(tmp,16,"%d",sourceID);
+	setName(tmp);
+	nameisgen=true;
 }
 
 /*! @file
@@ -168,9 +180,9 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
diff -urdN ../Tekkotsu_2.2.1/Events/EventBase.h ./Events/EventBase.h
--- ../Tekkotsu_2.2.1/Events/EventBase.h	Mon Oct 18 12:59:20 2004
+++ ./Events/EventBase.h	Wed Dec 22 18:12:59 2004
@@ -61,7 +61,8 @@
 		motmanEGID,       //!< Sends events when a MotionCommand is added or removed, SID is is the MotionManager::MC_ID, duration is always 0; individual MotionCommands may throw status events to signal intermediary status
 		powerEGID,        //!< Sends events for low power warnings, temperature, etc. see PowerSourceID::PowerSourceID_t
 		sensorEGID,       //!< Sends a status event when new sensor readings are available. see SensorSourceID::SensorSourceID_t
-		stateMachineEGID, //!< Sends an event upon entering and leaving a StateNode; SID is pointer to the StateNode; duration is always 0
+		stateMachineEGID, //!< Sends an event upon entering and leaving a StateNode; SID is pointer to the StateNode; duration is always 0; some state will throw a status event when they have completed their task and are now idling
+		stateTransitionEGID, //!< Sends an event each time a transition is triggered; SID is a pointer to the transition; type is always status, duration is always 0; guaranteed to occur immediately *before* the transition actually occurs
     textmsgEGID,      //!< Sends status events when a text msg is received on console; generated by the Controller, SID is always -1; durations is always 0 (see Controller for more information)
 		timerEGID,        //!< Sends timer events; you set timers explicitly, you don't have to listen as well. (See EventRouter::addTimer()) There's no cross-talk, only the listener which requested the timer will receive it; SID is whatever you requested it to be; duration is the time (since boot, in ms) that the timer was supposed to go off; these are always status
 		visOFbkEGID,      //!< Sends a DataEvent < OFbkImageVectorData > for every camera image received from the system; SID and duration are always 0 (This is generated by the MainObj instantiation of MMCombo)
@@ -98,8 +99,8 @@
 	//@}
 
 	/*! @name Methods */
-	virtual const std::string& getName() const { return stim_id; } //!< gets the name of the event - useful for debugging, outputs
-	virtual EventBase& setName(const std::string& n) { nameisgen=false; stim_id=n; return *this; } //!< sets name to a given string, prevents overwriting by generated names
+	virtual const std::string& getName() const { return stim_id; } //!< gets the name of the event - useful for debugging output, see also getDescription()
+	virtual EventBase& setName(const std::string& n); //!< sets name to a given string, prevents overwriting by generated names
 
 	virtual float getMagnitude() const { return magnitude; } //!< gets "strength" of event - by default 1 for activate and status events, 0 for deactivate events
 	virtual EventBase& setMagnitude(float m) { magnitude=m; return *this; }//!< sets "strength" of event - you may want to override the default values (see getMagnitude())
@@ -122,11 +123,12 @@
 	virtual bool isCustomName() const { return !nameisgen; } //!< returns true if not using the generated name
 
 	//! generates a description of the event with variable verbosity 
-	/*! @param showTypeSpecific will signal subclasses to add additional information
+	/*! @param showTypeSpecific should be read by subclasses to add additional information
 	 *  @param verbosity can be one of the following values:
-	 *    - 0 - the name and type
-	 *    - 1 - the name, type, duration, and timestamp
-	 *    - 2 and above - the name, type, duration, and magnitude
+	 *    - 0 - Basic: <i>event_name</i> \\t <i>generator_id</i> \\t <i>source_id</i> \\t <i>type_id</i>
+	 *    - 1 - Numerics: <i>event_name</i> \\t <i>generator_id</i> \\t <i>source_id</i> \\t <i>type_id</i>
+	 *    - 2 - Timing: <i>event_name</i> \\t <i>generator_id</i> \\t <i>source_id</i> \\t <i>type_id</i> \\t <i>duration</i> \\t <i>timestamp</i>
+	 *    - 3 and above - Full: <i>event_name</i> \\t <i>generator_id</i> \\t <i>source_id</i> \\t <i>type_id</i> \\t <i>duration</i> \\t <i>timestamp</i> \\t <i>magnitude</i>
 	 *  if showTypeSpecific, additional fields will be added after the common fields listed above. */
 	virtual std::string getDescription(bool showTypeSpecific=true, unsigned int verbosity=0) const; 
 
@@ -156,8 +158,8 @@
   float magnitude; //!< the current "strength" of the event/stimuli... MAKE SURE this gets set to ZERO IF event is DEACTIVATE
   unsigned int timestamp; //!< the time the event was created - set automatically by constructor
 
-	bool nameisgen; //!< tracks whether the current name (stim_id) is generated or set
-	virtual void genName(); //!< This does the actual generation of names based on genID, sourceID, and typeID
+	bool nameisgen; //!< tracks whether the current name (stim_id) was generated by genName() (true) or setName() (false)
+	virtual void genName(); //!< calls setName() with a string version of sourceID, decimal notation
 
 	EventGeneratorID_t genID; //!< generator ID, see EventGeneratorID_t
 	EventTypeID_t typeID; //!< type ID, see EventTypeID_t
@@ -176,10 +178,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Events/EventGeneratorBase.cc ./Events/EventGeneratorBase.cc
--- ../Tekkotsu_2.2.1/Events/EventGeneratorBase.cc	Tue Nov  9 15:01:49 2004
+++ ./Events/EventGeneratorBase.cc	Tue Nov  9 15:01:49 2004
@@ -73,7 +73,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Events/EventGeneratorBase.h ./Events/EventGeneratorBase.h
--- ../Tekkotsu_2.2.1/Events/EventGeneratorBase.h	Wed Nov 10 20:45:37 2004
+++ ./Events/EventGeneratorBase.h	Mon Dec 20 16:47:59 2004
@@ -20,15 +20,8 @@
  */
 class EventGeneratorBase : public BehaviorBase {
 public:
-	//!@name Constructors
-	//!
-	EventGeneratorBase(const std::string& name, EventBase::EventGeneratorID_t mgid, unsigned int msid)
-		: BehaviorBase(name), myGenID(mgid), mySourceID(msid), autoListen(false), isListening(false), srcGenID(EventBase::unknownEGID), srcSourceID(0)
-	{}
-	EventGeneratorBase(const std::string& name, EventBase::EventGeneratorID_t mgid, unsigned int msid,EventBase::EventGeneratorID_t srcgid, unsigned int srcsid)
-		: BehaviorBase(name), myGenID(mgid), mySourceID(msid), autoListen(true), isListening(false), srcGenID(srcgid), srcSourceID(srcsid)
-	{}
-	//@}
+	// Constructors are all protected - doesn't make sense to
+	// instantiate this class directly, you want to use a subclass
 
 	//! destructor - does nothing
 	virtual ~EventGeneratorBase() {}
@@ -65,6 +58,22 @@
 	virtual void unsetAutoListen();
 
 protected:
+	//!@name Constructors
+	//!
+	EventGeneratorBase(const std::string& name, EventBase::EventGeneratorID_t mgid, unsigned int msid)
+		: BehaviorBase(name), myGenID(mgid), mySourceID(msid), autoListen(false), isListening(false), srcGenID(EventBase::unknownEGID), srcSourceID(0)
+	{}
+	EventGeneratorBase(const std::string& name, EventBase::EventGeneratorID_t mgid, unsigned int msid,EventBase::EventGeneratorID_t srcgid, unsigned int srcsid)
+		: BehaviorBase(name), myGenID(mgid), mySourceID(msid), autoListen(true), isListening(false), srcGenID(srcgid), srcSourceID(srcsid)
+	{}
+	EventGeneratorBase(const std::string& classname, const std::string& instancename, EventBase::EventGeneratorID_t mgid, unsigned int msid)
+		: BehaviorBase(classname,instancename), myGenID(mgid), mySourceID(msid), autoListen(false), isListening(false), srcGenID(EventBase::unknownEGID), srcSourceID(0)
+	{}
+	EventGeneratorBase(const std::string& classname, const std::string& instancename, EventBase::EventGeneratorID_t mgid, unsigned int msid,EventBase::EventGeneratorID_t srcgid, unsigned int srcsid)
+		: BehaviorBase(classname,instancename), myGenID(mgid), mySourceID(msid), autoListen(true), isListening(false), srcGenID(srcgid), srcSourceID(srcsid)
+	{}
+	//@}
+
 	EventBase::EventGeneratorID_t myGenID; //!< the generator ID to broadcast on
 	unsigned int mySourceID;     //!< the source ID to broadcast on
 	bool autoListen;          //!< if true, will automatically start listening for EventBase(genID,sourceID) events
@@ -78,10 +87,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Events/EventListener.h ./Events/EventListener.h
--- ../Tekkotsu_2.2.1/Events/EventListener.h	Thu Sep 25 11:27:10 2003
+++ ./Events/EventListener.h	Thu Sep 25 11:27:10 2003
@@ -20,7 +20,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Events/EventRouter.cc ./Events/EventRouter.cc
--- ../Tekkotsu_2.2.1/Events/EventRouter.cc	Thu Oct  7 18:14:17 2004
+++ ./Events/EventRouter.cc	Wed Dec 22 18:12:59 2004
@@ -99,26 +99,26 @@
 	bool hadListener=hasListeners(egid);
 	listeners.addMapping(el,egid); 
 	if(!hadListener)
-		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::activateETID));
+		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::activateETID,0,EventBase::EventGeneratorNames[egid],1));
 	else
-		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::statusETID));
+		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::statusETID,0,EventBase::EventGeneratorNames[egid],1));
 }
 void EventRouter::addListener(EventListener* el, EventBase::EventGeneratorID_t egid, unsigned int sid) {
 	bool hadListener=hasListeners(egid);
 	for(unsigned int et=0; et<EventBase::numETIDs; et++)
 		listeners.addMapping(el,egid,sid,(EventBase::EventTypeID_t)et);
 	if(!hadListener)
-		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::activateETID));
+		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::activateETID,0,EventBase::EventGeneratorNames[egid],1));
 	else
-		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::statusETID));
+		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::statusETID,0,EventBase::EventGeneratorNames[egid],1));
 }
 void EventRouter::addListener(EventListener* el, EventBase::EventGeneratorID_t egid, unsigned int sid, EventBase::EventTypeID_t etid) {
 	bool hadListener=hasListeners(egid);
 	listeners.addMapping(el,egid,sid,etid);
 	if(!hadListener)
-		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::activateETID));
+		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::activateETID,0,EventBase::EventGeneratorNames[egid],1));
 	else
-		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::statusETID));
+		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::statusETID,0,EventBase::EventGeneratorNames[egid],1));
 }
 void EventRouter::addListener(EventListener* el, const EventBase& e) {
 	if(e.getGeneratorID()==EventBase::timerEGID)
@@ -127,9 +127,9 @@
 		bool hadListener=hasListeners(e.getGeneratorID());
 		listeners.addMapping(el,e.getGeneratorID(),e.getSourceID(),e.getTypeID());
 		if(!hadListener)
-			postEvent(new EventBase(EventBase::erouterEGID,e.getGeneratorID(),EventBase::activateETID));
+			postEvent(new EventBase(EventBase::erouterEGID,e.getGeneratorID(),EventBase::activateETID,0,EventBase::EventGeneratorNames[e.getGeneratorID()],1));
 		else
-			postEvent(new EventBase(EventBase::erouterEGID,e.getGeneratorID(),EventBase::statusETID));
+			postEvent(new EventBase(EventBase::erouterEGID,e.getGeneratorID(),EventBase::statusETID,0,EventBase::EventGeneratorNames[e.getGeneratorID()],1));
 	}
 }
 
@@ -145,9 +145,9 @@
 			return; //nothing was removed, don't want to clean up or throw an event
 		listeners.clean(egid);
 		if(!hasListeners(egid))
-			postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::deactivateETID));
+			postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::deactivateETID,0,EventBase::EventGeneratorNames[egid],0));
 		else
-			postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::statusETID));
+			postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::statusETID,0,EventBase::EventGeneratorNames[egid],1));
 	}
 }
 void EventRouter::removeListener(EventListener* el, EventBase::EventGeneratorID_t egid, unsigned int sid) {
@@ -161,9 +161,9 @@
 			return; //nothing was removed, don't want to clean up or throw an event
 		listeners.clean(egid);
 		if(!hasListeners(egid))
-			postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::deactivateETID));
+			postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::deactivateETID,0,EventBase::EventGeneratorNames[egid],0));
 		else
-			postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::statusETID));
+			postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::statusETID,0,EventBase::EventGeneratorNames[egid],1));
 	}
 }
 void EventRouter::removeListener(EventListener* el, EventBase::EventGeneratorID_t egid, unsigned int sid, EventBase::EventTypeID_t etid) {
@@ -175,9 +175,9 @@
 			return; //nothing was removed, don't want to clean up or throw an event
 		listeners.clean(egid);
 		if(!hasListeners(egid))
-			postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::deactivateETID));
+			postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::deactivateETID,0,EventBase::EventGeneratorNames[egid],0));
 		else
-			postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::statusETID));
+			postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::statusETID,0,EventBase::EventGeneratorNames[egid],1));
 	}
 }
 void EventRouter::removeListener(EventListener* el, const EventBase& e) {
@@ -188,9 +188,9 @@
 			return; //nothing was removed, don't want to clean up or throw an event
 		listeners.clean(e.getGeneratorID());
 		if(!hasListeners(e.getGeneratorID()))
-			postEvent(new EventBase(EventBase::erouterEGID,e.getGeneratorID(),EventBase::deactivateETID));
+			postEvent(new EventBase(EventBase::erouterEGID,e.getGeneratorID(),EventBase::deactivateETID,0,EventBase::EventGeneratorNames[e.getGeneratorID()],0));
 		else
-			postEvent(new EventBase(EventBase::erouterEGID,e.getGeneratorID(),EventBase::statusETID));
+			postEvent(new EventBase(EventBase::erouterEGID,e.getGeneratorID(),EventBase::statusETID,0,EventBase::EventGeneratorNames[e.getGeneratorID()],1));
 	}
 }
 
@@ -202,18 +202,18 @@
 	bool hadListener=hasListeners(e.getGeneratorID());
 	trappers.addMapping(el,e.getGeneratorID(),e.getSourceID(),e.getTypeID());
 	if(!hadListener)
-		postEvent(new EventBase(EventBase::erouterEGID,e.getGeneratorID(),EventBase::activateETID));
+		postEvent(new EventBase(EventBase::erouterEGID,e.getGeneratorID(),EventBase::activateETID,0,EventBase::EventGeneratorNames[e.getGeneratorID()],1));
 	else
-		postEvent(new EventBase(EventBase::erouterEGID,e.getGeneratorID(),EventBase::statusETID));
+		postEvent(new EventBase(EventBase::erouterEGID,e.getGeneratorID(),EventBase::statusETID,0,EventBase::EventGeneratorNames[e.getGeneratorID()],1));
 }
 /*! Note that since timers are not broadcast, they cannot be trapped.  Only the EventListener which requested the timer will receive that timer. */
 void EventRouter::addTrapper(EventTrapper* el, EventBase::EventGeneratorID_t egid) {
 	bool hadListener=hasListeners(egid);
 	trappers.addMapping(el,egid);
 	if(!hadListener)
-		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::activateETID));
+		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::activateETID,0,EventBase::EventGeneratorNames[egid],1));
 	else
-		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::statusETID));
+		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::statusETID,0,EventBase::EventGeneratorNames[egid],1));
 }
 /*! Note that since timers are not broadcast, they cannot be trapped.  Only the EventListener which requested the timer will receive that timer. */
 void EventRouter::addTrapper(EventTrapper* el, EventBase::EventGeneratorID_t egid, unsigned int sid) {
@@ -221,18 +221,18 @@
 	for(unsigned int et=0; et<EventBase::numETIDs; et++)
 		trappers.addMapping(el,egid,sid,(EventBase::EventTypeID_t)et);
 	if(!hadListener)
-		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::activateETID));
+		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::activateETID,0,EventBase::EventGeneratorNames[egid],1));
 	else
-		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::statusETID));
+		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::statusETID,0,EventBase::EventGeneratorNames[egid],1));
 }
 /*! Note that since timers are not broadcast, they cannot be trapped.  Only the EventListener which requested the timer will receive that timer. */
 void EventRouter::addTrapper(EventTrapper* el, EventBase::EventGeneratorID_t egid, unsigned int sid, EventBase::EventTypeID_t etid) {
 	bool hadListener=hasListeners(egid);
 	trappers.addMapping(el,egid,sid,etid);
 	if(!hadListener)
-		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::activateETID));
+		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::activateETID,0,EventBase::EventGeneratorNames[egid],1));
 	else
-		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::statusETID));
+		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::statusETID,0,EventBase::EventGeneratorNames[egid],1));
 }
 
 /*! Note that since timers are not broadcast, they cannot be trapped.  Only the EventListener which requested the timer will receive that timer. */
@@ -247,18 +247,18 @@
 		return; //nothing was removed, don't want to clean up or throw an event
 	trappers.clean(e.getGeneratorID());
 	if(!hasListeners(e.getGeneratorID()))
-		postEvent(new EventBase(EventBase::erouterEGID,e.getGeneratorID(),EventBase::deactivateETID));
+		postEvent(new EventBase(EventBase::erouterEGID,e.getGeneratorID(),EventBase::deactivateETID,0,EventBase::EventGeneratorNames[e.getGeneratorID()],0));
 	else
-		postEvent(new EventBase(EventBase::erouterEGID,e.getGeneratorID(),EventBase::statusETID));
+		postEvent(new EventBase(EventBase::erouterEGID,e.getGeneratorID(),EventBase::statusETID,0,EventBase::EventGeneratorNames[e.getGeneratorID()],1));
 }
 void EventRouter::removeTrapper(EventTrapper* el, EventBase::EventGeneratorID_t egid) {
 	if(!trappers.removeMapping(el,egid))
 		return; //nothing was removed, don't want to clean up or throw an event
 	trappers.clean(egid);
 	if(!hasListeners(egid))
-		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::deactivateETID));
+		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::deactivateETID,0,EventBase::EventGeneratorNames[egid],0));
 	else
-		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::statusETID));
+		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::statusETID,0,EventBase::EventGeneratorNames[egid],1));
 }
 void EventRouter::removeTrapper(EventTrapper* el, EventBase::EventGeneratorID_t egid, unsigned int sid) {
 	int removed=0;
@@ -268,18 +268,18 @@
 		return; //nothing was removed, don't want to clean up or throw an event
 	trappers.clean(egid);
 	if(!hasListeners(egid))
-		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::deactivateETID));
+		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::deactivateETID,0,EventBase::EventGeneratorNames[egid],0));
 	else
-		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::statusETID));
+		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::statusETID,0,EventBase::EventGeneratorNames[egid],1));
 }
 void EventRouter::removeTrapper(EventTrapper* el, EventBase::EventGeneratorID_t egid, unsigned int sid, EventBase::EventTypeID_t etid) {
 	if(!trappers.removeMapping(el,egid,sid,etid))
 		return; //nothing was removed, don't want to clean up or throw an event
 	trappers.clean(egid);
 	if(!hasListeners(egid))
-		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::deactivateETID));
+		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::deactivateETID,0,EventBase::EventGeneratorNames[egid],0));
 	else
-		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::statusETID));
+		postEvent(new EventBase(EventBase::erouterEGID,egid,EventBase::statusETID,0,EventBase::EventGeneratorNames[egid],1));
 }
 
 void EventRouter::removeTrapper(EventTrapper* el) {
@@ -532,10 +532,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 
diff -urdN ../Tekkotsu_2.2.1/Events/EventRouter.h ./Events/EventRouter.h
--- ../Tekkotsu_2.2.1/Events/EventRouter.h	Thu Oct  7 18:14:17 2004
+++ ./Events/EventRouter.h	Wed Dec 22 18:54:41 2004
@@ -90,10 +90,10 @@
 	/*!@brief <b>counts both listeners and trappers</b>, so stuff can tell if it even needs to bother generating an event...*/
 	/* ... if a tree falls in a forest, and there's no one around to see it, does it make a sound?\n
 		 ... if Vision sees a ball in an image, and there's no listeners, does it make an event? ;) */
-	bool hasListeners(EventBase::EventGeneratorID_t egid) { return trappers.hasMapping(egid) || listeners.hasMapping(egid); }
-	bool hasListeners(EventBase::EventGeneratorID_t egid, unsigned int sid) { return trappers.hasMapping(egid,sid) || listeners.hasMapping(egid,sid); }
-	bool hasListeners(EventBase::EventGeneratorID_t egid, unsigned int sid, EventBase::EventTypeID_t etid) { return trappers.hasMapping(egid,sid,etid) || listeners.hasMapping(egid,sid,etid); }
-	bool hasListeners(const EventBase& e) { return hasListeners(e.getGeneratorID(),e.getSourceID(),e.getTypeID()); }
+	bool hasListeners(EventBase::EventGeneratorID_t egid) { return (egid==EventBase::timerEGID) ? timers.size()>0 : trappers.hasMapping(egid) || listeners.hasMapping(egid); }
+	bool hasListeners(EventBase::EventGeneratorID_t egid, unsigned int sid) { return (egid==EventBase::timerEGID) ? timers.size()>0 : trappers.hasMapping(egid,sid) || listeners.hasMapping(egid,sid); }
+	bool hasListeners(EventBase::EventGeneratorID_t egid, unsigned int sid, EventBase::EventTypeID_t etid) { return (egid==EventBase::timerEGID) ? timers.size()>0 : trappers.hasMapping(egid,sid,etid) || listeners.hasMapping(egid,sid,etid); }
+	bool hasListeners(const EventBase& e) { return (e.getGeneratorID()==EventBase::timerEGID) ? timers.size()>0 : hasListeners(e.getGeneratorID(),e.getSourceID(),e.getTypeID()); }
 	//@}
 
 	//!@name Timer Management
@@ -299,10 +299,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Events/EventTranslator.cc ./Events/EventTranslator.cc
--- ../Tekkotsu_2.2.1/Events/EventTranslator.cc	Thu Oct 14 19:02:35 2004
+++ ./Events/EventTranslator.cc	Thu Oct 14 19:02:35 2004
@@ -86,7 +86,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Events/EventTranslator.h ./Events/EventTranslator.h
--- ../Tekkotsu_2.2.1/Events/EventTranslator.h	Thu Sep 16 14:35:12 2004
+++ ./Events/EventTranslator.h	Thu Sep 16 14:35:12 2004
@@ -62,7 +62,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Events/EventTrapper.h ./Events/EventTrapper.h
--- ../Tekkotsu_2.2.1/Events/EventTrapper.h	Thu Sep 25 11:27:10 2003
+++ ./Events/EventTrapper.h	Thu Sep 25 11:27:10 2003
@@ -26,7 +26,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Events/FilterBankEvent.h ./Events/FilterBankEvent.h
--- ../Tekkotsu_2.2.1/Events/FilterBankEvent.h	Sun Jan 18 05:16:57 2004
+++ ./Events/FilterBankEvent.h	Wed Dec 22 18:12:59 2004
@@ -10,7 +10,7 @@
 public:
 	//! constructor
 	FilterBankEvent(FilterBankGenerator* creator,EventBase::EventGeneratorID_t gid,unsigned int sid)
-		: EventBase(gid,sid,EventBase::statusETID), src(creator)
+		: EventBase(gid,sid,EventBase::statusETID,0,creator->getName(),1), src(creator)
 	{}
 
 	//! Gives access to underlying generator
@@ -58,10 +58,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Events/LocomotionEvent.cc ./Events/LocomotionEvent.cc
--- ../Tekkotsu_2.2.1/Events/LocomotionEvent.cc	Wed Sep  1 17:30:57 2004
+++ ./Events/LocomotionEvent.cc	Wed Sep  1 17:30:57 2004
@@ -60,7 +60,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Events/LocomotionEvent.h ./Events/LocomotionEvent.h
--- ../Tekkotsu_2.2.1/Events/LocomotionEvent.h	Wed Sep  1 17:30:57 2004
+++ ./Events/LocomotionEvent.h	Wed Sep  1 17:30:57 2004
@@ -45,7 +45,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Events/SegmentedColorFilterBankEvent.h ./Events/SegmentedColorFilterBankEvent.h
--- ../Tekkotsu_2.2.1/Events/SegmentedColorFilterBankEvent.h	Sun Jan 18 05:16:57 2004
+++ ./Events/SegmentedColorFilterBankEvent.h	Sun Jan 18 05:16:57 2004
@@ -69,7 +69,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Events/TextMsgEvent.cc ./Events/TextMsgEvent.cc
--- ../Tekkotsu_2.2.1/Events/TextMsgEvent.cc	Wed Sep  1 17:30:57 2004
+++ ./Events/TextMsgEvent.cc	Wed Sep  1 17:30:57 2004
@@ -54,7 +54,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Events/TextMsgEvent.h ./Events/TextMsgEvent.h
--- ../Tekkotsu_2.2.1/Events/TextMsgEvent.h	Wed Sep  1 17:30:57 2004
+++ ./Events/TextMsgEvent.h	Wed Sep  1 17:30:57 2004
@@ -35,7 +35,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Events/VisionObjectEvent.h ./Events/VisionObjectEvent.h
--- ../Tekkotsu_2.2.1/Events/VisionObjectEvent.h	Wed Sep  1 17:30:57 2004
+++ ./Events/VisionObjectEvent.h	Wed Sep  1 17:30:57 2004
@@ -46,7 +46,7 @@
  * @author alokl (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/MMCombo/MMCombo.cc ./MMCombo/MMCombo.cc
--- ../Tekkotsu_2.2.1/MMCombo/MMCombo.cc	Fri Nov 12 17:07:39 2004
+++ ./MMCombo/MMCombo.cc	Wed Nov 17 19:04:25 2004
@@ -105,8 +105,8 @@
 		
     //Setup wireless
     wireless = new Wireless();
-    sout=wireless->socket(SocketNS::SOCK_STREAM,Wireless::WIRELESS_DEF_RECV_SIZE,Wireless::WIRELESS_DEF_SEND_SIZE*6);
-    serr=wireless->socket(SocketNS::SOCK_STREAM,Wireless::WIRELESS_DEF_RECV_SIZE,Wireless::WIRELESS_DEF_SEND_SIZE*2);
+    sout=wireless->socket(SocketNS::SOCK_STREAM,Wireless::WIRELESS_DEF_RECV_SIZE,Wireless::WIRELESS_DEF_SEND_SIZE*12);
+    serr=wireless->socket(SocketNS::SOCK_STREAM,Wireless::WIRELESS_DEF_RECV_SIZE,Wireless::WIRELESS_DEF_SEND_SIZE*4);
     wireless->setDaemon(sout);
     wireless->setDaemon(serr);
 		serr->setFlushType(SocketNS::FLUSH_BLOCKING);
@@ -769,10 +769,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 
diff -urdN ../Tekkotsu_2.2.1/MMCombo/MMCombo.h ./MMCombo/MMCombo.h
--- ../Tekkotsu_2.2.1/MMCombo/MMCombo.h	Tue Sep 28 19:07:04 2004
+++ ./MMCombo/MMCombo.h	Tue Sep 28 19:07:04 2004
@@ -141,7 +141,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Makefile ./Makefile
--- ../Tekkotsu_2.2.1/Makefile	Wed Sep  8 15:21:28 2004
+++ ./Makefile	Tue Dec 21 18:53:12 2004
@@ -1,3 +1,8 @@
+############### FRAMEWORK MAKEFILE ################
+############# $Name: HEAD $ ###############
+############### $Revision: 1.1 $ #################
+########## $Date: 2004/12/23 08:41:24 $ ###########
+
 all:
 	@echo INSTALLATION INSTRUCTIONS:
 	@cat INSTALL
@@ -7,6 +12,6 @@
 	@echo Nothing to be done here.
 
 dox docs doc:
-	docs/builddocs --all --update --tree --search --detailed
+	docs/builddocs --update --tree --search --detailed
 
 .PHONY: all update install dox docs doc
diff -urdN ../Tekkotsu_2.2.1/Motion/DynamicMotionSequence.h ./Motion/DynamicMotionSequence.h
--- ../Tekkotsu_2.2.1/Motion/DynamicMotionSequence.h	Thu Sep 25 11:27:22 2003
+++ ./Motion/DynamicMotionSequence.h	Tue Dec 21 17:39:01 2004
@@ -2,17 +2,18 @@
 #ifndef INCLUDED_DynamicMotionSequenceMC_h_
 #define INCLUDED_DynamicMotionSequenceMC_h_
 
-#include "MotionSequenceMC.h"
+#include "MotionSequenceEngine.h"
+#include "MotionCommand.h"
 #include <vector>
 
 //! Uses STL's vector for dynamic memory allocation - don't use this as a motion command, pointers in shared memory regions can be invalid in other processes
-/*! See MotionSequenceMC for documentation on its members */
-class DynamicMotionSequence : public MotionSequence {
+/*! See MotionSequenceEngine for documentation on its members */
+class DynamicMotionSequence : public MotionCommand, public MotionSequenceEngine {
 public:
 	//!constructor
-	DynamicMotionSequence() : MotionSequence(), moves(), erased() {clear();}
+	DynamicMotionSequence() : MotionCommand(), MotionSequenceEngine(), moves(), erased() {clear();}
 	//!constructor, loads from a file and then resets the playtime to beginning and begins to play
-	explicit DynamicMotionSequence(const char* filename) : MotionSequence(), moves(), erased() {clear();LoadFile(filename);setPlayTime(1);}
+	explicit DynamicMotionSequence(const char* filename) : MotionCommand(), MotionSequenceEngine(), moves(), erased() {clear();LoadFile(filename);setPlayTime(1);}
 	//!destructor
 	virtual ~DynamicMotionSequence() {}
 
@@ -30,8 +31,11 @@
 	}*/
 	
 
+	virtual int isDirty() { return isPlaying(); }
+	virtual int isAlive() { return (playspeed>0) ? (playtime<=endtime) : (playtime>0); }
+	
 	virtual int updateOutputs() {
-		MotionSequence::updateOutputs();
+		MotionSequenceEngine::updateOutputs();
 		if(!isPlaying()) {
 			for(unsigned int i=0; i<NumOutputs; i++) //just copies getOutputCmd(i) across frames
 				motman->setOutput(this,i,getOutputCmd(i));
@@ -112,10 +116,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
- * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
+ * $State: Exp $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Motion/EmergencyStopMC.cc ./Motion/EmergencyStopMC.cc
--- ../Tekkotsu_2.2.1/Motion/EmergencyStopMC.cc	Mon Aug 30 16:26:45 2004
+++ ./Motion/EmergencyStopMC.cc	Mon Aug 30 16:26:45 2004
@@ -209,7 +209,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Motion/EmergencyStopMC.h ./Motion/EmergencyStopMC.h
--- ../Tekkotsu_2.2.1/Motion/EmergencyStopMC.h	Mon Aug 30 16:26:45 2004
+++ ./Motion/EmergencyStopMC.h	Mon Aug 30 16:26:45 2004
@@ -62,7 +62,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Motion/Geometry.h ./Motion/Geometry.h
--- ../Tekkotsu_2.2.1/Motion/Geometry.h	Thu Sep 25 11:27:22 2003
+++ ./Motion/Geometry.h	Thu Sep 25 11:27:22 2003
@@ -51,7 +51,7 @@
  * @verbinclude CMPack_license.txt
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Motion/HeadPointerMC.cc ./Motion/HeadPointerMC.cc
--- ../Tekkotsu_2.2.1/Motion/HeadPointerMC.cc	Thu Oct 14 17:59:23 2004
+++ ./Motion/HeadPointerMC.cc	Wed Dec 22 19:59:03 2004
@@ -4,6 +4,7 @@
 #include "MotionManager.h"
 #include <math.h>
 #include "Shared/Config.h"
+#include "Wireless/Socket.h"
 
 HeadPointerMC::HeadPointerMC()
 	: MotionCommand(), dirty(true), targetReached(false),
@@ -40,6 +41,22 @@
 	Plink=0; Plink(3)=1;
 	bool conv=false;
 	NEWMAT::ColumnVector q=headkin.inv_kin_pos(Pobj,0,headkin.get_dof(),Plink,conv);
+
+	NEWMAT::ColumnVector poE=headkin.convertLink(0,headkin.get_dof())*Pobj;
+	poE=poE.SubMatrix(1,3,1,1);
+	NEWMAT::ColumnVector plE=Plink.SubMatrix(1,3,1,1);
+	float plE2=plE.SumSquare();
+	float plE_len=sqrt(plE2);
+	float obj_comp_link=NEWMAT::DotProduct(plE,poE)/plE_len;
+	if(obj_comp_link<plE_len)
+		obj_comp_link=obj_comp_link*.975; //.975 is a bit of fudge - accounts for joints moving Plink when adjusting
+	else
+		obj_comp_link=obj_comp_link/.975; //.975 is a bit of fudge - accounts for joints moving Plink when adjusting
+	NEWMAT::ColumnVector obj_proj_link(4);
+	obj_proj_link.SubMatrix(1,3,1,1)=obj_comp_link*plE/plE_len;
+	obj_proj_link(4)=1;
+	q=headkin.inv_kin_pos(Pobj,0,headkin.get_dof(),obj_proj_link,conv);
+
 	for(unsigned int i=0; i<NumHeadJoints; i++)
 		setJointValue(i,headkin.get_q(2+i));
 	return conv;
@@ -108,15 +125,32 @@
 	targetReached=false;
 }
 
+bool HeadPointerMC::ensureValidJoint(unsigned int& i) {
+	if(i<NumHeadJoints)
+		return true;
+	if(i>=HeadOffset && i<HeadOffset+NumHeadJoints) {
+		i-=HeadOffset;
+		serr->printf("WARNING: HeadPointerMC received a joint index of %d (HeadOffset+%d).\n",i+HeadOffset,i);
+		serr->printf("         Since all parameters are assumed to be relative to HeadOffset,\n");
+		serr->printf("         you should just pass %d directly.\n",i);
+		serr->printf("WARNING: Assuming you meant %d...\n",i);
+		return true;
+	}
+	serr->printf("ERROR: HeadPointerMC received a joint index of %d (HeadOffset%+d).\n",i,i-HeadOffset);
+	serr->printf("ERROR: This does not appear to be a head joint.  HeadPointerMC only controls\n");
+	serr->printf("       head joints, and assumes its arguments are relative to HeadOffset\n",i);
+	return false;
+}
+
 /*! @file
  * @brief Implements HeadPointerMC, a class for various ways to control where the head is looking
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 
diff -urdN ../Tekkotsu_2.2.1/Motion/HeadPointerMC.h ./Motion/HeadPointerMC.h
--- ../Tekkotsu_2.2.1/Motion/HeadPointerMC.h	Thu Oct 14 19:02:53 2004
+++ ./Motion/HeadPointerMC.h	Wed Dec 22 19:59:03 2004
@@ -50,27 +50,42 @@
 	//! Directly set a single neck joint value
 	/*! @param i joint offset relative to HeadOffset (i.e. one of TPROffset_t)
 	 *  @param value the value to be assigned to join @a i, in radians */
-	void setJointValue(unsigned int i, float value) { headTargets[i]=clipAngularRange(HeadOffset+i,value); 	markDirty(); }
+	void setJointValue(unsigned int i, float value) {
+		if(!ensureValidJoint(i))
+			return;
+		headTargets[i]=clipAngularRange(HeadOffset+i,value);
+		markDirty();
+	}
 	
 	//! Returns the target value of joint @a i.  Use this if you want to know the current @b commanded joint value; To get the current joint @b position, look in WorldState::outputs
 	/*! @param i joint offset relative to HeadOffset (i.e. one of TPROffset_t) */
-	float getJointValue(unsigned int i) const { return headTargets[i]; }
+	float getJointValue(unsigned int i) const {
+		if(ensureValidJoint(i))
+			return headTargets[i];
+		else
+			return 0;
+	}
 	
 	//! Centers the camera on a point in space, attempting to keep the camera as far away from the point as possible
-	/*! @param x location in millimeters
+	/*! Point should be relative to the body reference frame (see ::BaseFrameOffset)
+	 *  @param x location in millimeters
 	 *  @param y location in millimeters
-	 *  @param z location in millimeters */
+	 *  @param z location in millimeters
+	 *
+	 *  @todo this method is an approximation, could be more precise, and perhaps faster, although this is pretty good. */
 	bool lookAtPoint(float x, float y, float z);
 	
 	//! Centers the camera on a point in space, attempting to move the camera @a d millimeters away from the point
-	/*! @param x location in millimeters
+	/*! Point should be relative to the body reference frame (see ::BaseFrameOffset)
+	 *  @param x location in millimeters
 	 *  @param y location in millimeters
 	 *  @param z location in millimeters
 	 *  @param d target distance from point in millimeters */
 	bool lookAtPoint(float x, float y, float z, float d);
 	
 	//! Points the camera in a given direction
-	/*! @param x component of the direction vector
+	/*! Vector should be relative to the body reference frame (see ::BaseFrameOffset)
+	 *  @param x component of the direction vector
 	 *  @param y component of the direction vector
 	 *  @param z component of the direction vector */
 	bool lookInDirection(float x, float y, float z);
@@ -108,6 +123,12 @@
 	 *  the head isn't where it's supposed to be, it won't jerk around */
 	void markDirty();
 
+	//! Makes sure @a i is in the range (0,NumHeadJoints).  If it is instead in the range (HeadOffset,HeadOffset+NumHeadJoints), output a warning and reset @a i to the obviously intended value.
+	/*! @param[in] i joint offset relative to either HeadOffset (i.e. one of TPROffset_t) or 0
+	 *  @param[out] i joint offset relative to HeadOffset (i.e. one of TPROffset_t)
+	 *  @return true if the intended joint could be ascertained, false otherwise */
+	static bool ensureValidJoint(unsigned int& i);
+
 	bool dirty;                          //!< true if a change has been made since last call to updateJointCmds()
 	bool targetReached;                  //!< false if the head is still moving towards its target
   float headTargets[NumHeadJoints];    //!< stores the target value of each joint
@@ -121,10 +142,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Motion/Kinematics.cc ./Motion/Kinematics.cc
--- ../Tekkotsu_2.2.1/Motion/Kinematics.cc	Thu Oct 28 19:06:10 2004
+++ ./Motion/Kinematics.cc	Tue Dec 21 18:51:18 2004
@@ -54,8 +54,10 @@
 				tkout+=NumOutputs;
 				if((unsigned int)tkout>=NumReferenceFrames)
 					serr->printf("WARNING Kinematics::init(): invalid tekkotsu_frame %d on chain %d (%s), link %d (%s)\n",tkout,i,section.c_str(),l,link.c_str());
-				else
+				else {
 					jointMaps[tkout]=JointMap(i,l);
+					chainMaps[i][l]=tkout;
+				}
 			}
 		}
 	}
@@ -97,7 +99,7 @@
 }
 
 NEWMAT::ReturnMatrix
-Kinematics::frameToBase(unsigned int j) {
+Kinematics::jointToBase(unsigned int j) {
 	unsigned int c=-1U,l=-1U;
 	if(!lookup(j,c,l)) {
 		NEWMAT::Matrix A(4,4);
@@ -121,7 +123,7 @@
 }
 
 NEWMAT::ReturnMatrix
-Kinematics::baseToFrame(unsigned int j) {
+Kinematics::baseToJoint(unsigned int j) {
 	unsigned int c=-1U,l=-1U;
 	if(!lookup(j,c,l)) {
 		NEWMAT::Matrix A(4,4);
@@ -145,7 +147,7 @@
 }
 
 NEWMAT::ReturnMatrix
-Kinematics::frameToFrame(unsigned int ij, unsigned int oj) {
+Kinematics::jointToJoint(unsigned int ij, unsigned int oj) {
 	unsigned int ci=-1U,li=-1U,co=-1U,lo=-1U;
 	if(ij==oj || !lookup(ij,ci,li) || !lookup(oj,co,lo)) {
 		NEWMAT::Matrix A(4,4);
@@ -170,9 +172,9 @@
 }
 
 NEWMAT::ReturnMatrix
-Kinematics::frameToLink(unsigned int ij, unsigned int oj) {
+Kinematics::jointToLink(unsigned int ij, unsigned int oj) {
 	unsigned int ci=-1U,li=-1U,co=-1U,lo=-1U;
-	if(ij==oj || !lookup(ij,ci,li) || !lookup(oj,co,lo)) {
+	if(!lookup(ij,ci,li) || !lookup(oj,co,lo)) {
 		NEWMAT::Matrix A(4,4);
 		A<<ROBOOP::fourbyfourident;
 		A.Release(); return A;
@@ -195,9 +197,9 @@
 }
 
 NEWMAT::ReturnMatrix
-Kinematics::linkToFrame(unsigned int ij, unsigned int oj) {
+Kinematics::linkToJoint(unsigned int ij, unsigned int oj) {
 	unsigned int ci=-1U,li=-1U,co=-1U,lo=-1U;
-	if(ij==oj || !lookup(ij,ci,li) || !lookup(oj,co,lo)) {
+	if(!lookup(ij,ci,li) || !lookup(oj,co,lo)) {
 		NEWMAT::Matrix A(4,4);
 		A<<ROBOOP::fourbyfourident;
 		A.Release(); return A;
@@ -267,11 +269,11 @@
 }
 
 NEWMAT::ReturnMatrix
-Kinematics::getFrameInterestPoint(unsigned int frame, const std::string& name) {
+Kinematics::getJointInterestPoint(unsigned int joint, const std::string& name) {
 	NEWMAT::ColumnVector ans(4);
 	ans=0;
 	unsigned int co=-1U,lo=-1U;
-	if(!lookup(frame,co,lo)) {
+	if(!lookup(joint,co,lo)) {
 		ans.Release(); return ans;
 	}
 	for(unsigned int pos=0,len=0; pos<name.size(); pos+=len+1) {
@@ -308,7 +310,7 @@
 Kinematics::findUnusedLeg(const NEWMAT::ColumnVector& down) {
 	float height[NumLegs]; //not actually the real height, but proportional to it, which is all we need
 	for(unsigned int i=0; i<NumLegs; i++) {
-		height[i]=NEWMAT::DotProduct(frameToBase(PawFrameOffset+i).SubMatrix(1,3,4,4),down.SubMatrix(1,3,1,1));
+		height[i]=NEWMAT::DotProduct(jointToBase(PawFrameOffset+i).SubMatrix(1,3,4,4),down.SubMatrix(1,3,1,1));
 		//cout << "height["<<i<<"]=="<<height[i]<<endl;
 	}
 	
@@ -334,9 +336,9 @@
 	//Fit a plane to the remaining 3 feet
 	NEWMAT::Matrix legs(3,3);
 	for(unsigned int i=0; i<highleg; i++)
-		legs.Column(i+1)=frameToBase(PawFrameOffset+i).SubMatrix(1,3,4,4);
+		legs.Column(i+1)=jointToBase(PawFrameOffset+i).SubMatrix(1,3,4,4);
 	for(unsigned int i=highleg+1; i<NumLegs; i++)
-		legs.Column(i)=frameToBase(PawFrameOffset+i).SubMatrix(1,3,4,4);
+		legs.Column(i)=jointToBase(PawFrameOffset+i).SubMatrix(1,3,4,4);
 	//cout << legs;
 	NEWMAT::ColumnVector ones(3); ones=1;
 	NEWMAT::ColumnVector p(4);
@@ -376,7 +378,7 @@
 	 *  Of course, if @f$p_{xyz} \cdot r@f$ is 0, then r and p are parallel
 	 *  (since @a p_j is the normal of the plane, so a line perpendicular to
 	 *  the normal is parallel to the plane), so we set the resulting
-	 *  homogenous coordinates accordingly to represent an interesection at
+	 *  homogeneous coordinates accordingly to represent an interesection at
 	 *  infinity. */
 
 	float denom=0;
@@ -410,10 +412,10 @@
  * @brief 
  * @author ejt (Creator)
  *
- * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Author: ejt $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
diff -urdN ../Tekkotsu_2.2.1/Motion/Kinematics.h ./Motion/Kinematics.h
--- ../Tekkotsu_2.2.1/Motion/Kinematics.h	Tue Oct 19 13:06:31 2004
+++ ./Motion/Kinematics.h	Wed Dec 22 20:47:07 2004
@@ -29,49 +29,50 @@
  *  in ::state.
  *
  *  To perform kinematics on a hypothetical set of joint values,
- *  please see PostureEngine or its subclasses.  PostureEngine also
- *  includes inverse kinematic functions, which will allow you to
+ *  use PostureEngine or one of its subclasses.  PostureEngine also
+ *  adds inverse kinematic functions, which will allow you to
  *  determine joint angles in order to reach a given point.
  *  
  *  The underlying ROBOOP library does not currently handle branching
  *  kinematic chains - in other words, each limb of the robot is a
- *  separate Robot as far as ROBOOP is concerned.  This class
- *  interfaces the Tekkotsu array index approach to referencing joints
- *  with ROBOOP's chain based hierarchy.
+ *  separate ROBOOP::Robot as far as ROBOOP is concerned.  This
+ *  Kinematics class interfaces the Tekkotsu array index approach to
+ *  referencing joints with ROBOOP's chain based hierarchy.
  *  
- *  Thus, wherever a link or reference frame index is requested, you
- *  can simply supply one of the output indexes in the usual manner:
- *  @code kine->frameToBase(HeadOffset+TiltOffset); @endcode
+ *  Thus, wherever a reference frame index is requested, you can
+ *  simply supply one of the output indexes in the usual manner:
+ *  @code kine->jointToBase(HeadOffset+TiltOffset); @endcode
  *
  *  However, there are also a number of points on the body which are
  *  not joints, but should have their own reference frames, such as
  *  the base frame, or the camera.  These frames have their own
  *  indices, listed in the robot info file for the model in question
  *  (such as ERS7Info.h), with names ending in @c FrameOffset.
- *  @code kine->frameToBase(CameraFrameOffset); @endcode
+ *  @code kine->jointToBase(CameraFrameOffset); @endcode
+ *  Note that for these non-joint-associated reference frames, the
+ *  link and joint frames are always identical, so you can use either
+ *  version of the corresponding functions.
  *
  *  Since newmat matrix library is used by ROBOOP, you will need to
- *  pass and receive information in newmat matrices.  This class
- *  provides #pack and #unpack functions which can convert individual
- *  x,y,z variables into a NEWMAT::ColumnVector, and vice versa.
- *  However, for readability of your code and long-term ease of use,
- *  we recommend embracing the newmat data structures directly when
- *  appropriate.
+ *  pass and receive information in newmat matrices.  Kinematics class
+ *  provides static #pack and #unpack functions which can convert
+ *  individual x,y,z variables into a NEWMAT::ColumnVector, and vice
+ *  versa.  However, for readability of your code and long-term ease
+ *  of use, we recommend embracing the newmat data structures directly
+ *  when appropriate.
  *  @code
  *  // Find the ray from the camera to whatever the near-field IR is hitting:
- *  // x and y will be in the range -1 to 1 for resolution layer independence
- *  // This ignores lens distortion - just proof of concept
- *  NEWMAT::Matrix T = kine->frameToFrame(NearIRFrameOffset,CameraFrameOffset);
+ *  NEWMAT::Matrix T = kine->jointToJoint(NearIRFrameOffset,CameraFrameOffset);
  *  NEWMAT::ColumnVector camera_ray = T*Kinematics::pack(0,0,state->sensors[NearIRDistOffset]);
- *  float x=atan(camera_ray(1),camera_ray(3))/config->vision.horizFOV/2;
- *  float y=atan(camera_ray(2),camera_ray(3))/config->vision.vertFOV/2;
+ *  float x,y; // x and y will be in the range -1 to 1 for resolution layer independence
+ *  config->vision.computePixel(x,y,camera_ray(1),camera_ray(2),camera_ray(3));
  *  @endcode
  *  
- *  Finally, for each model we have created a database of "interest points",
+ *  Finally, for each model we have created a database of "interest points" --
  *  locations of notable interest on the body of the robot.  These may be of
  *  use to people attempting to use the limbs to manipulate objects.
- *  To access these interest points, simply call either #getLinkInterestPoint
- *  or #getFrameInterestPoint with the name of the interest point, obtained
+ *  To access these interest points, call either #getLinkInterestPoint
+ *  or #getJointInterestPoint with the name of the interest point, obtained
  *  from the <a href="http://www.tekkotsu.org/Kinematics.html">diagrams</a>.
  *
  *  Note that you can pass a comma separated list of interest point names
@@ -79,6 +80,37 @@
  *  @code kine->getLinkInterestPoint(BaseFrameOffset,"LowerInnerFrontLFrShin,LowerOuterFrontLFrShin"); @endcode
  *  
  *  @see PostureEngine for inverse kinematics
+ *
+ *
+ *
+ *  <a name="config_file_format"></a><h2>Configuration File Format</h2>
+ *
+ *  The file is actually read by ROBOOP::Config, and thus the syntax
+ *  of the file is defined by that class.  However, Tekkotsu will look
+ *  for some additional sections beyond what is expected by ROBOOP.
+ *
+ *  In any give link section, a <tt>tekkotsu_output</tt> field may
+ *  appear, which specifies the index (aka offset) of the
+ *  corresponding joint in Tekkotsu, as defined by the model's Info.h
+ *  file (e.g. ERS7Info.h).  Alternatively, <tt>tekkotsu_frame</tt>
+ *  may be specified, which should specify the offset of an abstract
+ *  reference frame, which does not correspond to any joint.
+ *  Typically this is used for things such as the camera, or
+ *  un-actuated joints, such as the spring-loaded ankles.
+ *
+ *  Additionally, Kinematics will look for an custom
+ *  <tt>InterestPoints</tt> section, which should contain a
+ *  <tt>Length</tt> field for specifying the number of interest
+ *  points.  Kinematics will then attempt to read
+ *  <tt>%InterestPoint</tt><i>N</i> for 1 through <i>Length</i>.
+ * 
+ *  Each <tt>%InterestPoint</tt><i>N</i> section should contain:
+ *  - <tt>name</tt> - (string) name which will be passed to get*InterestPoint() to retrieve this IP
+ *  - <tt>chain</tt> - (string) name of the chain the IP is in, must match one of the kinematic chains loaded from the file
+ *  - <tt>link</tt> - (unsigned int) the index of the link the IP is connected to
+ *  - <tt>x</tt> - (float) the x location of the point, in link-relative coordinates
+ *  - <tt>y</tt> - (float) the y location of the point, in link-relative coordinates
+ *  - <tt>z</tt> - (float) the z location of the point, in link-relative coordinates
  */
 class Kinematics {
 public:
@@ -92,66 +124,66 @@
 
 
 
-	//! Returns a matrix for transforming from link @a j to base frame
-	/*! @param[in]  j the link number, see class notes for values */
-	NEWMAT::ReturnMatrix linkToBase(unsigned int j);
+	//! Returns a matrix for transforming from link frame @a j to base frame
+	/*! @param[in]  link the output offset, see class notes for values */
+	NEWMAT::ReturnMatrix linkToBase(unsigned int link);
 
-	//! Returns a matrix for transforming from frame @a j to base frame
-	/*! @param[in]  j the frame number, see class notes for values */
-	NEWMAT::ReturnMatrix frameToBase(unsigned int j);
+	//! Returns a matrix for transforming from joint frame @a j to base frame
+	/*! @param[in]  joint the output offset, see class notes for values */
+	NEWMAT::ReturnMatrix jointToBase(unsigned int joint);
 
-	//! Returns a matrix for transforming from the base frame to link @a j
-	/*! @param[in]  j the link number, see class notes for values */
-	NEWMAT::ReturnMatrix baseToLink(unsigned int j);
+	//! Returns a matrix for transforming from the base frame to link @a j frame
+	/*! @param[in]  link the output offset, see class notes for values */
+	NEWMAT::ReturnMatrix baseToLink(unsigned int link);
 
-	//! Returns a matrix for transforming from the base frame to frame @a j
-	/*! @param[in]  j the frame number, see class notes for values */
-	NEWMAT::ReturnMatrix baseToFrame(unsigned int j);
+	//! Returns a matrix for transforming from the base frame to joint @a j frame
+	/*! @param[in]  joint the output offset, see class notes for values */
+	NEWMAT::ReturnMatrix baseToJoint(unsigned int joint);
 
-	//! Returns a matrix for transforming from link @a ij to link @a oj frame
-	/*! @param[in]  ij the link number to convert from, see class notes for values
-	 *  @param[in]  oj the link number to convert to, see class notes for values */
-	NEWMAT::ReturnMatrix linkToLink(unsigned int ij, unsigned int oj);
+	//! Returns a matrix for transforming from link @a ij to link @a oj
+	/*! @param[in]  iL the output offset to convert from, see class notes for values
+	 *  @param[in]  oL the output offset to convert to, see class notes for values */
+	NEWMAT::ReturnMatrix linkToLink(unsigned int iL, unsigned int oL);
 
-	//! Returns a matrix for transforming from link @a ij to frame @a oj
-	/*! @param[in]  ij the link number to convert from, see class notes for values
-	 *  @param[in]  oj the frame number to convert to, see class notes for values */
-	NEWMAT::ReturnMatrix linkToFrame(unsigned int ij, unsigned int oj);
+	//! Returns a matrix for transforming from link frame @a ij to joint frame @a oj
+	/*! @param[in]  iL the output offset to convert from, see class notes for values
+	 *  @param[in]  oJ the output offset to convert to, see class notes for values */
+	NEWMAT::ReturnMatrix linkToJoint(unsigned int iL, unsigned int oJ);
 
-	//! Returns a matrix for transforming from frame @a ij to link @a oj
-	/*! @param[in]  ij the frame number to convert from, see class notes for values
-	 *  @param[in]  oj the link number to convert to, see class notes for values */
-	NEWMAT::ReturnMatrix frameToLink(unsigned int ij, unsigned int oj);
+	//! Returns a matrix for transforming from joint frame @a ij to link frame @a oj
+	/*! @param[in]  iJ the output offset to convert from, see class notes for values
+	 *  @param[in]  oL the output offset to convert to, see class notes for values */
+	NEWMAT::ReturnMatrix jointToLink(unsigned int iJ, unsigned int oL);
 
-	//! Returns a matrix for transforming from frame @a ij to frame @a oj frame
-	/*! @param[in]  ij the frame number to convert from, see class notes for values
-	 *  @param[in]  oj the frame number to convert to, see class notes for values */
-	NEWMAT::ReturnMatrix frameToFrame(unsigned int ij, unsigned int oj);
+	//! Returns a matrix for transforming from joint @a ij to joint @a oj
+	/*! @param[in]  iJ the output offset to convert from, see class notes for values
+	 *  @param[in]  oJ the output offset to convert to, see class notes for values */
+	NEWMAT::ReturnMatrix jointToJoint(unsigned int iJ, unsigned int oJ);
 
 
 
 	//! Returns the location of a named point and the link it is attached to
 	/*! @param[in]  name   the name of the interest point; varies by model, <a href="http://www.tekkotsu.org/Kinematics.html">see the diagrams</a> for your model.
-	 *  @param[out] j      on exit, joint index of the link, or -1U if not found
-	 *  @param[out] ip     on exit, a homogenous column vector of the requested point
+	 *  @param[out] link   on exit, offset of the link, or -1U if not found
+	 *  @param[out] ip     on exit, a homogeneous column vector of the requested point, relative to the link frame returned in @a j
 	 *
 	 *  If @a name is not found, j will be -1 and ip will be all 0's. */
-	void getInterestPoint(const std::string& name, unsigned int& j, NEWMAT::Matrix& ip);
+	void getInterestPoint(const std::string& name, unsigned int& link, NEWMAT::Matrix& ip);
 
-	//! Returns the location of a named point, relative to any desired reference frame
-	/*! @param[in]  frame  the desired reference frame to give results in
+	//! Returns the location of a named point, relative to any desired joint reference frame
+	/*! @param[in]  joint  the desired joint reference frame to give results in
 	 *  @param[in]  name   the name of the interest point; varies by model, <a href="http://www.tekkotsu.org/Kinematics.html">see the diagrams</a> for your model.
 	 *
 	 *  You can pass a comma separated list of interest point names and the result will be the midpoint of those IPs */
-	NEWMAT::ReturnMatrix getFrameInterestPoint(unsigned int frame, const std::string& name);
+	NEWMAT::ReturnMatrix getJointInterestPoint(unsigned int joint, const std::string& name);
 
 	//! Returns the location of a named point, relative to any desired reference frame
-	/*! @param[in]  link   the desired link frame to give results in
+	/*! @param[in]  link   the desired link reference frame to give results in
 	 *  @param[in]  name   the name of the interest point; varies by model, <a href="http://www.tekkotsu.org/Kinematics.html">see the diagrams</a> for your model.
 	 *
 	 *  You can pass a comma separated list of interest point names and the result will be the midpoint of those IPs */
 	NEWMAT::ReturnMatrix getLinkInterestPoint(unsigned int link, const std::string& name) {
-		NEWMAT::ColumnVector p=frameToLink(link,link)*getFrameInterestPoint(link,name);
+		NEWMAT::ColumnVector p=jointToLink(link,link)*getJointInterestPoint(link,name);
 		p.Release(); return p;
 	}
 
@@ -176,13 +208,13 @@
 
 	//! Find the point of intersection between a ray and a plane
 	/*! @param j is the link number the ray is relative to
-	 *  @param r_j is the line through the origin, in homogenous coordinates
+	 *  @param r_j is the line through the origin, in homogeneous coordinates
 	 *  @param b is the link number the plane is relative to (probably BaseFrameOffset)
 	 *  @param p_b represents the plane to be intersected
 	 *  @param f is the link number the results should be relative to
 	 *
 	 *  @a p_b should be of the form @f$p_1x + p_2y + p_3z = p_4@f$
-	 *  @return homogenous coordinate of intersection (may be infinity) */
+	 *  @return homogeneous coordinate of intersection (may be infinity) */
 	NEWMAT::ReturnMatrix projectToPlane(unsigned int j, const NEWMAT::ColumnVector& r_j,
 	                                    unsigned int b, const NEWMAT::ColumnVector& p_b,
 	                                    unsigned int f);
@@ -217,6 +249,7 @@
 		ox=m(1,1); oy=m(2,1); oz=m(3,1); oh=m(4,1);
 	}
 	
+	//! returns the global ROBOOP::Config object which Kinematics classes initialize themselves from (#roconfig)
 	static ROBOOP::Config * getConfig() { return roconfig; }
 	
 protected:
@@ -227,7 +260,7 @@
 	/*! @param[in]  name   the name of the interest point; varies by model, <a href="http://www.tekkotsu.org/Kinematics.html">see the diagrams</a> for your model.
 	 *  @param[out] c      on exit, chain index the IP is on
 	 *  @param[out] l      on exit, link index the IP is on
-	 *  @param[out] ip     on exit, a homogenous column vector of the requested point
+	 *  @param[out] ip     on exit, a homogeneous column vector of the requested point
 	 *
 	 *  If @a name is not found, @a c and @a l will be -1 and @a ip will be all 0's. 
 	 *  This internal version of the function allows us to use @a c and @a l, ourselves,
@@ -263,14 +296,14 @@
 	//! A separate ROBOOP::Robot instantiation for each chain since ROBOOP package doesn't support branching chains (which would be rather difficult to implement well)
 	std::vector<ROBOOP::Robot*> chains;
 
-	//! holds mapping for each chain's links back to the tekkotsu outputs they represent
+	//! holds mapping for each chain's links back to the tekkotsu outputs and reference frames they represent
 	std::vector< std::vector<unsigned int> > chainMaps;
 	
 	//! Allows mapping from tekkotsu output index to chain and link indicies
 	struct JointMap {
 		JointMap() : chain(-1U), link(-1U) {} //!< constructor
 		JointMap(unsigned int c, unsigned int l) : chain(c), link(l) {} //!< constructor
-		unsigned int chain; //! the chain index
+		unsigned int chain; //!< the chain index
 		unsigned int link; //!< the link index
 	};
 	//! holds the position and attached link of a given interest point
@@ -317,10 +350,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Motion/LedEngine.cc ./Motion/LedEngine.cc
--- ../Tekkotsu_2.2.1/Motion/LedEngine.cc	Sun Sep 12 00:22:37 2004
+++ ./Motion/LedEngine.cc	Sun Sep 12 00:22:37 2004
@@ -392,7 +392,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Motion/LedEngine.h ./Motion/LedEngine.h
--- ../Tekkotsu_2.2.1/Motion/LedEngine.h	Mon Nov 15 19:29:47 2004
+++ ./Motion/LedEngine.h	Mon Nov 15 19:29:47 2004
@@ -177,7 +177,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Motion/LedMC.h ./Motion/LedMC.h
--- ../Tekkotsu_2.2.1/Motion/LedMC.h	Fri Sep 10 18:25:15 2004
+++ ./Motion/LedMC.h	Fri Dec 17 00:52:36 2004
@@ -20,12 +20,17 @@
   //! destructor
   virtual ~LedMC() {}
   
+	virtual void DoStart() {
+		MotionCommand::DoStart();
+		dirty=true;
+	}
+
   //! updates the cmds from LedEngine::updateLEDs()
   virtual int updateOutputs() {
     updateLEDFrames(cmds);
     for(unsigned int i=0; i<NumLEDs; i++)
       if(cmds[i][0].weight!=0)
-	motman->setOutput(this,i+LEDOffset,cmds[i]);
+				motman->setOutput(this,i+LEDOffset,cmds[i]);
     if (nextFlashEnd < (unsigned int)-1)  // do we have a flash in progress?
       notified=false;
     else if (notified == false) {  // flash has ended (nextFlashEnd == -1), but notice not yet sent
@@ -56,11 +61,11 @@
  * @brief Defines LedMC, which provides a basic MotionCommand wrapper to LedEngine
  * @author ejt (Creator)
  *
- * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Author: ejt $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Motion/MMAccessor.h ./Motion/MMAccessor.h
--- ../Tekkotsu_2.2.1/Motion/MMAccessor.h	Wed Feb 18 16:13:02 2004
+++ ./Motion/MMAccessor.h	Wed Feb 18 16:13:02 2004
@@ -153,7 +153,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Motion/MotionCommand.cc ./Motion/MotionCommand.cc
--- ../Tekkotsu_2.2.1/Motion/MotionCommand.cc	Thu Sep 25 11:27:23 2003
+++ ./Motion/MotionCommand.cc	Thu Sep 25 11:27:23 2003
@@ -7,7 +7,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Motion/MotionCommand.h ./Motion/MotionCommand.h
--- ../Tekkotsu_2.2.1/Motion/MotionCommand.h	Mon Feb  9 17:45:28 2004
+++ ./Motion/MotionCommand.h	Mon Feb  9 17:45:28 2004
@@ -186,7 +186,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Motion/MotionManager.cc ./Motion/MotionManager.cc
--- ../Tekkotsu_2.2.1/Motion/MotionManager.cc	Sat Oct 16 21:16:11 2004
+++ ./Motion/MotionManager.cc	Fri Dec  3 19:11:34 2004
@@ -542,6 +542,7 @@
 	//cout << "addMotion()NOW: sm.getRegion()->NumberOfReference()==" << sm.getRegion()->NumberOfReference() << endl;
 	cmdlist[mc_id].lastAccessor=_MMaccID;
 	cmdlist[mc_id].priority=priority;
+	//cout << "setAdd(" << mc_id << ")" << endl;
 	mc->setAdd(mc_id);
 	OStatus err;
 	/*{
@@ -551,10 +552,14 @@
 		}
 		ASSERT((int)i==subjs[_MMaccID]->NumberOfObservers(),"did I miss an observer?");
 	}*/
-	ASSERT((err=subjs[_MMaccID]->SetData(sm.getRegion()))==oSUCCESS,"*** ERROR MotionManager: SetData returned " << err);
+	//cout << "Sent at " << get_time() << flush;
+	err=subjs[_MMaccID]->SetData(sm.getRegion());
+	ASSERT(err==oSUCCESS,"*** ERROR MotionManager: SetData returned " << err);
 	//cout << "addMotion()afterSetData: sm.getRegion()->NumberOfReference()==" << sm.getRegion()->NumberOfReference() << endl;
-	ASSERT((err=subjs[_MMaccID]->NotifyObservers())==oSUCCESS,"*** ERROR MotionManager: NotifyObservers returned " << err);
+	err=subjs[_MMaccID]->NotifyObservers();
+	ASSERT(err==oSUCCESS,"*** ERROR MotionManager: NotifyObservers returned " << err);
 	//	cout << "addMotion-done" << endl;
+	//cout << " - " << get_time() << endl;
 	return func_end(mc_id);
 }
 
@@ -563,6 +568,7 @@
 	//	cout << "receivedMsg..." << flush;
 	func_begin();
 	//	cout << id << "..." << flush;
+	//cout << "Received at " << get_time() << endl;
 	for(int x=0; x<event.NumOfData(); x++) {
 		RCRegion * rcr = event.RCData(x);
 		MotionManagerMsg * mminfo = reinterpret_cast<MotionManagerMsg*>(rcr->Base());
@@ -575,13 +581,25 @@
 			cmdlist[mc_id].rcr[_MMaccID]=rcr;
 			//should be able to do a nice dynamic cast instead of a static one
 			// but it gives NULL for some reason - i blame having to do the fork trick
+			//cout << "Adding mc_id=="<< mc_id << " (and dynamic_cast is still " << dynamic_cast<MotionCommand*>(mminfo) << ")" << endl;
 			cmdlist[mc_id].baseaddrs[_MMaccID]=static_cast<MotionCommand*>(mminfo);
-			erouter->postEvent(new EventBase(EventBase::motmanEGID,mc_id,EventBase::activateETID,0));
 			cmdlist[mc_id].baseaddrs[_MMaccID]->DoStart();
+			erouter->postEvent(new EventBase(EventBase::motmanEGID,mc_id,EventBase::activateETID,0));
 		} break;
 		case MotionManagerMsg::deleteMotion: {
 			//cout << "deleteMotion(): cmdlist[mc_id].rcr[_MMaccID]->NumberOfReference()==" << cmdlist[mc_id].rcr[_MMaccID]->NumberOfReference() << endl;
-			cmdlist[mc_id].rcr[_MMaccID]->RemoveReference();
+			//cout << "deleting mc_id=="<<mc_id << endl;
+			if(cmdlist[mc_id].rcr[_MMaccID]==NULL)
+				cout << "WARNING: MotionManager attempted to delete a NULL motion! mc_id="<<mc_id<<" _MMaccID=" << _MMaccID << endl;
+			else {
+				checkoutMotion(mc_id,true);
+				cmdlist[mc_id].baseaddrs[_MMaccID]->DoStop();
+				erouter->postEvent(new EventBase(EventBase::motmanEGID,mc_id,EventBase::deactivateETID,0));
+				cmdlist[mc_id].rcr[_MMaccID]->RemoveReference();
+				cmdlist[mc_id].rcr[_MMaccID]=NULL;
+				push_free(mc_id);
+				checkinMotion(mc_id);
+			}
 			//cout << "deleteMotion()NOW: cmdlist[mc_id].rcr[_MMaccID]->NumberOfReference()==" << cmdlist[mc_id].rcr[_MMaccID]->NumberOfReference() << endl;
 		} break;
 		default:
@@ -636,20 +654,17 @@
 	if(mcid==invalid_MC_ID)
 		return;
 	func_begin();
-	checkoutMotion(mcid,true);
-	cmdlist[mcid].baseaddrs[_MMaccID]->DoStop();
-	erouter->postEvent(new EventBase(EventBase::motmanEGID,mcid,EventBase::deactivateETID,0));
 #ifdef PLATFORM_APERIOS
 	MotionManagerMsg dmsg;
 	dmsg.setDelete(mcid);
+	//cout << "Remove at " << get_time() << flush;
 	subjs[_MMaccID]->SetData(&dmsg,sizeof(dmsg));
 	subjs[_MMaccID]->NotifyObservers();
+	//cout << " - " << get_time() << endl;
 	//cout << "removeMotion(): cmdlist[mcid].rcr[_MMaccID]->NumberOfReference()==" << cmdlist[mcid].rcr[_MMaccID]->NumberOfReference() << endl;
 	cmdlist[mcid].rcr[_MMaccID]->RemoveReference();
 	//cout << "removeMotion()NOW: cmdlist[mcid].rcr[_MMaccID]->NumberOfReference()==" << cmdlist[mcid].rcr[_MMaccID]->NumberOfReference() << endl;
 #endif //PLATFORM_APERIOS
-	push_free(mcid);
-	checkinMotion(mcid);
 	func_end();
 }
 
@@ -748,10 +763,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 
diff -urdN ../Tekkotsu_2.2.1/Motion/MotionManager.h ./Motion/MotionManager.h
--- ../Tekkotsu_2.2.1/Motion/MotionManager.h	Mon Oct 18 19:10:26 2004
+++ ./Motion/MotionManager.h	Mon Oct 18 19:10:26 2004
@@ -259,7 +259,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Motion/MotionManagerMsg.h ./Motion/MotionManagerMsg.h
--- ../Tekkotsu_2.2.1/Motion/MotionManagerMsg.h	Tue Sep  2 16:58:49 2003
+++ ./Motion/MotionManagerMsg.h	Tue Sep  2 16:58:49 2003
@@ -52,7 +52,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Motion/MotionSequenceEngine.cc ./Motion/MotionSequenceEngine.cc
--- ../Tekkotsu_2.2.1/Motion/MotionSequenceEngine.cc	Wed Dec 31 19:00:00 1969
+++ ./Motion/MotionSequenceEngine.cc	Tue Dec 21 17:22:54 2004
@@ -0,0 +1,475 @@
+#include "MotionSequenceMC.h"
+#include "Shared/get_time.h"
+#include "Shared/WorldState.h"
+#include "Shared/Config.h"
+#include <iostream>
+
+using std::cout;
+using std::endl;
+
+MotionSequenceEngine::Move_idx_t MotionSequenceEngine::invalid_move=-1U;
+
+int MotionSequenceEngine::updateOutputs() {
+	if(isPlaying()) {
+		if(lasttime==0)
+			play();
+		double diff=(get_time()-lasttime)*playspeed;
+		if(diff+playtime<0)
+			setTime(0);
+		else
+			setTime(static_cast<unsigned int>(diff+playtime));
+		lasttime=get_time();
+		return 1;
+	} else {
+		lasttime=get_time();
+		return 0;
+	}
+}
+
+const OutputCmd& MotionSequenceEngine::getOutputCmd(unsigned int i) {
+	if(curstamps[i]!=playtime) {
+		if(nexts[i]!=invalid_move)
+			calcOutput(curs[i],playtime,getKeyFrame(prevs[i]),getKeyFrame(nexts[i]));
+		else
+			curs[i].unset();
+		curstamps[i]=playtime;
+	}
+	return curs[i];
+}
+
+unsigned int MotionSequenceEngine::getBinSize() const {
+	char buf[128];
+	unsigned int len=128;
+	unsigned int used=strlen("#MSq\n");
+	used+=snprintf(buf,len,isSaveRadians()?"radians\n":"degrees\n");
+	unsigned int t=0;
+	Move_idx_t tprevs[NumOutputs];
+	Move_idx_t tnexts[NumOutputs];
+	for(unsigned int i=0;i<NumOutputs;i++)
+		tnexts[i]=getKeyFrame(tprevs[i]=starts[i]).next;
+	while(t!=-1U) {
+		for(unsigned int i=0; i<NumOutputs; i++) {
+			if((t!=0 || getKeyFrame(tprevs[i]).cmd.weight!=0) && getKeyFrame(tprevs[i]).starttime==t) {
+				if(getKeyFrame(tprevs[i]).cmd.weight==1) {
+					if(t!=0)
+						used+=snprintf(buf,len,"%s\t%g\n",outputNames[i],getKeyFrame(tprevs[i]).cmd.value/loadSaveMode);
+				} else
+					used+=snprintf(buf,len,"%s\t%g\t%g\n",outputNames[i],getKeyFrame(tprevs[i]).cmd.value/loadSaveMode,getKeyFrame(tprevs[i]).cmd.weight);
+			}
+		}
+		unsigned int last=t;
+		t=setNextFrameTime(tprevs,tnexts);
+		if(t!=-1U)
+			used+=snprintf(buf,len,"advanceTime\t%d\n",t-last);
+	}
+	used+=strlen("#END\n");
+	return used+1;
+}
+
+unsigned int MotionSequenceEngine::LoadBuffer(const char buf[], unsigned int len) {
+	unsigned int origlen=len;
+	if(strncmp("#POS",buf,4)==0) {
+		// allow inlined loading of posture files
+		PostureEngine pose;
+		unsigned int used=pose.LoadBuffer(buf,len);
+		if(used!=0)
+			setPose(pose);
+		return used;
+	}
+	if(strncmp("#MSq",buf,4)!=0) {
+		// we don't want to display an error here because we may be only testing file type,
+		// so it's up to the caller to decide if it's necessarily an error if the file isn't
+		// a motion sequence
+		//cout << "ERROR MotionSequenceEngine load corrupted - expected #MSq header" << endl;
+		return 0;
+	}
+	unsigned int linenum=1;
+	unsigned int lastOutputIdx=0;
+	while(len<=origlen && len>0) {
+		int written;
+		//printf("%d %.9s\n",linenum+1,buf);
+		if(buf[0]=='\r') {
+			buf++; len--;
+			if(buf[0]=='\n') {
+				buf++; len--;
+			}
+			linenum++;
+			continue;
+		}
+		if(buf[0]=='\n') {
+			buf++; len--;
+			linenum++;
+			continue;
+		}
+		if(buf[0]=='#') {
+			if(strncmp("#END\n",buf,5)==0 || strncmp("#END\r",buf,5)==0) {
+				return origlen-len+5;
+			} else if(strncmp("#END\r\n",buf,6)==0) {
+				return origlen-len+6;
+			} else {
+				while(len>0 && *buf!='\n' && *buf!='\r') {len--;buf++;}
+				if(*buf=='\n') { //in case of \r\n
+					buf++;
+					len--;
+				}
+				linenum++;
+				continue;
+			}
+		}
+		written=-1;
+		const unsigned int cmdlen=16, arglen=32;
+		char command[cmdlen];
+		char arg1[arglen];
+		char arg2[arglen];
+		written=readWord(buf,&buf[len],command,cmdlen);
+		if(!ChkAdvance(written,&buf,&len,"*** ERROR MotionSequenceEngine load corrupted - line %d\n",linenum)) return 0;
+		written=readWord(buf,&buf[len],arg1,arglen);
+		if(written>0)
+			if(!ChkAdvance(written,&buf,&len,"*** ERROR MotionSequenceEngine load corrupted - line %d\n",linenum)) return 0;
+		written=readWord(buf,&buf[len],arg2,arglen);
+		if(written!=0)
+			if(!ChkAdvance(written,&buf,&len,"*** ERROR MotionSequenceEngine load corrupted - line %d\n",linenum)) return 0;
+		for(;len>0 && *buf!='\n' && *buf!='\r';buf++,len--) {}
+		if(*buf=='\n') { //in case of \r\n
+			buf++;
+			len--;
+		}
+
+		if(strcasecmp(command,"delay")==0 || strcasecmp(command,"advanceTime")==0) {
+			char* used;
+			int delay = strtol(arg1,&used,0);
+			if(*used!='\0') {
+				cout << "*** WARNING illegal delay argument: " << arg1 << " - line " << linenum << endl;
+			} else {
+				setTime(playtime+delay);
+			}
+		} else if(strcasecmp(command,"settime")==0) {
+			char* used;
+			int newtime = strtol(arg1,&used,0);
+			if(*used!='\0') {
+				cout << "*** WARNING illegal settime argument: " << arg1 << " - line " << linenum << endl;
+			} else {
+				setTime(newtime);
+			}
+		} else if(strcasecmp(command,"load")==0) {
+			PostureEngine pose;
+			std::string f;
+			if(arg1[0]!='/')
+				f="/ms/data/motion/";
+			f+=arg1;
+			if(pose.LoadFile(f.c_str())!=0) {
+				setPose(pose);
+			} else
+				cout << "*** WARNING could not read file " << arg1 << " for load - line " << linenum << endl;
+		} else if(strcasecmp(command,"overlay")==0) {
+			PostureEngine pose;
+			std::string f;
+			if(arg1[0]!='/')
+				f="/ms/data/motion/";
+			f+=arg1;
+			if(pose.LoadFile(f.c_str())!=0)
+				overlayPose(pose);
+			else if(LoadFile(f.c_str())==0)
+				cout << "*** WARNING could not read file " << arg1 << " for overlay - line " << linenum << endl;
+		} else if(strcasecmp(command,"degrees")==0) {
+			setSaveDegrees();
+		} else if(strcasecmp(command,"radians")==0) {
+			setSaveRadians();
+		} else {
+			lastOutputIdx=getOutputIndex(command,lastOutputIdx+1);
+			if(lastOutputIdx==NumOutputs)
+				cout << "*** WARNING " << command << " is not a valid joint on this model." << endl;
+			else {
+				char* used;
+				double value=strtod(arg1,&used), weight=1;
+				if(*used!='\0')
+					cout << "*** WARNING illegal value argument: " << arg1 << " - line " << linenum << endl;
+				else {
+					if(arg2[0]!='\0') {
+						weight=strtod(arg2,&used);
+						if(*used!='\0') {
+							cout << "*** WARNING illegal weight argument: " << arg2 << " - line " << linenum << endl;
+							weight=1;
+						}
+					}
+					setOutputCmd(lastOutputIdx,OutputCmd(value*loadSaveMode,weight));
+				}
+			}
+		}
+
+		linenum++;
+
+	}
+	cout << "*** WARNING MotionSequenceEngine load missing #END" << endl;
+	return origlen-len;
+}
+
+unsigned int MotionSequenceEngine::SaveBuffer(char buf[], unsigned int len) const {
+	//std::cout << "SAVEBUFFER..." << std::flush;
+	unsigned int origlen=len;
+	int written=snprintf(buf,len,"#MSq\n");
+	if(!ChkAdvance(written,(const char**)&buf,&len,"*** ERROR MotionSequenceEngine save failed on header\n")) return 0;	if(len==0 || len>origlen) {
+		cout << "*** ERROR MotionSequenceEngine save overflow on header" << endl;
+		return 0;
+	}
+	written=snprintf(buf,len,isSaveRadians()?"radians\n":"degrees\n");
+	if(!ChkAdvance(written,(const char**)&buf,&len,"*** ERROR MotionSequenceEngine save failed on mode\n")) return 0;	if(len==0 || len>origlen) {
+		cout << "*** ERROR MotionSequenceEngine save overflow" << endl;
+		return 0;
+	}
+	unsigned int t=0;
+	Move_idx_t tprevs[NumOutputs];
+	Move_idx_t tnexts[NumOutputs];
+	for(unsigned int i=0;i<NumOutputs;i++)
+		tnexts[i]=getKeyFrame(tprevs[i]=starts[i]).next;
+	while(t!=-1U) {
+//		std::cout << "t="<<t<<"..."<<std::flush;
+		for(unsigned int i=0; i<NumOutputs; i++) {
+//			cout << i << ' ' << outputNames[i] << ' ' << getKeyFrame(tprevs[i]).cmd.value << ' ' << getKeyFrame(tprevs[i]).cmd.weight << ' ' << getKeyFrame(tprevs[i]).starttime << " state: " << starts[i] <<' '<< prevs[i] <<' '<< nexts[i] << " cur: " << getKeyFrame(tprevs[i]).prev << ' ' << tprevs[i] << ' ' << getKeyFrame(tprevs[i]).next << endl;
+			//first conditional is to skip 0 weighted values in first frame
+			if((t!=0 || getKeyFrame(tprevs[i]).cmd.weight!=0) && getKeyFrame(tprevs[i]).starttime==t) {
+				if(getKeyFrame(tprevs[i]).cmd.weight==1) {
+					if(t!=0) {
+						written=snprintf(buf,len,"%s\t%g\n",outputNames[i],getKeyFrame(tprevs[i]).cmd.value/loadSaveMode);
+						if(!ChkAdvance(written,(const char**)&buf,&len,"*** ERROR MotionSequenceEngine save failed\n")) return 0;
+					}
+				} else {
+					written=snprintf(buf,len,"%s\t%g\t%g\n",outputNames[i],getKeyFrame(tprevs[i]).cmd.value/loadSaveMode,getKeyFrame(tprevs[i]).cmd.weight);
+					if(!ChkAdvance(written,(const char**)&buf,&len,"*** ERROR MotionSequenceEngine save failed\n")) return 0;
+				}
+				if(len==0 || len>origlen) {
+					cout << "*** ERROR MotionSequenceEngine save overflow" << endl;
+					return 0;
+				}
+			}
+		}
+		unsigned int last=t;
+		t=setNextFrameTime(tprevs,tnexts);
+		if(t!=-1U) {
+			written=snprintf(buf,len,"delay\t%d\n",t-last);
+			if(!ChkAdvance(written,(const char**)&buf,&len,"*** ERROR MotionSequenceEngine save failed\n")) return 0;
+			if(len==0 || len>origlen) {
+				cout << "*** ERROR MotionSequenceEngine save overflow" << endl;
+				return 0;
+			}
+		}
+	}
+	written=snprintf(buf,len,"#END\n");
+	if(!ChkAdvance(written,(const char**)&buf,&len,"*** ERROR MotionSequenceEngine save failed on #END\n")) return 0;
+	if(len==0 || len>origlen) {
+		cout << "*** ERROR MotionSequenceEngine save overflow on #END" << endl;
+		return 0;
+	}
+	return origlen-len;
+	cout << "SAVE-done!" << endl;
+}
+
+unsigned int MotionSequenceEngine::LoadFile(const char filename[]) {
+	return LoadSave::LoadFile(config->motion.makePath(filename).c_str());
+}
+unsigned int MotionSequenceEngine::SaveFile(const char filename[]) const {
+	return LoadSave::SaveFile(config->motion.makePath(filename).c_str());
+}
+
+void MotionSequenceEngine::setTime(unsigned int x) {
+	playtime=x;
+	for(unsigned int i=0; i<NumOutputs; i++)
+		setRange(x,prevs[i],nexts[i]);
+}
+
+void MotionSequenceEngine::setOutputCmd(unsigned int i, const OutputCmd& cmd) {
+	Move& p_m=getKeyFrame(prevs[i]);
+	if(playtime==p_m.starttime) { //edit current keyframe
+		p_m.cmd=cmd;
+	} else { //add new keyframe
+		Move_idx_t x = newKeyFrame();
+		if(x==invalid_move) //ran out of memory - newKeyFrame should report error, we can silently die
+			return;
+		Move& cur=getKeyFrame(x);
+		Move& prev_m=getKeyFrame(prevs[i]); //it's important to refresh this - newKeyFrame may have invalidated p_m reference
+		cur.cmd=cmd;
+		cur.starttime=playtime;
+		cur.prev=prevs[i];
+		cur.next=nexts[i];
+		prev_m.next=x;
+		if(nexts[i]!=invalid_move) //in middle
+			getKeyFrame(nexts[i]).prev=x;
+		else { //at end
+			if(playtime>endtime)
+				endtime=playtime;
+		}
+		prevs[i]=x;
+//		cout << "set " << i << ' ' << outputNames[i] << ' ' << cur.cmd.value << ' ' << cur.cmd.weight << ' ' << cur.starttime << " state: " << starts[i] <<' '<< prevs[i] <<' '<< prev_m.next <<' '<< nexts[i] << " new: " << cur.prev << ' ' << x << ' ' << cur.next << endl;
+	}
+}
+
+void MotionSequenceEngine::setPose(const PostureEngine& pose) {
+	for(unsigned int i=0; i<NumOutputs; i++)
+		setOutputCmd(i,pose.getOutputCmd(i));
+}
+
+void MotionSequenceEngine::overlayPose(const PostureEngine& pose) {
+	for(unsigned int i=0; i<NumOutputs; i++)
+		if(pose.getOutputCmd(i).weight>0)
+			setOutputCmd(i,pose.getOutputCmd(i));
+}
+
+void MotionSequenceEngine::compress() {
+	for(unsigned int i=0; i<NumOutputs; i++) {
+		Move_idx_t prev=getKeyFrame(starts[i]).next;
+		if(prev==(Move_idx_t)-1)
+			break;
+		Move_idx_t cur=getKeyFrame(prev).next;
+		if(cur==(Move_idx_t)-1)
+			break;
+		Move_idx_t next=getKeyFrame(cur).next;
+		while(next!=(Move_idx_t)-1) {
+			OutputCmd tmp;
+			Move& prev_m=getKeyFrame(prev);
+			Move& cur_m=getKeyFrame(cur);
+			Move& next_m=getKeyFrame(next);
+			calcOutput(tmp,cur_m.starttime,prev_m,next_m);
+			if(tmp==cur_m.cmd || tmp.weight==0 && cur_m.cmd.weight==0) {
+				prev_m.next=next;
+				next_m.prev=prev;
+				eraseKeyFrame(cur);
+			} else
+				prev=cur;
+			cur=next;
+			next=next_m.next;
+		}
+	}
+}
+
+void MotionSequenceEngine::makeSafe(const float vels[NumOutputs], float margin) {
+	float comps[NumOutputs];
+	for(unsigned int i=0;i<NumOutputs;i++)
+		comps[i]=vels[i]*margin;
+	unsigned int t=0;
+	Move_idx_t tprevs[NumOutputs];
+	Move_idx_t tnexts[NumOutputs];
+	for(unsigned int i=0;i<NumOutputs;i++)
+		tnexts[i]=getKeyFrame(tprevs[i]=starts[i]).next;
+	while(t!=-1U) {
+		for(unsigned int i=0; i<NumOutputs; i++) {
+			//second and third conditionals are to skip transitions between 0 weighted frames
+			if(tnexts[i]!=(Move_idx_t)-1 && (getKeyFrame(tprevs[i]).cmd.weight!=0 || getKeyFrame(tnexts[i]).cmd.weight!=0) && getKeyFrame(tprevs[i]).starttime==t) {
+				float dv=fabs(getKeyFrame(tprevs[i]).cmd.value-getKeyFrame(tnexts[i]).cmd.value);
+				unsigned int dt=getKeyFrame(tnexts[i]).starttime-getKeyFrame(tprevs[i]).starttime;
+				if(dv/dt>comps[i]) {
+					unsigned int delay=(unsigned int)(dv/comps[i])-dt;
+					for(unsigned int j=0; j<NumOutputs; j++)
+						for(Move_idx_t c=tnexts[j]; c!=(Move_idx_t)-1; c=getKeyFrame(c).next)
+							getKeyFrame(c).starttime+=delay;
+				}
+			}
+		}
+		t=setNextFrameTime(tprevs,tnexts);
+	}
+	
+}	
+
+bool MotionSequenceEngine::isPlaying() {
+	return playing && ((playspeed>0) ? (playtime<=endtime) : (playtime>0)); 
+}
+
+
+void MotionSequenceEngine::play() {
+	if(playspeed>0)
+		setTime(0);
+	else
+		setTime(endtime);
+	resume();
+}
+
+void MotionSequenceEngine::resume() {
+	playing=true;
+	lasttime=get_time();
+	for(unsigned int i=0; i<NumOutputs; i++) {
+		Move_idx_t cur=starts[i];
+		while(cur!=(Move_idx_t)-1) {
+			if(getKeyFrame(cur).cmd.weight!=0) {
+				getKeyFrame(starts[i]).cmd.value=state->outputs[i];
+				break;
+			}
+			cur=getKeyFrame(cur).next;
+		}
+	}
+}
+
+unsigned int MotionSequenceEngine::setNextFrameTime(Move_idx_t p[NumOutputs], Move_idx_t n[NumOutputs]) const {
+	unsigned int ans=-1U;
+	for(unsigned int i=0; i<NumOutputs; i++)
+		if(n[i]!=invalid_move && getKeyFrame(n[i]).starttime<ans)
+			ans=getKeyFrame(n[i]).starttime;
+	if(ans!=-1U)
+		for(unsigned int i=0; i<NumOutputs; i++)
+			setRange(ans,p[i],n[i]);
+	return ans;
+}
+
+unsigned int MotionSequenceEngine::readWord(const char buf[], const char * const bufend, char wrd[], const unsigned int wordlen) {
+	const char* origbuf=buf;
+	wrd[0]='\0';
+	unsigned int i;
+	//skip whitespace
+	for(;buf<bufend && isspace(*buf) && *buf!='\n' && *buf!='\r';buf++) {}
+	//store wrd
+	for(i=0; buf<bufend && !isspace(*buf); buf++)
+		if(i<wordlen-1)
+			wrd[i++]=*buf;
+	wrd[i]='\0';
+	if(buf>=bufend)
+		return -1U;
+	return buf-origbuf;
+}
+
+unsigned int MotionSequenceEngine::getOutputIndex(const char name[], unsigned int idx) {
+	if(idx<NumOutputs) {
+		unsigned int startidx=idx;
+		for(;idx<NumOutputs;idx++)
+			if(strcmp(name,outputNames[idx])==0)
+				return idx;
+		for(idx=0;idx<startidx;idx++)
+			if(strcmp(name,outputNames[idx])==0)
+				return idx;
+		return NumOutputs;
+	} else {
+		for(idx=0;idx<NumOutputs;idx++)
+			if(strcmp(name,outputNames[idx])==0)
+				return idx;
+		return idx;
+	}
+}
+
+/*! @deprecated, call setTime(unsigned int x) instead */
+void MotionSequenceEngine::setPlayTime(unsigned int x) {
+	setTime(x);
+}
+
+/*! @deprecated, use getTime() */
+unsigned int MotionSequenceEngine::getPlayTime() const {
+	return getTime();
+}
+
+/*! @deprecated, use setSpeed(float x) */
+void MotionSequenceEngine::setPlaySpeed(float x) {
+	setSpeed(x);
+}
+
+/*! @deprecated, use getSpeed() */
+float MotionSequenceEngine::getPlaySpeed() const {
+	return getSpeed();
+}
+
+/*! @file
+ * @brief Implements MotionSequenceEngine, abstract code for smoothly transitioning between a sequence of postures
+ * @author ejt (Creator)
+ *
+ * $Author: ejt $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
+ * $State: Exp $
+ * $Date: 2004/12/23 08:41:24 $
+ */
+
diff -urdN ../Tekkotsu_2.2.1/Motion/MotionSequenceEngine.h ./Motion/MotionSequenceEngine.h
--- ../Tekkotsu_2.2.1/Motion/MotionSequenceEngine.h	Wed Dec 31 19:00:00 1969
+++ ./Motion/MotionSequenceEngine.h	Wed Dec 22 20:47:07 2004
@@ -0,0 +1,233 @@
+//-*-c++-*-
+#ifndef INCLUDED_MotionSequenceEngine_h_
+#define INCLUDED_MotionSequenceEngine_h_
+
+#include "Shared/LoadSave.h"
+#include "Shared/ListMemBuf.h"
+#include "PostureEngine.h"
+
+//! A handy little (or not so little) class for switching between a sequence of postures
+/*! Outputs are handled independently.  It's easy to add keyframes
+ *  which modify all of the outputs, but since each output is tracked
+ *  individually, OutputCmd's with 0 weight can be used to not affect
+ *  other motions.  For instance, pan the head left to right while
+ *  moving the right leg up and down several times, you won't have to
+ *  specify the position of the head in its motion at each of the leg
+ *  motion keyframes.
+ *
+ *  Be aware that the 0 time frame will be replaced on a call to
+ *  play() with the current body posture.  However, this only applies
+ *  to  outputs which have a non-zero weighted frame defined at some
+ *  point.  The weights, of the 0 time frame will remain unchanged.  
+ *  These weights are initially set to 0, so that it's
+ *  possible to 'fade in' the first frame of the motion sequence from
+ *  whereever the body happens to be (or already doing)
+ *
+ *  To fade out at the end, set a frame with 0 weight for everything.
+ *  Otherwise it will simply die suddenly.  When a joint reaches its
+ *  last keyframe, it will be set to 0 weight for all future
+ *  updateOutputs() (unless of course the playhead is reset)
+ *
+ *  Currently, MotionSequenceEngine is intended mainly for building, 
+ *  not editing.  It's easy to add keyframes, but hard/impossible to
+ *  delete them.
+ *
+ *  The MotionSequenceEngine base class is an abstract class so that you can
+ *  create memory efficient motion sequences and simply refer to them
+ *  by the common base class instead of having to worry about the
+ *  actual size allocated in the template, MotionSequenceMC.
+ *
+ *  @see MotionSequenceEngine::SizeSmall, MotionSequenceEngine::SizeMedium, MotionSequenceEngine::SizeLarge, MotionSequenceEngine::SizeXLarge, 
+ *  
+ *  The file format used is as follows: ('<' and '>' are not meant literally)
+ *  - First line: '<tt>#MSq</tt>'
+ *  - Followed by any series of:\n
+ *    - '<tt>advanceTime </tt><i>time-delta</i>' - moves playhead forward, in milliseconds (synonym for <tt>delay</tt>)
+ *    - '<tt>delay </tt><i>time-delta</i>' - moves playhead forward, in milliseconds (synonym for <tt>advanceTime</tt>)
+ *    - '<tt>setTime </tt><i>time</i>' - sets play time to specified value, in ms
+ *    - '<i>outputname</i><tt> </tt><i>value</i><tt> </tt>[<i>weight</i>]' - sets the specified output to the value - assumes 1 for weight; you can view the list of valid joint names in the outputNames array within the RobotInfo extension namespace for your model.  (e.g. ERS210Info::outputNames[])
+ *    - '<tt>load </tt><i>filename</i>' - file is a posture, sets position
+ *    - '<tt>overlay </tt><i>filename</i>' - file can be a posture or another motion sequence
+ *    - '<tt>degrees</tt>' - following <i>value</i>s will be interpreted as degrees [default]
+ *    - '<tt>radians</tt>' - following <i>value</i>s will be interpreted as radians
+ *    - '<tt>#</tt><i>comment</i>' - a comment line
+ *  - Last line: '<tt>#END</tt>'
+ *  
+ *  Lines beginning with '#' are ignored as comments.  Be aware if you
+ *  load the file and then save it again, these comments will be lost.
+ *  
+ *  After loading a motion sequence, the playtime is left at the end.
+ *  This is to make it easy to append/overlay motion sequences.
+ *  However, the playhead will be reset to the beginning on the first
+ *  call to updateOutputs() if isPlaying() returns true.
+ *
+ *  You can also create a motion sequence dynamically at run time:
+ *  \code
+ *  //This code sample will stand up, point the head forward and up 0.1 radians,
+ *  //and then autoprune
+ *
+ *  //First declare the MotionSequence itself:
+ *  SharedObject< MotionSequenceMC<MotionSequenceEngine::SizeSmall> > stand;
+ *
+ *  //Over the course of the first 700 milliseconds, go to standing posture:
+ *  standSit->setTime(700);
+ *  standSit->setPose(PostureEngine("stand.pos")); // can also use LoadFile("stand.pos")
+ *
+ *  //Then take another 700 milliseconds to straighten out the head:
+ *  standSit->advanceTime(700);
+ *  //We'll set joints individually this time, instead of loading a posture file:
+ *  standSit->setOutputCmd(HeadOffset+PanOffset,0);
+ *  standSit->setOutputCmd(HeadOffset+RollOffset,0);
+ *  standSit->setOutputCmd(HeadOffset+TiltOffset,0.1); //look up .1 radians
+ *
+ *  //Add to MotionManager:
+ *  motman->addPersistentMotion(standSit);
+ *  //Playback will now begin automatically, and region deallocated when done
+ *  \endcode
+ *  
+ *  By default, #playing is true.  Thus, when you add a MotionSequenceMC
+ *  to the MotionManager, it will begin executing automatically.  If
+ *  you do \e not want this behavior, simply call pause() before
+ *  adding the sequence.
+ *
+ *  When the sequence reaches the end, isAlive() will return false.
+ *  If the motion was added with MotionManager::addPrunableMotion, the
+ *  motion sequence will then autoprune itself from the MotionManager.
+ *  However, you can either call MotionManager::addPersistentMotion()
+ *  to add it, or call setAutoPrune(false), if you want to retain the
+ *  same instantiation between executions.
+ *  
+ *  @see PostureEngine for information on the posture files
+ */
+class MotionSequenceEngine : public LoadSave {
+public:
+	//!constructor, will start playing immediately
+	MotionSequenceEngine() : LoadSave(), playtime(1), lasttime(0), endtime(0), playspeed(1.0), playing(true), loadSaveMode(M_PI/180) {}
+	//!destructor
+	virtual ~MotionSequenceEngine() {}
+
+	//!To avoid code bloat if there are a large number of different sized MotionSequences, use these sizes where possible.
+	/*!@deprecated use MotionSequenceMC typedefs (e.g. TinyMotionSequenceMC) in conjunction with MotionSequenceMC::CAPACITY() */
+	//!@name Template Sizes (deprecated)
+	static const unsigned int SizeTiny __attribute__((deprecated))   =NumOutputs*2; //!< deprecated, use TinyMotionSequenceMC for type specification, or TinyMotionSequenceMC::CAPACITY if you need the actual value
+	static const unsigned int SizeSmall __attribute__((deprecated))  =NumOutputs*3; //!< deprecated, use SmallMotionSequenceMC for type specification, or SmallMotionSequenceMC::CAPACITY if you need the actual value
+	static const unsigned int SizeMedium __attribute__((deprecated)) =NumOutputs*6; //!< deprecated, use MediumMotionSequenceMC for type specification, or MediumMotionSequenceMC::CAPACITY if you need the actual value
+	static const unsigned int SizeLarge __attribute__((deprecated))  =NumOutputs*11; //!< deprecated, use LargeMotionSequenceMC for type specification, or LargeMotionSequenceMC::CAPACITY if you need the actual value
+	static const unsigned int SizeXLarge __attribute__((deprecated)) =NumOutputs*26; //!< deprecated, use XLargeMotionSequenceMC for type specification, or XLargeMotionSequenceMC::CAPACITY if you need the actual value
+	//@}
+
+	//! similar to the MotionCommand::updateOutputs, although this isn't a motion command, and doesn't make any calls on MotionManager - merely updates #lasttime, expects subclasses to do the work of sending new commands to the system
+	virtual int updateOutputs();
+	
+	//!@name LoadSave related
+	virtual unsigned int getBinSize() const; //!< inherited, returns the size used to save the sequence
+	virtual unsigned int LoadBuffer(const char buf[], unsigned int len); //!< inherited, doesn't clear before loading - call clear yourself if you want to reset, otherwise it will overlay.  Leaves playtime at end of load.
+	virtual unsigned int SaveBuffer(char buf[], unsigned int len) const; //!< inherited, saves the motion sequence - will save a flat file - doesn't remember references to other files which were loaded
+	virtual unsigned int LoadFile(const char filename[]); //!< inherited, doesn't clear before loading - call clear yourself if you want to reset, otherwise it will overlay.  Leaves playtime at end of load.
+	virtual unsigned int SaveFile(const char filename[]) const; //!< inherited, saves the motion sequence - will save a flat file - doesn't remember references to other files which were loaded
+	void setSaveDegrees() { loadSaveMode=M_PI/180; }       //!< will store angles as degrees on future saves
+	bool isSaveDegrees() const { return loadSaveMode!=1; } //!< returns true if will store angles as degrees on future saves
+	void setSaveRadians() { loadSaveMode=1; }              //!< will store angles as radians on future saves
+	bool isSaveRadians() const { return loadSaveMode==1; } //!< returns true if will store angles as degrees on future saves
+	//@}
+	
+	//!@name Sequence Construction
+	virtual void clear()=0; //!< empties out the sequence (constant time operation - faster than a series of pops)
+	void setTime(unsigned int x); //!< set the time for both playback and editing (in milliseconds)
+	unsigned int advanceTime(unsigned int x) {setTime(playtime+x); return playtime; } //!< advance the play/edit index by @a x milliseconds, and then returns the new getTime()
+	void setOutputCmd(unsigned int i, const OutputCmd& cmd); //!< will insert a keyframe for the given output, or change an existing one
+	const OutputCmd& getOutputCmd(unsigned int i); //!< gets the value of output @a i at the playhead
+	void setPose(const PostureEngine& pose); //!< calls setOutputCmd on each of the OutputCmds in @a pose
+	void overlayPose(const PostureEngine& pose); //!< calls setOutputCmd on non-zero weighted OutputCmds in @a pose
+	void compress(); //!< compresses the sequence by eliminating sequences of moves which are identical
+	virtual unsigned int getMaxFrames() const=0; //!< returns the maximum number of key frames (Move's) which can be stored, determined by the instantiating MotionSequenceMC's template parameter
+	virtual unsigned int getUsedFrames() const=0; //!< returns the number of used key frames (Move's) which have been stored by the instantiation MotionSequenceEngine subclass
+	void makeSafe(const float vels[NumOutputs], float margin); //!< will insert time into the motion where needed to keep the joint velocities at or below the speeds given in @a vels * @a margin
+	//@}
+
+	//!@name Playback Control
+	bool isPlaying();                                     //! returns true if currently playing
+	void play();                                          //!< restarts playback from beginning
+	void pause() { playing=false; }                       //!< pauses playback until another call to play() or resume()
+	void resume();                                        //!< begins playback from the current playtime
+	unsigned int getTime() const { return playtime; }     //!< returns the current position of the playback (in milliseconds), see setTime()
+	unsigned int getEndTime() const { return endtime; }   //!< returns the length of the motion sequence (in milliseconds)
+	void setSpeed(float x) { playspeed=x; }               //!< sets the playback speed (e.g. 1=regular, 0.5=half speed, -1=@b backwards)
+	float getSpeed() const { return playspeed; }          //!< returns the playback speed
+	//@}
+
+	//!@name Deprecated
+	void setPlayTime(unsigned int x) __attribute__((deprecated)); //!< deprecated, use setTime(unsigned int x)
+	unsigned int getPlayTime() const __attribute__((deprecated)); //!< deprecated, use getTime()
+	void setPlaySpeed(float x) __attribute__((deprecated)); //!< deprecated, use setSpeed(float x)
+	float getPlaySpeed() const __attribute__((deprecated)); //!< deprecated, use getSpeed()
+	//@}
+protected:
+	// TYPES:
+	typedef unsigned short Move_idx_t; //!< type for indexes to move structures in #moves
+	static Move_idx_t invalid_move; //!< used to mark the ends of the Move linked lists
+
+	//! This struct holds all the information needed about a frame for a particular output
+	struct Move {
+		//!constructor
+		Move() : cmd(), next(), prev(), starttime(0) {}
+		OutputCmd cmd;           //!< the actual command to use
+		Move_idx_t next;        //!< the next frame
+		Move_idx_t prev;        //!< the previous frame
+		unsigned int starttime; //!< the time (relative to first frame) this frame should be expressed at
+	};
+
+	// MEMBERS:
+	Move_idx_t starts[NumOutputs]; //!< the beginning frame for each output animation
+	Move_idx_t prevs[NumOutputs];  //!< the previous frame (the starttime for this frame will always be less than or equal to playtime)
+	Move_idx_t nexts[NumOutputs];  //!< the upcoming frame (the starttime for this frame will always be greater than playtime)
+	OutputCmd curs[NumOutputs];          //!< merely a cache of current values (if computed, see #curstamps)
+	unsigned int curstamps[NumOutputs]; //!< timestamp of corresponding value in #curs
+	unsigned int playtime;              //!< the current time of playback, 0 is start of sequence
+	unsigned int lasttime;              //!< the time of the last update
+	unsigned int endtime;               //!< max of #moves's Move::starttime's
+	float playspeed;                    //!< multiplies the difference between current time and starttime, negative will cause play backwards
+	bool playing;                       //!< true if playing, false if paused
+	
+	float loadSaveMode;                 //!< 1 to use radians, M_PI/180 for degrees during a save
+
+	virtual Move& getKeyFrame(Move_idx_t x) =0;            //!< returns the Move struct corresponding to @a x in the subclass's actual data structure
+	virtual const Move& getKeyFrame(Move_idx_t x) const=0; //!< returns the Move struct corresponding to @a x in the subclass's actual data structure
+	virtual Move_idx_t newKeyFrame()=0;                    //!< causes subclass to create a new Move structure, returns its index
+	virtual void eraseKeyFrame(Move_idx_t x)=0;            //!< causes subclass to mark the corresponding Move structure as free
+
+	//!Does the actual calculation of position information.  Perhaps replace with a Bezier or spline or something?
+	void calcOutput(OutputCmd& ans, unsigned int t, const Move& prev, const Move& next) const {
+		float prevweight=(float)(next.starttime-t)/(float)(next.starttime-prev.starttime);
+		ans.set(prev.cmd,next.cmd,prevweight);
+	}
+	
+	//!Sets prev and next to the appropriate values for the given time and output index
+	virtual void setRange(unsigned int t,Move_idx_t& prev, Move_idx_t& next) const=0;
+
+	//!sets playtime to next time for which any output has a keyframe, -1 if none exists
+	unsigned int setNextFrameTime(Move_idx_t p[NumOutputs], Move_idx_t n[NumOutputs]) const;
+	
+	//!reads a line from a file, parsing it into variables, returns ending position
+	static unsigned int readWord(const char buf[], const char * const buflen, char word[], const unsigned int wordlen);
+
+	//!returns the index for the output named in the string or NumOutputs if not found, begins search through RobotInfo::outputName's at index @a i
+	static unsigned int getOutputIndex(const char name[], unsigned int i);
+};
+
+//! deprecated, use MotionSequenceEngine directly instead
+/*! @deprecated, use MotionSequenceEngine directly instead */
+typedef MotionSequenceEngine MotionSequence __attribute__ ((deprecated)); 
+
+/*! @file
+ * @brief Describes MotionSequenceEngine, abstract code for smoothly transitioning between a sequence of postures
+ * @author ejt (Creator)
+ *
+ * $Author: ejt $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
+ * $State: Exp $
+ * $Date: 2004/12/23 08:41:24 $
+ */
+
+#endif
diff -urdN ../Tekkotsu_2.2.1/Motion/MotionSequenceMC.cc ./Motion/MotionSequenceMC.cc
--- ../Tekkotsu_2.2.1/Motion/MotionSequenceMC.cc	Mon Nov  8 16:48:19 2004
+++ ./Motion/MotionSequenceMC.cc	Wed Dec 31 19:00:00 1969
@@ -1,442 +0,0 @@
-#include "MotionSequenceMC.h"
-#include "Shared/get_time.h"
-#include "Shared/WorldState.h"
-#include "Shared/Config.h"
-#include <iostream>
-
-using std::cout;
-using std::endl;
-
-MotionSequence::Move_idx_t MotionSequence::invalid_move=-1U;
-
-int MotionSequence::updateOutputs() {
-	if(isPlaying()) {
-		if(lasttime==0)
-			play();
-		double diff=(get_time()-lasttime)*playspeed;
-		if(diff+playtime<0)
-			setPlayTime(0);
-		else
-			setPlayTime(static_cast<unsigned int>(diff+playtime));
-		lasttime=get_time();
-		return 1;
-	} else {
-		lasttime=get_time();
-		return 0;
-	}
-}
-
-const OutputCmd& MotionSequence::getOutputCmd(unsigned int i) {
-	if(curstamps[i]!=playtime) {
-		if(nexts[i]!=invalid_move)
-			calcOutput(curs[i],playtime,getKeyFrame(prevs[i]),getKeyFrame(nexts[i]));
-		else
-			curs[i].unset();
-		curstamps[i]=playtime;
-	}
-	return curs[i];
-}
-
-unsigned int MotionSequence::getBinSize() const {
-	char buf[128];
-	unsigned int len=128;
-	unsigned int used=strlen("#MSq\n");
-	used+=snprintf(buf,len,isSaveRadians()?"radians\n":"degrees\n");
-	unsigned int t=0;
-	Move_idx_t tprevs[NumOutputs];
-	Move_idx_t tnexts[NumOutputs];
-	for(unsigned int i=0;i<NumOutputs;i++)
-		tnexts[i]=getKeyFrame(tprevs[i]=starts[i]).next;
-	while(t!=-1U) {
-		for(unsigned int i=0; i<NumOutputs; i++) {
-			if((t!=0 || getKeyFrame(tprevs[i]).cmd.weight!=0) && getKeyFrame(tprevs[i]).starttime==t) {
-				if(getKeyFrame(tprevs[i]).cmd.weight==1) {
-					if(t!=0)
-						used+=snprintf(buf,len,"%s\t%g\n",outputNames[i],getKeyFrame(tprevs[i]).cmd.value/loadSaveMode);
-				} else
-					used+=snprintf(buf,len,"%s\t%g\t%g\n",outputNames[i],getKeyFrame(tprevs[i]).cmd.value/loadSaveMode,getKeyFrame(tprevs[i]).cmd.weight);
-			}
-		}
-		unsigned int last=t;
-		t=setNextFrameTime(tprevs,tnexts);
-		if(t!=-1U)
-			used+=snprintf(buf,len,"delay\t%d\n",t-last);
-	}
-	used+=strlen("#END\n");
-	return used+1;
-}
-
-unsigned int MotionSequence::LoadBuffer(const char buf[], unsigned int len) {
-	unsigned int origlen=len;
-	if(strncmp("#MSq",buf,4)!=0) {
-		// we don't want to display an error here because we may be only testing file type,
-		// so it's up to the caller to decide if it's necessarily an error if the file isn't
-		// a motion sequence
-		//cout << "ERROR MotionSequence load corrupted - expected #MSq header" << endl;
-		return 0;
-	}
-	unsigned int linenum=1;
-	unsigned int lastOutputIdx=0;
-	while(len<=origlen && len>0) {
-		int written;
-		//printf("%d %.9s\n",linenum+1,buf);
-		if(buf[0]=='\r') {
-			buf++; len--;
-			if(buf[0]=='\n') {
-				buf++; len--;
-			}
-			linenum++;
-			continue;
-		}
-		if(buf[0]=='\n') {
-			buf++; len--;
-			linenum++;
-			continue;
-		}
-		if(buf[0]=='#') {
-			if(strncmp("#END\n",buf,5)==0 || strncmp("#END\r",buf,5)==0) {
-				return origlen-len+5;
-			} else if(strncmp("#END\r\n",buf,6)==0) {
-				return origlen-len+6;
-			} else {
-				while(len>0 && *buf!='\n' && *buf!='\r') {len--;buf++;}
-				if(*buf=='\n') { //in case of \r\n
-					buf++;
-					len--;
-				}
-				linenum++;
-				continue;
-			}
-		}
-		written=-1;
-		const unsigned int cmdlen=16, arglen=32;
-		char command[cmdlen];
-		char arg1[arglen];
-		char arg2[arglen];
-		written=readWord(buf,&buf[len],command,cmdlen);
-		if(!ChkAdvance(written,&buf,&len,"*** ERROR MotionSequence load corrupted - line %d\n",linenum)) return 0;
-		written=readWord(buf,&buf[len],arg1,arglen);
-		if(written>0)
-			if(!ChkAdvance(written,&buf,&len,"*** ERROR MotionSequence load corrupted - line %d\n",linenum)) return 0;
-		written=readWord(buf,&buf[len],arg2,arglen);
-		if(written!=0)
-			if(!ChkAdvance(written,&buf,&len,"*** ERROR MotionSequence load corrupted - line %d\n",linenum)) return 0;
-		for(;len>0 && *buf!='\n' && *buf!='\r';buf++,len--) {}
-		if(*buf=='\n') { //in case of \r\n
-			buf++;
-			len--;
-		}
-
-		if(strcasecmp(command,"delay")==0) {
-			char* used;
-			int delay = strtol(arg1,&used,0);
-			if(*used!='\0') {
-				cout << "*** WARNING illegal delay argument: " << arg1 << " - line " << linenum << endl;
-			} else {
-				setPlayTime(playtime+delay);
-			}
-		} else if(strcasecmp(command,"settime")==0) {
-			char* used;
-			int newtime = strtol(arg1,&used,0);
-			if(*used!='\0') {
-				cout << "*** WARNING illegal settime argument: " << arg1 << " - line " << linenum << endl;
-			} else {
-				setPlayTime(newtime);
-			}
-		} else if(strcasecmp(command,"load")==0) {
-			PostureEngine pose;
-			std::string f;
-			if(arg1[0]!='/')
-				f="/ms/data/motion/";
-			f+=arg1;
-			if(pose.LoadFile(f.c_str())!=0) {
-				setPose(pose);
-			} else
-				cout << "*** WARNING could not read file " << arg1 << " for load - line " << linenum << endl;
-		} else if(strcasecmp(command,"overlay")==0) {
-			PostureEngine pose;
-			std::string f;
-			if(arg1[0]!='/')
-				f="/ms/data/motion/";
-			f+=arg1;
-			if(pose.LoadFile(f.c_str())!=0)
-				overlayPose(pose);
-			else if(LoadFile(f.c_str())==0)
-				cout << "*** WARNING could not read file " << arg1 << " for overlay - line " << linenum << endl;
-		} else if(strcasecmp(command,"degrees")==0) {
-			setSaveDegrees();
-		} else if(strcasecmp(command,"radians")==0) {
-			setSaveRadians();
-		} else {
-			lastOutputIdx=getOutputIndex(command,lastOutputIdx+1);
-			if(lastOutputIdx==NumOutputs)
-				cout << "*** WARNING " << command << " is not a valid joint on this model." << endl;
-			else {
-				char* used;
-				double value=strtod(arg1,&used), weight=1;
-				if(*used!='\0')
-					cout << "*** WARNING illegal value argument: " << arg1 << " - line " << linenum << endl;
-				else {
-					if(arg2[0]!='\0') {
-						weight=strtod(arg2,&used);
-						if(*used!='\0') {
-							cout << "*** WARNING illegal weight argument: " << arg2 << " - line " << linenum << endl;
-							weight=1;
-						}
-					}
-					setOutputCmd(lastOutputIdx,OutputCmd(value*loadSaveMode,weight));
-				}
-			}
-		}
-
-		linenum++;
-
-	}
-	cout << "*** WARNING MotionSequence load missing #END" << endl;
-	return origlen-len;
-}
-
-unsigned int MotionSequence::SaveBuffer(char buf[], unsigned int len) const {
-	//std::cout << "SAVEBUFFER..." << std::flush;
-	unsigned int origlen=len;
-	int written=snprintf(buf,len,"#MSq\n");
-	if(!ChkAdvance(written,(const char**)&buf,&len,"*** ERROR MotionSequence save failed on header\n")) return 0;	if(len==0 || len>origlen) {
-		cout << "*** ERROR MotionSequence save overflow on header" << endl;
-		return 0;
-	}
-	written=snprintf(buf,len,isSaveRadians()?"radians\n":"degrees\n");
-	if(!ChkAdvance(written,(const char**)&buf,&len,"*** ERROR MotionSequence save failed on mode\n")) return 0;	if(len==0 || len>origlen) {
-		cout << "*** ERROR MotionSequence save overflow" << endl;
-		return 0;
-	}
-	unsigned int t=0;
-	Move_idx_t tprevs[NumOutputs];
-	Move_idx_t tnexts[NumOutputs];
-	for(unsigned int i=0;i<NumOutputs;i++)
-		tnexts[i]=getKeyFrame(tprevs[i]=starts[i]).next;
-	while(t!=-1U) {
-//		std::cout << "t="<<t<<"..."<<std::flush;
-		for(unsigned int i=0; i<NumOutputs; i++) {
-//			cout << i << ' ' << outputNames[i] << ' ' << getKeyFrame(tprevs[i]).cmd.value << ' ' << getKeyFrame(tprevs[i]).cmd.weight << ' ' << getKeyFrame(tprevs[i]).starttime << " state: " << starts[i] <<' '<< prevs[i] <<' '<< nexts[i] << " cur: " << getKeyFrame(tprevs[i]).prev << ' ' << tprevs[i] << ' ' << getKeyFrame(tprevs[i]).next << endl;
-			//first conditional is to skip 0 weighted values in first frame
-			if((t!=0 || getKeyFrame(tprevs[i]).cmd.weight!=0) && getKeyFrame(tprevs[i]).starttime==t) {
-				if(getKeyFrame(tprevs[i]).cmd.weight==1) {
-					if(t!=0) {
-						written=snprintf(buf,len,"%s\t%g\n",outputNames[i],getKeyFrame(tprevs[i]).cmd.value/loadSaveMode);
-						if(!ChkAdvance(written,(const char**)&buf,&len,"*** ERROR MotionSequence save failed\n")) return 0;
-					}
-				} else {
-					written=snprintf(buf,len,"%s\t%g\t%g\n",outputNames[i],getKeyFrame(tprevs[i]).cmd.value/loadSaveMode,getKeyFrame(tprevs[i]).cmd.weight);
-					if(!ChkAdvance(written,(const char**)&buf,&len,"*** ERROR MotionSequence save failed\n")) return 0;
-				}
-				if(len==0 || len>origlen) {
-					cout << "*** ERROR MotionSequence save overflow" << endl;
-					return 0;
-				}
-			}
-		}
-		unsigned int last=t;
-		t=setNextFrameTime(tprevs,tnexts);
-		if(t!=-1U) {
-			written=snprintf(buf,len,"delay\t%d\n",t-last);
-			if(!ChkAdvance(written,(const char**)&buf,&len,"*** ERROR MotionSequence save failed\n")) return 0;
-			if(len==0 || len>origlen) {
-				cout << "*** ERROR MotionSequence save overflow" << endl;
-				return 0;
-			}
-		}
-	}
-	written=snprintf(buf,len,"#END\n");
-	if(!ChkAdvance(written,(const char**)&buf,&len,"*** ERROR MotionSequence save failed on #END\n")) return 0;
-	if(len==0 || len>origlen) {
-		cout << "*** ERROR MotionSequence save overflow on #END" << endl;
-		return 0;
-	}
-	return origlen-len;
-	cout << "SAVE-done!" << endl;
-}
-
-unsigned int MotionSequence::LoadFile(const char filename[]) {
-	return LoadSave::LoadFile(config->motion.makePath(filename).c_str());
-}
-unsigned int MotionSequence::SaveFile(const char filename[]) const {
-	return LoadSave::SaveFile(config->motion.makePath(filename).c_str());
-}
-
-void MotionSequence::setPlayTime(unsigned int x) {
-	playtime=x;
-	for(unsigned int i=0; i<NumOutputs; i++)
-		setRange(x,prevs[i],nexts[i]);
-}
-
-void MotionSequence::setOutputCmd(unsigned int i, const OutputCmd& cmd) {
-	Move& p_m=getKeyFrame(prevs[i]);
-	if(playtime==p_m.starttime) { //edit current keyframe
-		p_m.cmd=cmd;
-	} else { //add new keyframe
-		Move_idx_t x = newKeyFrame();
-		if(x==invalid_move) //ran out of memory - newKeyFrame should report error, we can silently die
-			return;
-		Move& cur=getKeyFrame(x);
-		Move& prev_m=getKeyFrame(prevs[i]); //it's important to refresh this - newKeyFrame may have invalidated p_m reference
-		cur.cmd=cmd;
-		cur.starttime=playtime;
-		cur.prev=prevs[i];
-		cur.next=nexts[i];
-		prev_m.next=x;
-		if(nexts[i]!=invalid_move) //in middle
-			getKeyFrame(nexts[i]).prev=x;
-		else { //at end
-			if(playtime>endtime)
-				endtime=playtime;
-		}
-		prevs[i]=x;
-//		cout << "set " << i << ' ' << outputNames[i] << ' ' << cur.cmd.value << ' ' << cur.cmd.weight << ' ' << cur.starttime << " state: " << starts[i] <<' '<< prevs[i] <<' '<< prev_m.next <<' '<< nexts[i] << " new: " << cur.prev << ' ' << x << ' ' << cur.next << endl;
-	}
-}
-
-void MotionSequence::setPose(const PostureEngine& pose) {
-	for(unsigned int i=0; i<NumOutputs; i++)
-		setOutputCmd(i,pose.getOutputCmd(i));
-}
-
-void MotionSequence::overlayPose(const PostureEngine& pose) {
-	for(unsigned int i=0; i<NumOutputs; i++)
-		if(pose.getOutputCmd(i).weight>0)
-			setOutputCmd(i,pose.getOutputCmd(i));
-}
-
-void MotionSequence::compress() {
-	for(unsigned int i=0; i<NumOutputs; i++) {
-		Move_idx_t prev=getKeyFrame(starts[i]).next;
-		if(prev==(Move_idx_t)-1)
-			break;
-		Move_idx_t cur=getKeyFrame(prev).next;
-		if(cur==(Move_idx_t)-1)
-			break;
-		Move_idx_t next=getKeyFrame(cur).next;
-		while(next!=(Move_idx_t)-1) {
-			OutputCmd tmp;
-			Move& prev_m=getKeyFrame(prev);
-			Move& cur_m=getKeyFrame(cur);
-			Move& next_m=getKeyFrame(next);
-			calcOutput(tmp,cur_m.starttime,prev_m,next_m);
-			if(tmp==cur_m.cmd || tmp.weight==0 && cur_m.cmd.weight==0) {
-				prev_m.next=next;
-				next_m.prev=prev;
-				eraseKeyFrame(cur);
-			} else
-				prev=cur;
-			cur=next;
-			next=next_m.next;
-		}
-	}
-}
-
-void MotionSequence::makeSafe(const float vels[NumOutputs], float margin) {
-	float comps[NumOutputs];
-	for(unsigned int i=0;i<NumOutputs;i++)
-		comps[i]=vels[i]*margin;
-	unsigned int t=0;
-	Move_idx_t tprevs[NumOutputs];
-	Move_idx_t tnexts[NumOutputs];
-	for(unsigned int i=0;i<NumOutputs;i++)
-		tnexts[i]=getKeyFrame(tprevs[i]=starts[i]).next;
-	while(t!=-1U) {
-		for(unsigned int i=0; i<NumOutputs; i++) {
-			//second and third conditionals are to skip transitions between 0 weighted frames
-			if(tnexts[i]!=(Move_idx_t)-1 && (getKeyFrame(tprevs[i]).cmd.weight!=0 || getKeyFrame(tnexts[i]).cmd.weight!=0) && getKeyFrame(tprevs[i]).starttime==t) {
-				float dv=fabs(getKeyFrame(tprevs[i]).cmd.value-getKeyFrame(tnexts[i]).cmd.value);
-				unsigned int dt=getKeyFrame(tnexts[i]).starttime-getKeyFrame(tprevs[i]).starttime;
-				if(dv/dt>comps[i]) {
-					unsigned int delay=(unsigned int)(dv/comps[i])-dt;
-					for(unsigned int j=0; j<NumOutputs; j++)
-						for(Move_idx_t c=tnexts[j]; c!=(Move_idx_t)-1; c=getKeyFrame(c).next)
-							getKeyFrame(c).starttime+=delay;
-				}
-			}
-		}
-		t=setNextFrameTime(tprevs,tnexts);
-	}
-	
-}	
-
-void MotionSequence::play() {
-	if(playspeed>0)
-		setPlayTime(0);
-	else
-		setPlayTime(endtime);
-	resume();
-}
-
-void MotionSequence::resume() {
-	playing=true;
-	lasttime=get_time();
-	for(unsigned int i=0; i<NumOutputs; i++) {
-		Move_idx_t cur=starts[i];
-		while(cur!=(Move_idx_t)-1) {
-			if(getKeyFrame(cur).cmd.weight!=0) {
-				getKeyFrame(starts[i]).cmd.value=state->outputs[i];
-				break;
-			}
-			cur=getKeyFrame(cur).next;
-		}
-	}
-}
-
-unsigned int MotionSequence::setNextFrameTime(Move_idx_t p[NumOutputs], Move_idx_t n[NumOutputs]) const {
-	unsigned int ans=-1U;
-	for(unsigned int i=0; i<NumOutputs; i++)
-		if(n[i]!=invalid_move && getKeyFrame(n[i]).starttime<ans)
-			ans=getKeyFrame(n[i]).starttime;
-	if(ans!=-1U)
-		for(unsigned int i=0; i<NumOutputs; i++)
-			setRange(ans,p[i],n[i]);
-	return ans;
-}
-
-unsigned int MotionSequence::readWord(const char buf[], const char * const bufend, char wrd[], const unsigned int wordlen) {
-	const char* origbuf=buf;
-	wrd[0]='\0';
-	unsigned int i;
-	//skip whitespace
-	for(;buf<bufend && isspace(*buf) && *buf!='\n' && *buf!='\r';buf++) {}
-	//store wrd
-	for(i=0; buf<bufend && !isspace(*buf); buf++)
-		if(i<wordlen-1)
-			wrd[i++]=*buf;
-	wrd[i]='\0';
-	if(buf>=bufend)
-		return -1U;
-	return buf-origbuf;
-}
-
-unsigned int MotionSequence::getOutputIndex(const char name[], unsigned int idx) {
-	if(idx<NumOutputs) {
-		unsigned int startidx=idx;
-		for(;idx<NumOutputs;idx++)
-			if(strcmp(name,outputNames[idx])==0)
-				return idx;
-		for(idx=0;idx<startidx;idx++)
-			if(strcmp(name,outputNames[idx])==0)
-				return idx;
-		return NumOutputs;
-	} else {
-		for(idx=0;idx<NumOutputs;idx++)
-			if(strcmp(name,outputNames[idx])==0)
-				return idx;
-		return idx;
-	}
-}
-
-/*! @file
- * @brief Implements MotionSequence, handy little (or not so little) class for switching between a sequence of postures
- * @author ejt (Creator)
- *
- * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
- * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
- */
-
diff -urdN ../Tekkotsu_2.2.1/Motion/MotionSequenceMC.h ./Motion/MotionSequenceMC.h
--- ../Tekkotsu_2.2.1/Motion/MotionSequenceMC.h	Thu Oct 14 15:24:46 2004
+++ ./Motion/MotionSequenceMC.h	Wed Dec 22 20:47:07 2004
@@ -2,272 +2,43 @@
 #ifndef INCLUDED_MotionSequenceMC_h_
 #define INCLUDED_MotionSequenceMC_h_
 
+#include "MotionSequenceEngine.h"
 #include "MotionCommand.h"
 #include "MotionManager.h"
-#include "Shared/LoadSave.h"
-#include "Shared/ListMemBuf.h"
-#include "PostureEngine.h"
-
-#include <iostream>
-
-//! A handy little (or not so little) class for switching between a sequence of postures
-/*! Outputs are handled independently.  It's easy to add keyframes
- *  which modify all of the outputs, but since each output is tracked
- *  individually, OutputCmd's with 0 weight can be used to not affect
- *  other motions.  For instance, pan the head left to right while
- *  moving the right leg up and down several times, you won't have to
- *  specify the position of the head in its motion at each of the leg
- *  motion keyframes.
- *
- *  Be aware that the 0 time frame will be replaced on a call to
- *  play() with the current body posture.  However, this only applies
- *  to  outputs which have a non-zero weighted frame defined at some
- *  point.  The weights, of the 0 time frame will remain unchanged.  
- *  These weights are initially set to 0, so that it's
- *  possible to 'fade in' the first frame of the motion sequence from
- *  whereever the body happens to be (or already doing)
- *
- *  To fade out at the end, set a frame with 0 weight for everything.
- *  Otherwise it will simply die suddenly.  When a joint reaches its
- *  last keyframe, it will be set to 0 weight for all future
- *  updateOutputs() (unless of course the playhead is reset)
- *
- *  Currently, MotionSequence's are intended mainly for building, 
- *  not editing.  It's easy to add keyframes, but hard/impossible to
- *  delete them.
- *
- *  The MotionSequence base class is an abstract class so that you can
- *  create memory efficient motion sequences and simply refer to them
- *  by the common base class instead of having to worry about the
- *  actual size allocated in the template, MotionSequenceMC.
- *
- *  @see MotionSequence::SizeSmall, MotionSequence::SizeMedium, MotionSequence::SizeLarge, MotionSequence::SizeXLarge, 
- *  
- *  The file format used is as follows: ('<' and '>' are not meant literally)
- *  - First line: '<tt>#MSq</tt>'
- *  - Followed by any series of:\n
- *    - '<tt>delay </tt><i>time-delta</i>' - moves playhead forward, in milliseconds
- *    - '<tt>settime </tt><i>time</i>' - sets play time to specified value, in ms
- *    - '<i>outputname</i><tt> </tt><i>value</i><tt> </tt>[<i>weight</i>]' - sets the specified output to the value - assumes 1 for weight; you can view the list of valid joint names in the outputNames array within the RobotInfo extension namespace for your model.  (e.g. ERS210Info::outputNames[])
- *    - '<tt>load </tt><i>filename</i>' - file is a posture, sets position
- *    - '<tt>overlay </tt><i>filename</i>' - file can be a posture or another motion sequence
- *    - '<tt>degrees</tt>' - following <i>value</i>s will be interpreted as degrees [default]
- *    - '<tt>radians</tt>' - following <i>value</i>s will be interpreted as radians
- *    - '<tt>#</tt><i>comment</i>' - a comment line
- *  - Last line: '<tt>#END</tt>'
- *  
- *  After loading a motion sequence, the playtime is left at the end.
- *  This is to make it easy to append/overlay motion sequences.
- *  However, the playhead will be reset to the beginning on the first
- *  call to updateOutputs() if isPlaying() returns true.
- *
- *  You can also create a MotionSequence dynamically at run time:
- *  \code
- *  //This code sample will stand up, point the head forward and up 0.1 radians,
- *  //and then autoprune
- *
- *  //First declare the MotionSequence itself:
- *  SharedObject< MotionSequenceMC<MotionSequence::SizeSmall> > stand;
- *
- *  //Over the course of 700 milliseconds, go to standing posture:
- *  standSit->setPlayTime(700);
- *  standSit->setPose(PostureEngine("/ms/data/motion/stand.pos"));
- *
- *  //Then take another 700 milliseconds to straighten out the head:
- *  standSit->setPlayTime(700);
- *  //We'll set joints individually this time, instead of loading a posture file:
- *  standSit->setOutputCmd(HeadOffset+PanOffset,0);
- *  standSit->setOutputCmd(HeadOffset+RollOffset,0);
- *  standSit->setOutputCmd(HeadOffset+TiltOffset,0.1); //look up .1 radians
- *
- *  //Add to MotionManager:
- *  motman->addMotion(standSit);
- *  //Playback will now begin automatically, and region deallocated when done
- *  \endcode
- *  
- *  By default, #playing is true.  Thus, when you add a MotionSequence
- *  to the MotionManager, it will begin executing automatically.  If
- *  you do \e not want this behavior, simply call pause() before
- *  adding the sequence.
- *
- *  When the sequence reaches the end, isAlive() will return false.
- *  By default, the motion sequence will autoprune itself from the
- *  MotionManager.  However, you can either pass \c false to
- *  MotionManager::addMotion(), or call setAutoPrune(false).
- *  
- *  Lines beginning with '#' are ignored as comments.  Be aware if you
- *  load the file and then save it again, these comments will be lost.
- *  
- *  @see PostureEngine for information on the posture files
- */
-class MotionSequence : public MotionCommand, public LoadSave {
-public:
-	//!constructor, will start playing immediately
-	MotionSequence() : MotionCommand(), playtime(1), lasttime(0), endtime(0), playspeed(1.0), playing(true), loadSaveMode(M_PI/180) {}
-	//!destructor
-	virtual ~MotionSequence() {}
-
-	//!To avoid code bloat if there are a large number of different sized MotionSequences, use these sizes where possible.
-	//!@name Template Sizes
-	static const unsigned int SizeTiny   = NumOutputs*2;  //!< Tiny, but enough to handle a transition into a full-body pose
-	static const unsigned int SizeSmall  = NumOutputs*3;  //!< Small, but still big enough to handle most of the included MS's (2 full-body frames ~ around 1KB)
-	static const unsigned int SizeMedium = NumOutputs*6;  //!< Medium (5 full body frames ~ est 4KB)
-	static const unsigned int SizeLarge  = NumOutputs*11;  //!< Large (10 full body frames ~ est 8KB)
-	static const unsigned int SizeXLarge = NumOutputs*26;  //!< eXtra Large (25 full body frames ~ est 16KB)
-	//@}
-
-	//!@name Inherited from MotionCommand
-	virtual int updateOutputs();
-	virtual int isDirty() { return isPlaying(); }
-	virtual int isAlive() { return (playspeed>0) ? (playtime<=endtime) : (playtime>0); }
-	//@}
-	
-	//!@name LoadSave related
-	virtual unsigned int getBinSize() const; //!< inherited, returns the size used to save the sequence
-	virtual unsigned int LoadBuffer(const char buf[], unsigned int len); //!< inherited, doesn't clear before loading - call clear yourself if you want to reset, otherwise it will overlay.  Leaves playtime at end of load.
-	virtual unsigned int SaveBuffer(char buf[], unsigned int len) const; //!< inherited, saves the motion sequence - will save a flat file - doesn't remember references to other files which were loaded
-	virtual unsigned int LoadFile(const char filename[]); //!< inherited, doesn't clear before loading - call clear yourself if you want to reset, otherwise it will overlay.  Leaves playtime at end of load.
-	virtual unsigned int SaveFile(const char filename[]) const; //!< inherited, saves the motion sequence - will save a flat file - doesn't remember references to other files which were loaded
-	void setSaveDegrees() { loadSaveMode=M_PI/180; }       //!< will store angles as degrees on future saves
-	bool isSaveDegrees() const { return loadSaveMode!=1; } //!< returns true if will store angles as degrees on future saves
-	void setSaveRadians() { loadSaveMode=1; }              //!< will store angles as radians on future saves
-	bool isSaveRadians() const { return loadSaveMode==1; } //!< returns true if will store angles as degrees on future saves
-	//@}
-	
-	//!@name Sequence Construction
-	virtual void clear()=0; //!< empties out the sequence (constant time operation - faster than a series of pops)
-	void setPlayTime(unsigned int x); //!< set the time for both playback and editing (in milliseconds)
-	void setOutputCmd(unsigned int i, const OutputCmd& cmd); //!< will insert a keyframe for the given output, or change an existing one
-	const OutputCmd& getOutputCmd(unsigned int i); //!< gets the value of output @a i at the playhead
-	void setPose(const PostureEngine& pose); //!< calls setOutputCmd on each of the OutputCmds in @a pose
-	void overlayPose(const PostureEngine& pose); //!< calls setOutputCmd on non-zero weighted OutputCmds in @a pose
-	void compress(); //!< compresses the sequence by eliminating sequences of moves which are identical
-	virtual unsigned int getMaxFrames() const=0; //!< returns the maximum number of key frames (Move's) which can be stored, determined by the instantiating MotionSequenceMC's template parameter
-	virtual unsigned int getUsedFrames() const=0; //!< returns the number of used key frames (Move's) which have been stored by the instantiation MotionSequence subclass
-	void makeSafe(const float vels[NumOutputs], float margin); //!< will insert time into the motion where needed to keep the joint velocities at or below the speeds given in @a vels * @a margin
-	//@}
-
-	//!@name Playback Control
-	bool isPlaying() { return playing && isAlive(); }       //!< returns true if currently playing
-	void play();                                            //!< restarts playback from beginning
-	void pause() { playing=false; }                         //!< pauses playback until another call to play() or resume()
-	void resume();                                          //!< begins playback from the current playtime
-	unsigned int getPlayTime() const { return playtime; }   //!< returns the current position of the playback (in milliseconds), see setPlayTime()
-	unsigned int getEndTime() const { return endtime; }     //!< returns the length of the motion sequence (in milliseconds)
-	void setPlaySpeed(float x) { playspeed=x; }            //!< sets the playback speed (e.g. 1=regular, 0.5=half speed, -1=@b backwards)
-	float getPlaySpeed() const { return playspeed; }       //!< returns the playback speed
-	//@}
 
-protected:
-	// TYPES:
-	typedef unsigned short Move_idx_t; //!< type for indexes to move structures in #moves
-	static Move_idx_t invalid_move; //!< used to mark the ends of the Move linked lists
-
-	//! This struct holds all the information needed about a frame for a particular output
-	struct Move {
-		//!constructor
-		Move() : cmd(), next(), prev(), starttime(0) {}
-		OutputCmd cmd;           //!< the actual command to use
-		Move_idx_t next;        //!< the next frame
-		Move_idx_t prev;        //!< the previous frame
-		unsigned int starttime; //!< the time (relative to first frame) this frame should be expressed at
-	};
-
-	// MEMBERS:
-	Move_idx_t starts[NumOutputs]; //!< the beginning frame for each output animation
-	Move_idx_t prevs[NumOutputs];  //!< the previous frame (the starttime for this frame will always be less than or equal to playtime)
-	Move_idx_t nexts[NumOutputs];  //!< the upcoming frame (the starttime for this frame will always be greater than playtime)
-	OutputCmd curs[NumOutputs];          //!< merely a cache of current values (if computed, see #curstamps)
-	unsigned int curstamps[NumOutputs]; //!< timestamp of corresponding value in #curs
-	unsigned int playtime;              //!< the current time of playback, 0 is start of sequence
-	unsigned int lasttime;              //!< the time of the last update
-	unsigned int endtime;               //!< max of #moves's Move::starttime's
-	float playspeed;                    //!< multiplies the difference between current time and starttime, negative will cause play backwards
-	bool playing;                       //!< true if playing, false if paused
-	
-	float loadSaveMode;                 //!< 1 to use radians, M_PI/180 for degrees during a save
-
-	virtual Move& getKeyFrame(Move_idx_t x) =0;            //!< returns the Move struct corresponding to @a x in the subclass's actual data structure
-	virtual const Move& getKeyFrame(Move_idx_t x) const=0; //!< returns the Move struct corresponding to @a x in the subclass's actual data structure
-	virtual Move_idx_t newKeyFrame()=0;                    //!< causes subclass to create a new Move structure, returns its index
-	virtual void eraseKeyFrame(Move_idx_t x)=0;            //!< causes subclass to mark the corresponding Move structure as free
-
-	//!Does the actual calculation of position information.  Perhaps replace with a Bezier or spline or something?
-	void calcOutput(OutputCmd& ans, unsigned int t, const Move& prev, const Move& next) const {
-		float prevweight=(float)(next.starttime-t)/(float)(next.starttime-prev.starttime);
-		ans.set(prev.cmd,next.cmd,prevweight);
-	}
-	
-	//!Sets prev and next to the appropriate values for the given time and output index
-	virtual void setRange(unsigned int t,Move_idx_t& prev, Move_idx_t& next) const=0;
-
-	//!sets playtime to next time for which any output has a keyframe, -1 if none exists
-	unsigned int setNextFrameTime(Move_idx_t p[NumOutputs], Move_idx_t n[NumOutputs]) const;
-	
-	//!reads a line from a file, parsing it into variables, returns ending position
-	static unsigned int readWord(const char buf[], const char * const buflen, char word[], const unsigned int wordlen);
-
-	//!returns the index for the output named in the string or NumOutputs if not found, begins search through RobotInfo::outputName's at index @a i
-	static unsigned int getOutputIndex(const char name[], unsigned int i);
-};
-
-//! Instantiates MotionSequences - when you want to make a new MotionSequence, make one of these
-/*! Allows a (compile-time) variable amount of data storage through its template parameter.
- *  See MotionSequence for documentation on its members
- *  @see MotionSequence
- *  @see MotionSequence::SizeSmall, MotionSequence::SizeMedium, MotionSequence::SizeLarge, MotionSequence::SizeXLarge, 
+//! Instantiates MotionSequenceEngines - when you want to run a motion sequence, make one of these
+/*! Allows a compile-time variable amount of data storage through its template parameter.
+ *  @see MotionSequenceEngine for the majority of the usage documentation
+ *  @see TinyMotionSequenceMC, SmallMotionSequenceMC, MediumMotionSequenceMC, LargeMotionSequenceMC, XLargeMotionSequenceMC
  *  */
 template<unsigned int MAXMOVE>
-class MotionSequenceMC : public MotionSequence {
+class MotionSequenceMC : public MotionCommand, public MotionSequenceEngine {
 public:
+	static const unsigned int CAPACITY=MAXMOVE; //!< allows recovery of capacity in a general way (MAXMOVE may, and probably will, be obscured by a typedef)
+
 	//!constructor
 	MotionSequenceMC()
-		: MotionSequence(), moves()
+		: MotionCommand(), MotionSequenceEngine(), moves()
 	{
 		clear();
 	}
 	//!constructor, loads from a file and then resets the playtime to beginning and begins to play
 	explicit MotionSequenceMC(const char* filename)
-		: MotionSequence(), moves()
+		: MotionSequenceEngine(), moves()
 	{
 		clear();
 		LoadFile(filename);
-		setPlayTime(1);
+		setTime(1);
 	}
 	//!destructor
 	virtual ~MotionSequenceMC() {}
 
+	virtual int isDirty() { return isPlaying(); }
+	virtual int isAlive() { return (playspeed>0) ? (playtime<=endtime) : (playtime>0); }
 	
-	/*struct logent {
-		logent(unsigned int t, unsigned int p, unsigned int i, OutputCmd f[NumFrames])
-			: time(t), play(p), index(i)
-		{
-			for(unsigned int j=0;j<NumFrames;j++)
-				frames[j]=f[j];
-		}
-		unsigned int time,play,index;
-		OutputCmd frames[NumFrames];
-	};
-
-	std::vector<logent> log;
-
-	virtual int isAlive() {
-		if(MotionSequenceMC::isAlive())
-			return true;
-		cout << "LOG:" << endl;
-		for(unsigned int i=0; i<log.size(); i++) {
-			cout << '#' << '\t' << log[i].time << '\n';
-			for(unsigned int j=0; j<NumFrames; j++)
-				cout << log[i].play+j*FrameTime << ' ' << log[i].frames[j].value << ' ' << log[i].frames[j].weight << ' ' << log[i].index << '\n';
-		}
-		cout << endl;
-		log.clear();
-		return false;
-		}*/
-
 	// I put this here because i want direct access to moves so it'll be faster
 	virtual int updateOutputs() {
-		MotionSequence::updateOutputs();
+		MotionSequenceEngine::updateOutputs();
 		if(!isPlaying()) {
 			for(unsigned int i=0; i<NumOutputs; i++) //just copies getOutputCmd(i) across frames
 				motman->setOutput(this,i,getOutputCmd(i));
@@ -300,8 +71,9 @@
 			moves.back().prev=invalid_move;
 			nexts[i]=invalid_move;
 		}
-		setPlayTime(1);
+		setTime(1);
 	}
+
 	virtual unsigned int getMaxFrames() const { return moves.getMaxCapacity(); }
 	virtual unsigned int getUsedFrames() const { return moves.size(); }
 
@@ -336,15 +108,21 @@
 	}
 };
 
+typedef MotionSequenceMC<NumOutputs*2> TinyMotionSequenceMC; //!< Tiny, but enough to handle a transition into a full-body pose
+typedef MotionSequenceMC<NumOutputs*3> SmallMotionSequenceMC;//!< Small, but still big enough to handle most of the included MS's (2 full-body frames ~ around 1KB)
+typedef MotionSequenceMC<NumOutputs*6> MediumMotionSequenceMC;//!< Medium (5 full body frames ~ est 4KB)
+typedef MotionSequenceMC<NumOutputs*11> LargeMotionSequenceMC;//!< Large (10 full body frames ~ est 8KB)
+typedef MotionSequenceMC<NumOutputs*26> XLargeMotionSequenceMC;//!< eXtra Large (25 full body frames ~ est 16KB)
+
 /*! @file
- * @brief Describes MotionSequence and defines MotionSequenceMC, handy little (or not so little) classes for switching between a sequence of postures
+ * @brief Describes MotionSequenceEngine and defines MotionSequenceMC, handy little (or not so little) classes for switching between a sequence of postures
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Motion/OldHeadPointerMC.cc ./Motion/OldHeadPointerMC.cc
--- ../Tekkotsu_2.2.1/Motion/OldHeadPointerMC.cc	Thu Oct 14 16:23:50 2004
+++ ./Motion/OldHeadPointerMC.cc	Thu Oct 14 16:23:50 2004
@@ -176,7 +176,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Motion/OldHeadPointerMC.h ./Motion/OldHeadPointerMC.h
--- ../Tekkotsu_2.2.1/Motion/OldHeadPointerMC.h	Thu Oct 14 16:23:50 2004
+++ ./Motion/OldHeadPointerMC.h	Thu Oct 14 16:23:50 2004
@@ -116,7 +116,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Motion/OldKinematics.cc ./Motion/OldKinematics.cc
--- ../Tekkotsu_2.2.1/Motion/OldKinematics.cc	Thu Aug  5 16:29:04 2004
+++ ./Motion/OldKinematics.cc	Thu Aug  5 16:29:04 2004
@@ -603,7 +603,7 @@
  * @verbinclude CMPack_license.txt
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Motion/OldKinematics.h ./Motion/OldKinematics.h
--- ../Tekkotsu_2.2.1/Motion/OldKinematics.h	Thu Aug  5 16:29:04 2004
+++ ./Motion/OldKinematics.h	Thu Aug  5 16:29:04 2004
@@ -118,7 +118,7 @@
  * @verbinclude CMPack_license.txt
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Motion/OutputCmd.h ./Motion/OutputCmd.h
--- ../Tekkotsu_2.2.1/Motion/OutputCmd.h	Sun Sep  7 18:14:01 2003
+++ ./Motion/OutputCmd.h	Sun Sep  7 18:14:01 2003
@@ -27,7 +27,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Motion/OutputPID.h ./Motion/OutputPID.h
--- ../Tekkotsu_2.2.1/Motion/OutputPID.h	Sat Dec 13 00:01:40 2003
+++ ./Motion/OutputPID.h	Sat Dec 13 00:01:40 2003
@@ -44,7 +44,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Motion/PIDMC.h ./Motion/PIDMC.h
--- ../Tekkotsu_2.2.1/Motion/PIDMC.h	Wed Jan 14 15:45:01 2004
+++ ./Motion/PIDMC.h	Mon Dec 20 19:42:21 2004
@@ -67,6 +67,7 @@
 	}
 	virtual int isDirty() { return dirty; }
 	virtual int isAlive() { return dirty; }
+	virtual void DoStart() { MotionCommand::DoStart(); dirty=true; } //!< marks this as dirty each time it is added
 	//@}
 
 	//!Sets the PIDs to the defaults specified in RobotInfo
@@ -138,10 +139,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Motion/Path.h ./Motion/Path.h
--- ../Tekkotsu_2.2.1/Motion/Path.h	Thu Sep 25 11:27:23 2003
+++ ./Motion/Path.h	Thu Sep 25 11:27:23 2003
@@ -107,7 +107,7 @@
  * @endverbatim
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Motion/PostureEngine.cc ./Motion/PostureEngine.cc
--- ../Tekkotsu_2.2.1/Motion/PostureEngine.cc	Mon Nov 15 16:43:54 2004
+++ ./Motion/PostureEngine.cc	Wed Dec 22 19:59:03 2004
@@ -298,6 +298,7 @@
 	solveLinkPosition(Pobj,j,Plink);
 	//This method is an approximation, not entirely precise or fast as it could be
 	//Something to work on some more down the road! :)
+	//(this method is shared with HeadPointerMC::lookAtPoint(x,y,z))
 	NEWMAT::ColumnVector poE=baseToLink(j)*Pobj;
 	if(poE.nrows()>3 && poE(4)!=0) {
 		poE/=poE(4);
@@ -333,9 +334,9 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
diff -urdN ../Tekkotsu_2.2.1/Motion/PostureEngine.h ./Motion/PostureEngine.h
--- ../Tekkotsu_2.2.1/Motion/PostureEngine.h	Mon Oct 18 15:53:33 2004
+++ ./Motion/PostureEngine.h	Wed Dec 22 19:59:03 2004
@@ -67,10 +67,10 @@
 	
 	//! NOT VIRTUAL! You should be able to call this to set outputs without checking out, just a peekMotion().  Theoretically.
 	//!@name Output Accessors
-	inline PostureEngine& setOutputCmd(unsigned int i, const OutputCmd& c) { cmds[i]=c; return *this; } //!<sets output @a i to OutputCmd @a c, returns @c *this so you can chain them
-	inline OutputCmd& operator()(unsigned int i) { return cmds[i]; } //!< returns output @a i, returns a reference so you can also set "through" this call.
+	inline PostureEngine& setOutputCmd(unsigned int i, const OutputCmd& c) { cmds[i]=c; return *this; } //!<sets output @a i to OutputCmd @a c, returns @c *this so you can chain them; also remember that OutputCmd support implicit conversion from floats (so you can just pass a float)
+	inline OutputCmd& operator()(unsigned int i) { return cmds[i]; } //!< returns output @a i, returns a reference so you can also set through an assignment to this call, e.g. pose(MouthOffset)=.1; (remember that OutputCmd support implicit conversion from floats)
 	inline const OutputCmd& operator()(unsigned int i) const { return cmds[i]; } //!< returns output @a i
-	inline OutputCmd& getOutputCmd(unsigned int i) { return cmds[i]; } //!< returns output @a i, returns a reference so you can also set "through" this call.
+	inline OutputCmd& getOutputCmd(unsigned int i) { return cmds[i]; } //!< returns output @a i, returns a reference so you can also set through an assignment
 	inline const OutputCmd& getOutputCmd(unsigned int i) const { return cmds[i]; } //!< returns output @a i
 	//@}
 
@@ -83,17 +83,41 @@
 	virtual unsigned int SaveFile(const char filename[]) const;
 	//@}
 
-	//! Performs inverse kinematics to solve for positioning @a Plink on link @a j to @a Pobj in base coordinates (expects homogenous form); if solution found, stores result in this posture and returns true
-	bool solveLinkPosition(const NEWMAT::ColumnVector& Pobj, unsigned int j, const NEWMAT::ColumnVector& Plink);
-	//! Performs inverse kinematics to solve for positioning Plink on link @a j to Pobj in base coordinates; if solution found, stores result in this posture and returns true
-	bool solveLinkPosition(float Pobj_x, float Pobj_y, float Pobj_z, unsigned int j, float Plink_x, float Plink_y, float Plink_z)
-	{ return solveLinkPosition(pack(Pobj_x,Pobj_y,Pobj_z),j,pack(Plink_x,Plink_y,Plink_z)); }
+	//! Performs inverse kinematics to solve for positioning @a Peff on link @a j to @a Ptgt (expects homogenous form); if solution found, stores result in this posture and returns true
+	/*! @param Ptgt the target point, in base coordinates
+	 *  @param link the output offset of the joint to move
+	 *  @param Peff the point (relative to @a link) which you desire to have moved to @a Ptgt (it's the desired "effector") */
+	bool solveLinkPosition(const NEWMAT::ColumnVector& Ptgt, unsigned int link, const NEWMAT::ColumnVector& Peff);
 
-	//! Performs inverse kinematics to solve for positioning @a Plink on link @a j to @a Pobj in base coordinates (expects homogenous form); if solution found, stores result in this posture and returns true
-	bool solveLinkVector(const NEWMAT::ColumnVector& Pobj, unsigned int j, const NEWMAT::ColumnVector& Plink);
-	//! Performs inverse kinematics to solve for positioning Plink on link @a j to Pobj in base coordinates; if solution found, stores result in this posture and returns true
-	bool solveLinkVector(float Pobj_x, float Pobj_y, float Pobj_z, unsigned int j, float Plink_x, float Plink_y, float Plink_z)
-	{ return solveLinkVector(pack(Pobj_x,Pobj_y,Pobj_z),j,pack(Plink_x,Plink_y,Plink_z)); }
+	//! Performs inverse kinematics to solve for positioning Peff on link @a j to @a Ptgt; if solution found, stores result in this posture and returns true
+	/*! @param Ptgt_x the target x position (relative to base frame)
+	 *  @param Ptgt_y the target y position (relative to base frame)
+	 *  @param Ptgt_z the target z position (relative to base frame)
+	 *  @param link the output offset of the joint to move
+	 *  @param Peff_x the x position (relative to @a link) which you desire to have moved to @a Ptgt (it's the desired "effector")
+	 *  @param Peff_y the y position (relative to @a link) which you desire to have moved to @a Ptgt (it's the desired "effector")
+	 *  @param Peff_z the z position (relative to @a link) which you desire to have moved to @a Ptgt (it's the desired "effector") */
+	bool solveLinkPosition(float Ptgt_x, float Ptgt_y, float Ptgt_z, unsigned int link, float Peff_x, float Peff_y, float Peff_z)
+	{ return solveLinkPosition(pack(Ptgt_x,Ptgt_y,Ptgt_z),link,pack(Peff_x,Peff_y,Peff_z)); }
+
+	//! Performs inverse kinematics to solve for positioning Peff on link @a j to point at Ptgt (expects homogenous form); if solution found, stores result in this posture and returns true
+	/*! @param Ptgt the target point, in base coordinates
+	 *  @param link the output offset of the joint to move
+	 *  @param Peff the point (relative to @a link) which you desire to have moved to @a Ptgt (it's the desired "effector") */
+	bool solveLinkVector(const NEWMAT::ColumnVector& Ptgt, unsigned int link, const NEWMAT::ColumnVector& Peff);
+
+	//! Performs inverse kinematics to solve for positioning @a Peff on link @a j to point at @a Ptgt; if solution found, stores result in this posture and returns true
+	/*! @param Ptgt_x the target x position (relative to base frame)
+	 *  @param Ptgt_y the target y position (relative to base frame)
+	 *  @param Ptgt_z the target z position (relative to base frame)
+	 *  @param link the output offset of the joint to move
+	 *  @param Peff_x the x position (relative to @a link) which you desire to have moved to @a Ptgt (it's the desired "effector")
+	 *  @param Peff_y the y position (relative to @a link) which you desire to have moved to @a Ptgt (it's the desired "effector")
+	 *  @param Peff_z the z position (relative to @a link) which you desire to have moved to @a Ptgt (it's the desired "effector")
+	 *
+	 *  @todo this method is an approximation, could be more precise, and perhaps faster, although this is pretty good. */
+	bool solveLinkVector(float Ptgt_x, float Ptgt_y, float Ptgt_z, unsigned int link, float Peff_x, float Peff_y, float Peff_z)
+	{ return solveLinkVector(pack(Ptgt_x,Ptgt_y,Ptgt_z),link,pack(Peff_x,Peff_y,Peff_z)); }
 
 protected:
 	//all updates come from this posture engine's own state, not WorldState
@@ -109,10 +133,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Motion/PostureMC.h ./Motion/PostureMC.h
--- ../Tekkotsu_2.2.1/Motion/PostureMC.h	Mon Aug 30 16:26:45 2004
+++ ./Motion/PostureMC.h	Mon Dec 20 19:42:21 2004
@@ -34,7 +34,6 @@
 	 * These are also not virtual - otherwise you'd have to still check the motion out and it would make
 	 * this all pointless! @return @c *this */
 	PostureMC& setDirty(bool d=true) { dirty=d; return *this; } 
-	bool isDirty() const {return dirty;} //!< if you want to check the dirty flag
 	virtual PostureMC& setTolerance(float t) { tolerance=t; return *this; } //!< sets #tolerance, returns @c *this
 	virtual float getTolerance() { return tolerance; } //!< returns #tolerance
 	//@}
@@ -60,6 +59,7 @@
 		tmp.takeSnapshot(); 
 		return (maxdiff(tmp)>tolerance);
 	}
+	virtual void DoStart() { MotionCommand::DoStart(); dirty=true; } //!< marks this as dirty each time it is added
 	//@}
 
 	//!Had to override stuff to manage a dirty flag
@@ -92,10 +92,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Motion/RemoteControllerMC.h ./Motion/RemoteControllerMC.h
--- ../Tekkotsu_2.2.1/Motion/RemoteControllerMC.h	Wed Jan  7 17:52:26 2004
+++ ./Motion/RemoteControllerMC.h	Mon Dec 20 19:42:21 2004
@@ -27,8 +27,9 @@
     dirty=false;
     return tmp;
   }
-	virtual int              isDirty()                      { return (dirty && active)?1:0; } //!< true if a change has been made since the last updateJointCmds() and we're active
-	virtual int              isAlive()                      { return true; } //!< always true
+	virtual int   isDirty() { return (dirty && active)?1:0; } //!< true if a change has been made since the last updateJointCmds() and we're active
+	virtual int   isAlive() { return true; } //!< always true
+	virtual void  DoStart() { MotionCommand::DoStart(); dirty=true; } //!< marks this as dirty each time it is added
 	//@}
   
   void setDirty() { dirty=true; } //!< sets dirty flag to true
@@ -44,10 +45,10 @@
  * @author alokl (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Motion/Spline.h ./Motion/Spline.h
--- ../Tekkotsu_2.2.1/Motion/Spline.h	Thu Sep 25 11:27:23 2003
+++ ./Motion/Spline.h	Thu Sep 25 11:27:23 2003
@@ -375,7 +375,7 @@
  * @endverbatim
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Motion/TailWagMC.h ./Motion/TailWagMC.h
--- ../Tekkotsu_2.2.1/Motion/TailWagMC.h	Mon Nov 15 17:22:36 2004
+++ ./Motion/TailWagMC.h	Wed Dec 22 20:47:07 2004
@@ -13,6 +13,7 @@
  public:
 	//!constructor
 	TailWagMC() : period(500), magnitude(22*M_PI/180), active(true), tilt() { }
+	//!constructor
 	TailWagMC(unsigned int cyc_period, float cyc_magnitude) : period(cyc_period), magnitude(cyc_magnitude), active(true), tilt() { }
 	//!destructor
 	virtual ~TailWagMC() {}
@@ -60,10 +61,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Motion/WalkMC.cc ./Motion/WalkMC.cc
--- ../Tekkotsu_2.2.1/Motion/WalkMC.cc	Fri Jul 23 23:10:59 2004
+++ ./Motion/WalkMC.cc	Mon Dec 20 16:26:24 2004
@@ -59,13 +59,7 @@
 unsigned int checksum(const char *data,int num); //!< computes a file checksum
 
 WalkMC::WalkMC(const char* pfile/*=NULL*/)
-	// tss "SmoothWalk" modification follows
-	//	: MotionCommand(), isPaused(false), wp(), body_loc(), body_angle(),
-	//		pos_delta(0,0,0), angle_delta(0), travelTime(get_time()),
-	//		time(get_time()), TimeStep(FrameTime), vel_xya(0,0,0),
-	//		target_vel_xya(0,0,0)
-
-	: MotionCommand(), isPaused(false), wp(), cp(), body_loc(), body_angle(),
+	: MotionCommand(), isPaused(false), wp(), cp(), body_loc(), body_angle(), acc_style(DEFAULT_ACCEL), step_count(-1), last_cycle(0),
 				pos_delta(0,0,0), angle_delta(0), travelTime(get_time()),
 				time(get_time()), TimeStep(FrameTime), slowmo(1.0f),
 				CycleOffset(0), TimeOffset(0), NewCycleOffset(false),
@@ -131,12 +125,14 @@
 int WalkMC::isDirty()
 {
   if(isPaused)
-		return false;
+		return 0;
+	if(step_count==0)
+		return 0;
   if((target_vel_xya.x == 0) && (target_vel_xya.y == 0) && (target_vel_xya.z == 0)) {
 		// we may stopping, but not stopped yet...
 		return ((vel_xya.x != 0) || (vel_xya.y != 0) || (vel_xya.z != 0));
   }
-  return true;
+  return JointsPerLeg*NumLegs;
 }
 // tss "SmoothWalk" addition ends
 
@@ -251,7 +247,7 @@
 	return LoadSave::SaveFile(config->motion.makePath(filename).c_str());
 }
 
-void WalkMC::setTargetVelocity(double dx,double dy,double da)
+void WalkMC::setTargetVelocity(double dx,double dy,double da,int n)
 {
 #ifdef BOUND_MOTION
   da = bound(da, -cp.rotate_max_vel, cp.rotate_max_vel);
@@ -268,8 +264,21 @@
   target_vel_xya.set(dx,dy,da);
 	// we just modified the target velocity, but we'll hold off on generating
 	// an event until the changes are actually picked up by the motion system
+
+	step_count=n;
 }
 
+void WalkMC::setTargetDisplacement(double dx, double dy, double da, unsigned int n) {
+	if(n==0) {
+		setTargetVelocity(0,0,0,0);
+	} else {
+		double vx=dx/(n*wp.period/1000.0);
+		double vy=dy/(n*wp.period/1000.0);
+		double va=da/(n*wp.period/1000.0);
+		setTargetVelocity(vx,vy,va,n); //apply new value
+	}
+}
+	
 int WalkMC::updateOutputs() {
 	//	cout << "WalkMC,,," << flush;
 	if(!isDirty())
@@ -304,13 +313,15 @@
 		else
 			applyCalibration(cp.f_calibration,target_vel_xya,cal_target_vel_xya);
 
-  //software accel:
-	vel_xya.x = bound(cal_target_vel_xya.x, vel_xya.x-max_accel_xya.x*tm, vel_xya.x+max_accel_xya.x*tm);
-  vel_xya.y = bound(cal_target_vel_xya.y, vel_xya.y-max_accel_xya.y*tm, vel_xya.y+max_accel_xya.y*tm);
-  vel_xya.z = bound(cal_target_vel_xya.z, vel_xya.z-max_accel_xya.z*tm, vel_xya.z+max_accel_xya.z*tm);
-	//no software accel:
-	//vel_xya=cal_target_vel_xya;
-	//<end>
+	if(step_count<0 && (acc_style==CALIBRATION_ACCEL || acc_style==DEFAULT_ACCEL && !config->motion.inf_walk_accel)) {
+		//software accel:
+		vel_xya.x = bound(cal_target_vel_xya.x, vel_xya.x-max_accel_xya.x*tm, vel_xya.x+max_accel_xya.x*tm);
+		vel_xya.y = bound(cal_target_vel_xya.y, vel_xya.y-max_accel_xya.y*tm, vel_xya.y+max_accel_xya.y*tm);
+		vel_xya.z = bound(cal_target_vel_xya.z, vel_xya.z-max_accel_xya.z*tm, vel_xya.z+max_accel_xya.z*tm);
+	} else {
+		//no software accel:
+		vel_xya=cal_target_vel_xya;
+	}
 
   BodyPosition delta;
   delta.loc.set(vel_xya.x*tm,vel_xya.y*tm,0);
@@ -346,7 +357,36 @@
 
 // tss "SmoothWalk" modification follows
 		// double cycle = (double)(time % wp.period) / wp.period;
+		AdjustedTime = time + TimeOffset + (int)(frame*TimeStep*slowmo);
 		double cycle = (double)(AdjustedTime % wp.period) / wp.period;
+
+		if(step_count>0) {
+			float ncyc=cycle;
+			if(cycle<last_cycle)
+				ncyc+=1;
+			for(unsigned int i=0; i<NumLegs; i++){
+				float midstep = (wp.leg[i].down_time+wp.leg[i].lift_time)/2;
+				//cout << "leg "<<i<<": " <<AdjustedTime << ' ' << cycle << ' ' << last_cycle << ' ' << midstep << ' ' <<step_count ;
+				if(last_cycle<midstep && midstep<=ncyc) { //we just completed a step
+					step_count--;
+					//cout << " -> " << step_count << endl;
+					if(step_count==0) { //we're done, copy out any completed frames
+						for(unsigned int f=0; f<frame; f++)
+							for(unsigned int joint=LegOffset; joint<LegOffset+NumLegJoints; joint++)
+								motman->setOutput(this,joint,cmds[joint][f],f);
+						CycleOffset = AdjustedTime % wp.period;
+						NewCycleOffset = true;
+						last_cycle=cycle;
+						//		cout << "WalkMC-done" << endl;
+						return frame==0?0:NumLegs*JointsPerLeg;
+					}
+					break; //don't count legs moving in sync as two steps, only ever one step at a time
+				}
+				//cout << endl;
+			}
+		}
+		
+
 		double sway   = wp.sway*cos(2*M_PI*cycle);
 		double hop    = wp.hop*sin(4*M_PI*cycle);
 		double height = wp.body_height;
@@ -385,15 +425,19 @@
 					*/
 					tm = wp.period/1000.0 * 0.75; //wtf is the 0.75 based on?  Don't ask me, i just work here! (ejt)
 					vector3d vfp;
-					//software accel:
-					vfp.x = bound(cal_target_vel_xya.x, vel_xya.x-max_accel_xya.x*tm, vel_xya.x+max_accel_xya.x*tm);
-					vfp.y = bound(cal_target_vel_xya.y, vel_xya.y-max_accel_xya.y*tm, vel_xya.y+max_accel_xya.y*tm);
-					double vfa   = bound(cal_target_vel_xya.z, vel_xya.z-max_accel_xya.z*tm, vel_xya.z+max_accel_xya.z*tm);
-					//no software accel:
-					//vfp.x=cal_target_vel_xya.x;
-					//vfp.y=cal_target_vel_xya.y;
-					//double vfa=cal_target_vel_xya.z;
-					//<end>
+					double vfa;
+					if(step_count<0 && (acc_style==CALIBRATION_ACCEL || acc_style==DEFAULT_ACCEL && !config->motion.inf_walk_accel)) {
+						//software accel:
+						vfp.x = bound(cal_target_vel_xya.x, vel_xya.x-max_accel_xya.x*tm, vel_xya.x+max_accel_xya.x*tm);
+						vfp.y = bound(cal_target_vel_xya.y, vel_xya.y-max_accel_xya.y*tm, vel_xya.y+max_accel_xya.y*tm);
+						vfa   = bound(cal_target_vel_xya.z, vel_xya.z-max_accel_xya.z*tm, vel_xya.z+max_accel_xya.z*tm);
+					} else {
+						//no software accel:
+						vfp.x=cal_target_vel_xya.x;
+						vfp.y=cal_target_vel_xya.y;
+						vfa=cal_target_vel_xya.z;
+					}
+					
 					vfp.z = 0.0;
 					double b = (wp.period/1000.0) * (1.0 - air_f) / 2.0;
 					vector3d target;
@@ -454,7 +498,12 @@
 				else {
 					if(wp.useDiffDrive) {
 						tm = wp.period/1000.0 * 0.75; //wtf is the 0.75 based on?  Don't ask me, i just work here! (ejt)
-						double vfa   = bound(cal_target_vel_xya.z, vel_xya.z-max_accel_xya.z*tm, vel_xya.z+max_accel_xya.z*tm);
+						double vfa;
+						if(step_count<0 && (acc_style==CALIBRATION_ACCEL || acc_style==DEFAULT_ACCEL && !config->motion.inf_walk_accel)) {
+							vfa   = bound(cal_target_vel_xya.z, vel_xya.z-max_accel_xya.z*tm, vel_xya.z+max_accel_xya.z*tm);
+						} else {
+							vfa   = cal_target_vel_xya.z;
+						}
 						legpos[i] -= delta.loc*dir;
 						float rot = vfa/cp.max_vel[CalibrationParam::rotate]*TimeStep * slowmo / 1000;
 						if((i&1)==0)
@@ -469,10 +518,10 @@
 			GetLegAngles(nextlegangles,legpos[i],nextpos,i);
 			for(unsigned int j=0; j<JointsPerLeg; j++)
 				cmds[LegOffset+i*JointsPerLeg+j][frame].set(nextlegangles[j]);
+
 		}
 
-		// tss "SmoothWalk" modification follows
-		AdjustedTime = time+TimeOffset+(int)(frame*TimeStep*slowmo);
+		last_cycle=cycle;
 	}
 	
 	for(unsigned int joint=LegOffset; joint<LegOffset+NumLegJoints; joint++)
@@ -544,9 +593,9 @@
  * @verbinclude CMPack_license.txt
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
diff -urdN ../Tekkotsu_2.2.1/Motion/WalkMC.h ./Motion/WalkMC.h
--- ../Tekkotsu_2.2.1/Motion/WalkMC.h	Thu Aug  5 16:29:04 2004
+++ ./Motion/WalkMC.h	Wed Dec 22 20:47:07 2004
@@ -145,8 +145,13 @@
 	virtual	unsigned int LoadFile(const char* filename);
 	virtual unsigned int SaveFile(const char* filename) const;
 
-	//! set the direction to walk - can specify x (forward), y (left), and angular (counterclockwise) velocities
-	void setTargetVelocity(double dx,double dy,double da);
+	//! set the direction to walk
+	/*! @param dx forward velocity
+	 *  @param dy left velocity
+	 *  @param da counterclockwise velocity
+	 *  @param n steps to take (if unspecified or negative, walk forever)
+	 *  Using a non-negative step count disables software acceleration of velocities */
+	void setTargetVelocity(double dx,double dy,double da,int n=-1);
 	//! returns current velocity we're trying to go
 	const vector3d& getTargetVelocity() { return target_vel_xya; }
 	//! returns the velocity we're actually moving (subject to clipping at max_accel_xya), doesn't reflect value of getPaused()...
@@ -155,6 +160,20 @@
 	unsigned int getStartTravelTime() { return travelTime; }
 	//! returns the amount of time we've been traveling along the current vector
 	unsigned int getTravelTime() { return get_time()-getStartTravelTime(); }
+
+	//! recalculates the target velocity so steps are of a given length to achieve the specified displacement in @a n steps
+	/*! @param dx length of displacement in millimeters along body's x axis
+	 *  @param dy length of displacement in millimeters along body's y axis
+	 *  @param da amount to turn in radians, counter-clockwise viewed from above
+	 *  @param n number of steps to take
+	 *  #step_count will be set to @a n, so if the required velocity is
+	 *  beyond the abilities of the robot, it will stop on the @a n'th
+	 *  step, regardless of distance remaining.
+	 */
+	void setTargetDisplacement(double dx, double dy, double da, unsigned int n);
+
+	//! returns remaining steps (#step_count) (negative means infinite)
+	int getRemainingSteps() { return step_count; }
 	
 	void setPaused(bool p) { isPaused=p; } //!< if set to true, will stop moving
 	bool getPaused() const { return isPaused; } //!< if is true, we aren't moving
@@ -168,13 +187,23 @@
 	double getSway() { return wp.sway; } //!< gets WalkParam::sway of #wp
 	void setPeriod(long p) { wp.period=p; } //!< sets WalkParam::period of #wp
 	long getPeriod() { return wp.period; } //!< gets WalkParam::period of #wp
-	void setSlowMo(float p) { slowmo=p; } //!< sets slowmo
-	float* getSlowMo() { return &slowmo; } //!< gets slowmo
+	void setSlowMo(float p) { slowmo=p; } //!< sets #slowmo
+	float* getSlowMo() { return &slowmo; } //!< gets #slowmo
+
+	//!used to specify value for #acc_style
+	enum AccelerationStyle_t {
+		CALIBRATION_ACCEL, //!< use the acceleration specified by the calibration parameters
+		INF_ACCEL,         //!< ignore calibration acceleration (attempt infinite acceleration)
+		DEFAULT_ACCEL      //!< reference the value of Config::motion_config::walk_acceleration
+	};
+	virtual void setAccelerationStyle(AccelerationStyle_t acc) { acc_style=acc; } //!< sets #acc_style
+	virtual AccelerationStyle_t getAccelerationStyle() const { return acc_style; } //!< returns #acc_style
 
+	//! returns the current leg position of leg @a i
 	const vector3d& getLegPosition(LegOrder_t i) const { return legpos[i]; }
 
-	WalkParam & getWP() { return wp; }; //!< returns the current walk parameter structure
-	CalibrationParam & getCP() { return cp; }; //!< returns the current walk calibration parameter
+	WalkParam& getWP() { return wp; }; //!< returns the current walk parameter structure
+	CalibrationParam& getCP() { return cp; }; //!< returns the current walk calibration parameter
 	
 	//! takes current leg positions from WorldState and tries to match the point in the cycle most like it
 	void resetLegPos();
@@ -182,8 +211,7 @@
 	static const float MAX_DX; //!< ==180 mm/sec
 	static const float MAX_DY; //!< ==140 mm/sec
 	static const float MAX_DA; //!< ==1.8 rad/sec
-// tss "SmoothWalk" modification follows (actually only comment is changed)
-	// static const vector3d max_accel_xya; //!< vector version of MAX_DX,MAX_DY,MAX_DA
+
 	static const vector3d max_accel_xya; //!< maximum acceleration of x, y, and a velocity
 
  protected:
@@ -207,13 +235,19 @@
 	splinepath body_angle; //!< the path the body goes through while walking (?)
 	vector3d liftPos[NumLegs]; //!< position each of the feet was last lifted
 	vector3d downPos[NumLegs]; //!< position each of the feet is next going to be set down
+	
+	AccelerationStyle_t acc_style; //!< lets you switch between finite or infinite acceleration models
+
+	int step_count; //!< number of steps to take before stopping; if negative, walk forever.
+
+	double last_cycle; //!< where the walk is in it its cycle, updated at the end of each call to updateOutputs()
 
 	vector3d pos_delta; //!< how much we've moved
 	float angle_delta; //!< how much we've turned
 	
 	unsigned int travelTime; //!< the time of the last call to setTargetVelocity - handy to check the time we've been traveling current vector
-	int time; //!< time of last call to updateJointCmds() (scaled by slowmo)
-	int TimeStep; //!< time to pretend passes between each call to updateJointCmds() - usually RobotInfo::FrameTime
+	int time; //!< time of last call to updateOutputs() (scaled by slowmo)
+	int TimeStep; //!< time to pretend passes between each call to updateOutputs() - usually RobotInfo::FrameTime
 	float slowmo; //!< scales time values to make the walk move in slow motion for analysis (or fast forward)
 
 	// tss "SmoothWalk" addition follows
@@ -269,10 +303,10 @@
  * @verbinclude CMPack_license.txt
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Motion/WaypointEngine.h ./Motion/WaypointEngine.h
--- ../Tekkotsu_2.2.1/Motion/WaypointEngine.h	Tue Jul 27 10:33:59 2004
+++ ./Motion/WaypointEngine.h	Tue Jul 27 10:33:59 2004
@@ -750,7 +750,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Motion/WaypointWalkMC.h ./Motion/WaypointWalkMC.h
--- ../Tekkotsu_2.2.1/Motion/WaypointWalkMC.h	Tue Jul 27 10:33:59 2004
+++ ./Motion/WaypointWalkMC.h	Tue Jul 27 10:33:59 2004
@@ -50,7 +50,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Motion/gvector.h ./Motion/gvector.h
--- ../Tekkotsu_2.2.1/Motion/gvector.h	Thu Sep 25 11:27:23 2003
+++ ./Motion/gvector.h	Thu Sep 25 11:27:23 2003
@@ -677,7 +677,7 @@
  * @endverbatim
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Motion/roboop/config.h ./Motion/roboop/config.h
--- ../Tekkotsu_2.2.1/Motion/roboop/config.h	Wed Sep  1 15:51:04 2004
+++ ./Motion/roboop/config.h	Wed Dec 22 14:18:48 2004
@@ -51,7 +51,7 @@
 */
 
 //! @brief RCS/CVS version.
-static const char header_config_rcsid[] = "$Id: Tekkotsu_patch_2.2.1_to_2.2.2.diff,v 1.1 2004/12/23 08:41:24 ejt Exp $";
+static const char header_config_rcsid[] = "$Id: Tekkotsu_patch_2.2.1_to_2.2.2.diff,v 1.1 2004/12/23 08:41:24 ejt Exp $";
 
 
 #ifdef _MSC_VER                  // Microsoft
@@ -101,6 +101,44 @@
 typedef vector< Data > Conf_data;
 
 //! @brief Handle configuration files.
+/*! The file syntax used is:
+ *  - <tt>[</tt><i>section_name</i><tt>]</tt>
+ *  - one or more entries for that section:<br>
+ *    <i>field_name</i><tt>:</tt> <i>value</i>
+ *
+ *  White space is ignored, but a newline must follow each section or field entry
+ *
+ *  The minimal entries required to avoid warnings are (can be any order):
+ *  - <tt>[</tt><i>chain_name</i><tt>]</tt><br>
+ *    - <tt>Name: </tt> - a string identifier
+ *    - <tt>DH: </tt> - whether or not the chain specification is standard Denavitt-Hartenberg (non-zero), or modified Denavitt-Hartenberg (0)
+ *    - <tt>Fix: </tt> - ?
+ *    - <tt>MinPara: </tt> - ?
+ *    - <tt>dof: </tt> - number of links in the chain
+ *    - <tt>Motor: </tt> - ?
+ *    - <tt>Stl: </tt> - ?
+ *  - For each link <i>N</i>: 1..<i>dof</i><br>
+ *    <tt>[</tt><i>chain_name</i><tt>_LINK</tt><i>N</i><tt>]</tt>
+ *    - <tt>joint_type: </tt> - revolute (0), prismatic (1)
+ *    - <tt>theta: </tt> - DH theta parameter
+ *    - <tt>d: </tt> - DH d parameter
+ *    - <tt>a: </tt> - DH a parameter
+ *    - <tt>alpha: </tt> - DH alpha parameter
+ *    - <tt>theta_min: </tt> - minimum achievable joint position
+ *    - <tt>theta_max: </tt> - maximum achievable joint position
+ *    - <tt>m: </tt> - mass of link
+ *    - <tt>cx: </tt> - x position of center of gravity for link
+ *    - <tt>cy: </tt> - y position of center of gravity for link
+ *    - <tt>cz: </tt> - z position of center of gravity for link
+ *    - <tt>Ixx: </tt> - xx entry of inertia matrix
+ *    - <tt>Ixy: </tt> - xy entry of inertia matrix
+ *    - <tt>Ixz: </tt> - xz entry of inertia matrix
+ *    - <tt>Iyy: </tt> - yy entry of inertia matrix
+ *    - <tt>Iyz: </tt> - yz entry of inertia matrix
+ *    - <tt>Izz: </tt> - zz entry of inertia matrix
+ *
+ *  Additional entries may be defined, but will be silently ignored.
+ */
 class Config {
 public:
    Config() : conf(), filename() {}
diff -urdN ../Tekkotsu_2.2.1/Motion/roboop/kinemat.cpp ./Motion/roboop/kinemat.cpp
--- ../Tekkotsu_2.2.1/Motion/roboop/kinemat.cpp	Mon Oct 11 18:01:28 2004
+++ ./Motion/roboop/kinemat.cpp	Tue Dec 21 18:51:22 2004
@@ -87,7 +87,7 @@
 */
 
 //! @brief RCS/CVS version.
-static const char rcsid[] = "$Id: Tekkotsu_patch_2.2.1_to_2.2.2.diff,v 1.1 2004/12/23 08:41:24 ejt Exp $";
+static const char rcsid[] = "$Id: Tekkotsu_patch_2.2.1_to_2.2.2.diff,v 1.1 2004/12/23 08:41:24 ejt Exp $";
 
 #include "robot.h"
 
@@ -269,7 +269,7 @@
    return pack4x4(R,p);
 }
 
-/*! @brief converts vector(s) on link @a cur to be vector(s) on link @a dest
+/*! @brief converts vector(s) on link @a cur to be vector(s) in joint reference frame @a dest
  *  @param[out] R on return contains rotation matrix between @a cur and @a dest
  *  @param[out] p on return contains vector from @a cur to @a dest
  *  @param[in] cur the link vectors of @a A are currently relative to
@@ -297,7 +297,7 @@
    }
 }
 
-/*! @brief Returns a matrix which can be used to convert from link @a cur to frame @a dest
+/*! @brief Returns a matrix which can be used to convert from link frame @a cur to joint frame @a dest
  *  @param cur the source link
  *  @param dest the target frame
  *
@@ -315,7 +315,7 @@
    return pack4x4(R,p);
 }
 
-/*! @brief converts vector(s) on link @a cur to be vector(s) on link @a dest
+/*! @brief converts vector(s) in joint referenc frame @a cur to be vector(s) on link @a dest
  *  @param[out] R on return contains rotation matrix between @a cur and @a dest
  *  @param[out] p on return contains vector from @a cur to @a dest
  *  @param[in] cur the link vectors of @a A are currently relative to
@@ -344,7 +344,7 @@
    }
 }
 
-/*! @brief Returns a matrix which can be used to convert from link @a cur to link @a dest
+/*! @brief Returns a matrix which can be used to convert from joint reference frame @a cur to link frame @a dest
  *  @param cur the source link
  *  @param dest the target link
  *
diff -urdN ../Tekkotsu_2.2.1/Motion/roboop/robot.cpp ./Motion/roboop/robot.cpp
--- ../Tekkotsu_2.2.1/Motion/roboop/robot.cpp	Tue Oct 12 15:50:25 2004
+++ ./Motion/roboop/robot.cpp	Fri Dec 10 18:49:35 2004
@@ -92,7 +92,7 @@
 */
 
 //! @brief RCS/CVS version.
-static const char rcsid[] = "$Id: Tekkotsu_patch_2.2.1_to_2.2.2.diff,v 1.1 2004/12/23 08:41:24 ejt Exp $";
+static const char rcsid[] = "$Id: Tekkotsu_patch_2.2.1_to_2.2.2.diff,v 1.1 2004/12/23 08:41:24 ejt Exp $";
 
 #include "robot.h"
 #include <time.h>
@@ -850,8 +850,8 @@
 
    if(!robData.select_int(robotName, "dof", dof))
    {
-      if(dof < 1)
-         error("Robot_basic::Robot_basic: dof is less then one.");
+      if(dof < 0)
+         error("Robot_basic::Robot_basic: dof is less then zero.");
    }
    else
       error("Robot_basic::Robot_basic: error in extracting dof from conf file.");
diff -urdN ../Tekkotsu_2.2.1/RemoteProcess/RemoteProcess.cc ./RemoteProcess/RemoteProcess.cc
--- ../Tekkotsu_2.2.1/RemoteProcess/RemoteProcess.cc	Thu Sep 25 11:27:50 2003
+++ ./RemoteProcess/RemoteProcess.cc	Thu Sep 25 11:27:50 2003
@@ -89,7 +89,7 @@
  * @author alokl (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/RemoteProcess/RemoteProcess.h ./RemoteProcess/RemoteProcess.h
--- ../Tekkotsu_2.2.1/RemoteProcess/RemoteProcess.h	Thu Sep 25 11:27:50 2003
+++ ./RemoteProcess/RemoteProcess.h	Thu Sep 25 11:27:50 2003
@@ -54,7 +54,7 @@
  * @author alokl (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Shared/Buffer.cc ./Shared/Buffer.cc
--- ../Tekkotsu_2.2.1/Shared/Buffer.cc	Fri Nov 12 17:07:39 2004
+++ ./Shared/Buffer.cc	Wed Dec 22 20:47:07 2004
@@ -105,3 +105,15 @@
 		return true;
 	}
 }
+
+/*! @file
+ * @brief Describes Buffer, a general memory management data structure, featuring position, limit, and capacity marks
+ * @author Alexander Klyubin (A.Kljubin AT herts ac uk) (Creator)
+ * Submitted as part of "Full-duplex Audio Streaming" patch
+ *
+ * $Author: ejt $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
+ * $State: Exp $
+ * $Date: 2004/12/23 08:41:24 $
+ */
diff -urdN ../Tekkotsu_2.2.1/Shared/Buffer.h ./Shared/Buffer.h
--- ../Tekkotsu_2.2.1/Shared/Buffer.h	Fri Nov 12 17:07:39 2004
+++ ./Shared/Buffer.h	Wed Dec 22 20:47:07 2004
@@ -45,11 +45,26 @@
 		//! Checks whether the buffer is full, that is position == limit.
 		bool IsFull() const { return (position >= limit); }
 	private:
-		char* data;
-		int capacity;
-		int limit;
-		int position;
+		char* data;   //!< the buffer itself
+		int capacity; //!< the the real size of the underlying array.
+		int limit; //!< Position is the index of the current element in the buffer (used only by buffer filling operations at the moment)
+		int position; //!< Limit is the virtual size of the buffer. Operations such as filling up the buffer, seeking and so on never go over the limit mark of the buffer. 
 		
+		//! returns the lesser of @a or @b
 		static int min(int a, int b) { return ((a < b) ? a : b); }
 };
+
+
+/*! @file
+ * @brief Describes Buffer, a general memory management data structure, featuring position, limit, and capacity marks
+ * @author Alexander Klyubin (A.Kljubin AT herts ac uk) (Creator)
+ * Submitted as part of "Full-duplex Audio Streaming" patch
+ *
+ * $Author: ejt $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
+ * $State: Exp $
+ * $Date: 2004/12/23 08:41:24 $
+ */
+
 #endif
diff -urdN ../Tekkotsu_2.2.1/Shared/CommonInfo.h ./Shared/CommonInfo.h
--- ../Tekkotsu_2.2.1/Shared/CommonInfo.h	Tue Dec 23 01:33:43 2003
+++ ./Shared/CommonInfo.h	Tue Dec 23 01:33:43 2003
@@ -34,7 +34,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Shared/Config.cc ./Shared/Config.cc
--- ../Tekkotsu_2.2.1/Shared/Config.cc	Fri Nov 12 17:07:39 2004
+++ ./Shared/Config.cc	Mon Dec 20 16:27:11 2004
@@ -312,6 +312,9 @@
       } else if (strncasecmp(key,"max_head_roll_speed",29)==0) {
 				motion.max_head_roll_speed=atof(value);
 				return &motion.max_head_roll_speed;
+      } else if (strncasecmp(key,"inf_walk_accel",29)==0) {
+        motion.inf_walk_accel = atoi(value);
+        return &motion.inf_walk_accel;
       } else if (strncasecmp(key,"console_port",29)==0) {
         motion.console_port = atoi(value);
         return &motion.console_port;
@@ -530,9 +533,9 @@
  * @author alokl (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
diff -urdN ../Tekkotsu_2.2.1/Shared/Config.h ./Shared/Config.h
--- ../Tekkotsu_2.2.1/Shared/Config.h	Fri Nov 12 17:07:39 2004
+++ ./Shared/Config.h	Wed Dec 22 20:47:07 2004
@@ -92,6 +92,18 @@
 			r_z=1;
 		}
       
+		//!provides a pixel hit in image by a ray going through the camera frame
+		/*! Hopefully we'll eventually upgrade this to account for lens distortion
+		 *  @param[in] r_x x value of the ray
+		 *  @param[in] r_y y value of the ray
+		 *  @param[in] r_z z value of the ray
+		 *  @param[out] x x position in range [-1,1]
+		 *  @param[out] y y position in range [-1,1] */
+		void computePixel(float r_x, float r_y, float r_z, float& x, float& y) {
+			x=r_x/(r_z*tan(horizFOV/2));
+			y=r_y/(r_z*tan(vertFOV/2));
+		}
+      
 		//!constructor
 		vision_config() : white_balance(3), gain(2), shutter_speed(2), resolution(2), horizFOV(0), vertFOV(0), focal_length(0), thresh(), colors(), rawcam_port(0), rawcam_transport(0), rle_port(0), rle_transport(0), obj_port(0), restore_image(true), jpeg_dct_method(JDCT_IFAST), rawcam_encoding(ENCODE_COLOR), rawcam_channel(0), rawcam_compression(COMPRESS_NONE), rawcam_compress_quality(75), rawcam_y_skip(0), rawcam_uv_skip(0), rlecam_skip(1), rlecam_channel(0), rlecam_compression(COMPRESS_RLE) {}
 	} vision;
@@ -153,6 +165,7 @@
 		float max_head_tilt_speed; //!< max speed for the head joints, used by HeadPointerMC; rad/s
 		float max_head_pan_speed; //!< max speed for the head joints, used by HeadPointerMC; rad/s
 		float max_head_roll_speed; //!< max speed for the head joints, used by HeadPointerMC; rad/s
+		bool inf_walk_accel; //!< if true, walks should attempt to switch directions immediately; otherwise they should do some kind of software acceleration to more smoothly switch direction
 		int console_port;  //!< port to send/receive "console" information on (separate from system console)
 		int stderr_port;   //!< port to send error information to
 
@@ -169,7 +182,7 @@
 		//!constructor
 		motion_config()
 			: root(), walk(), kinematics(), kinematic_chains(), max_head_tilt_speed(0),
-				max_head_pan_speed(0), max_head_roll_speed(0), console_port(0), stderr_port(0)
+				max_head_pan_speed(0), max_head_roll_speed(0), inf_walk_accel(false), console_port(0), stderr_port(0)
 		{
 			estop_on_snd[0]=estop_off_snd[0]='\0';
 			for(unsigned int i=0; i<NumPIDJoints; i++)
@@ -203,9 +216,10 @@
 			bool mic_stereo; //!< whether to stream stereo or mono from the microphone
       
 			unsigned int speaker_port;    //!< port for streaming speaker samples
-			unsigned int speaker_frame_length; //<! length of frame sent to the speaker (ms)
-			unsigned int speaker_max_delay; //<! maximum delay (ms) during playback
+			unsigned int speaker_frame_length; //!< length of frame sent to the speaker (ms)
+			unsigned int speaker_max_delay; //!< maximum delay (ms) during playback
 
+			//! constructor
 			streaming_config() : mic_port(0), mic_sample_rate(16000),
 			mic_sample_bits(16), mic_stereo(true),
 			speaker_port(0), speaker_frame_length(64),
@@ -240,10 +254,10 @@
  * @author alokl (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Shared/ERS210Info.h ./Shared/ERS210Info.h
--- ../Tekkotsu_2.2.1/Shared/ERS210Info.h	Thu Sep 16 14:35:12 2004
+++ ./Shared/ERS210Info.h	Thu Sep 16 14:35:12 2004
@@ -469,7 +469,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Shared/ERS220Info.h ./Shared/ERS220Info.h
--- ../Tekkotsu_2.2.1/Shared/ERS220Info.h	Fri Sep 17 14:29:54 2004
+++ ./Shared/ERS220Info.h	Fri Sep 17 14:29:54 2004
@@ -573,7 +573,7 @@
  * @author Daishi MORI (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Shared/ERS2xxInfo.h ./Shared/ERS2xxInfo.h
--- ../Tekkotsu_2.2.1/Shared/ERS2xxInfo.h	Tue Aug 31 15:48:41 2004
+++ ./Shared/ERS2xxInfo.h	Tue Aug 31 15:48:41 2004
@@ -610,7 +610,7 @@
  * @author Daishi MORI (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Shared/ERS7Info.h ./Shared/ERS7Info.h
--- ../Tekkotsu_2.2.1/Shared/ERS7Info.h	Tue Oct 19 03:37:09 2004
+++ ./Shared/ERS7Info.h	Mon Dec  6 19:46:24 2004
@@ -189,6 +189,7 @@
 		HeadFrButOffset=HeadButOffset,
 		FrontBackButOffset,
 		MiddleBackButOffset,
+		BackButOffset = MiddleBackButOffset,
 		RearBackButOffset,
 		WirelessSwOffset
 	};
@@ -516,11 +517,11 @@
  * @brief Defines RobotInfo namespace for ERS-210 models, gives some information about the robot's capabilities, such as joint counts, offsets, names and PID values
  * @author ejt (Creator)
  *
- * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Author: ejt $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Shared/Factory.h ./Shared/Factory.h
--- ../Tekkotsu_2.2.1/Shared/Factory.h	Thu Oct 30 18:24:20 2003
+++ ./Shared/Factory.h	Thu Oct 30 18:24:20 2003
@@ -47,7 +47,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Shared/ListMemBuf.h ./Shared/ListMemBuf.h
--- ../Tekkotsu_2.2.1/Shared/ListMemBuf.h	Thu Sep 25 11:31:53 2003
+++ ./Shared/ListMemBuf.h	Tue Dec 21 15:29:14 2004
@@ -29,7 +29,7 @@
 	//!Allows outside access to index type
 	typedef idx_t index_t;
 	
-	index_t getMaxCapacity() const { return MAX_ENTRIES; } //!<returns the maximum number of objects which can be used at any given time
+	static index_t getMaxCapacity() { return MAX_ENTRIES; } //!<returns the maximum number of objects which can be used at any given time
 	index_t size() const { return cursize; } //!<returns the current number of objects in use
 	index_t countf() const; //!< for debugging, should equal size
 	index_t countb() const; //!< for debugging, should equal size
@@ -334,10 +334,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
- * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
+ * $State: Exp $
+ * $Date: 2004/12/23 08:41:24 $
  */
  
  #endif
diff -urdN ../Tekkotsu_2.2.1/Shared/LoadSave.cc ./Shared/LoadSave.cc
--- ../Tekkotsu_2.2.1/Shared/LoadSave.cc	Thu Mar 25 12:07:44 2004
+++ ./Shared/LoadSave.cc	Thu Mar 25 12:07:44 2004
@@ -161,7 +161,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Shared/LoadSave.h ./Shared/LoadSave.h
--- ../Tekkotsu_2.2.1/Shared/LoadSave.h	Thu Apr  8 12:28:06 2004
+++ ./Shared/LoadSave.h	Thu Apr  8 12:28:06 2004
@@ -349,7 +349,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Shared/LockScope.h ./Shared/LockScope.h
--- ../Tekkotsu_2.2.1/Shared/LockScope.h	Thu Sep 25 11:31:53 2003
+++ ./Shared/LockScope.h	Thu Sep 25 11:31:53 2003
@@ -22,7 +22,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Shared/MutexLock.h ./Shared/MutexLock.h
--- ../Tekkotsu_2.2.1/Shared/MutexLock.h	Thu Feb 12 12:48:59 2004
+++ ./Shared/MutexLock.h	Thu Feb 12 12:48:59 2004
@@ -260,7 +260,7 @@
  * @author ejt (Creator), Edward A. Lycklama, Vassos Hadzilacos (paper from which this was based)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Shared/ProcessID.cc ./Shared/ProcessID.cc
--- ../Tekkotsu_2.2.1/Shared/ProcessID.cc	Thu Sep 25 11:31:53 2003
+++ ./Shared/ProcessID.cc	Thu Sep 25 11:31:53 2003
@@ -7,7 +7,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Shared/ProcessID.h ./Shared/ProcessID.h
--- ../Tekkotsu_2.2.1/Shared/ProcessID.h	Thu Sep 25 11:31:53 2003
+++ ./Shared/ProcessID.h	Thu Sep 25 11:31:53 2003
@@ -27,7 +27,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Shared/Profiler.cc ./Shared/Profiler.cc
--- ../Tekkotsu_2.2.1/Shared/Profiler.cc	Thu Mar 25 12:08:57 2004
+++ ./Shared/Profiler.cc	Thu Mar 25 12:08:57 2004
@@ -163,7 +163,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Shared/Profiler.h ./Shared/Profiler.h
--- ../Tekkotsu_2.2.1/Shared/Profiler.h	Wed Feb  4 18:06:47 2004
+++ ./Shared/Profiler.h	Wed Feb  4 18:06:47 2004
@@ -204,7 +204,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Shared/ProjectInterface.cc ./Shared/ProjectInterface.cc
--- ../Tekkotsu_2.2.1/Shared/ProjectInterface.cc	Fri Jul 16 15:25:09 2004
+++ ./Shared/ProjectInterface.cc	Fri Jul 16 15:25:09 2004
@@ -38,7 +38,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Shared/ProjectInterface.h ./Shared/ProjectInterface.h
--- ../Tekkotsu_2.2.1/Shared/ProjectInterface.h	Fri Jul 16 15:25:10 2004
+++ ./Shared/ProjectInterface.h	Wed Dec 22 20:47:07 2004
@@ -2,6 +2,10 @@
 #ifndef INCLUDED_ProjectInterface_h_
 #define INCLUDED_ProjectInterface_h_
 
+class BehaviorBase;
+class FilterBankGenerator;
+class SegmentedColorGenerator;
+
 //! A collection of the global variables which should be set by a project to use the Tekkotsu framework
 /*! You don't necessarily need to define all of these, but if you want
  *  to use the built in demo behaviors, you may need to set some
@@ -18,11 +22,6 @@
  *  set to NULL and you'll get errors if you leave them out) and all
  *  optional settings are pointers so you can ignore them if you want.
  */
-
-class BehaviorBase;
-class FilterBankGenerator;
-class SegmentedColorGenerator;
-
 namespace ProjectInterface {
 	
 	//! REQUIRED: you must define a behavior which will be started when the boot is complete
@@ -74,10 +73,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Shared/ReferenceCounter.h ./Shared/ReferenceCounter.h
--- ../Tekkotsu_2.2.1/Shared/ReferenceCounter.h	Thu Nov 11 15:35:00 2004
+++ ./Shared/ReferenceCounter.h	Thu Nov 11 15:35:00 2004
@@ -73,7 +73,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Shared/RobotInfo.h ./Shared/RobotInfo.h
--- ../Tekkotsu_2.2.1/Shared/RobotInfo.h	Mon Feb  9 17:45:28 2004
+++ ./Shared/RobotInfo.h	Mon Feb  9 17:45:28 2004
@@ -41,7 +41,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Shared/SharedObject.h ./Shared/SharedObject.h
--- ../Tekkotsu_2.2.1/Shared/SharedObject.h	Fri Sep 12 19:42:12 2003
+++ ./Shared/SharedObject.h	Fri Sep 12 19:42:12 2003
@@ -116,7 +116,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Shared/SharedQueue.h ./Shared/SharedQueue.h
--- ../Tekkotsu_2.2.1/Shared/SharedQueue.h	Sun Jan 18 05:16:58 2004
+++ ./Shared/SharedQueue.h	Sun Jan 18 05:16:58 2004
@@ -134,7 +134,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Shared/SystemUtility.h ./Shared/SystemUtility.h
--- ../Tekkotsu_2.2.1/Shared/SystemUtility.h	Fri Oct 10 13:46:04 2003
+++ ./Shared/SystemUtility.h	Fri Oct 10 13:46:04 2003
@@ -60,7 +60,7 @@
  * @verbinclude CMPack_license.txt
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Shared/TimeET.cc ./Shared/TimeET.cc
--- ../Tekkotsu_2.2.1/Shared/TimeET.cc	Thu Sep 25 11:31:53 2003
+++ ./Shared/TimeET.cc	Thu Sep 25 11:31:53 2003
@@ -7,7 +7,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Shared/TimeET.h ./Shared/TimeET.h
--- ../Tekkotsu_2.2.1/Shared/TimeET.h	Thu Mar 25 12:09:18 2004
+++ ./Shared/TimeET.h	Thu Mar 25 12:09:18 2004
@@ -148,7 +148,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Shared/Util.h ./Shared/Util.h
--- ../Tekkotsu_2.2.1/Shared/Util.h	Thu Sep 25 11:31:53 2003
+++ ./Shared/Util.h	Thu Sep 25 11:31:53 2003
@@ -300,7 +300,7 @@
  * @endverbatim
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Shared/WMclass.h ./Shared/WMclass.h
--- ../Tekkotsu_2.2.1/Shared/WMclass.h	Fri Oct 10 13:46:04 2003
+++ ./Shared/WMclass.h	Fri Oct 10 13:46:04 2003
@@ -14,7 +14,7 @@
  *  @author alokl (Ported)
  *  
  *  $Author: ejt $
- *  $Name: HEAD $
+ *  $Name: HEAD $
  *  $Revision: 1.1 $
  *  $State: Exp $
  *  $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Shared/WorldState.cc ./Shared/WorldState.cc
--- ../Tekkotsu_2.2.1/Shared/WorldState.cc	Thu Nov  4 14:45:17 2004
+++ ./Shared/WorldState.cc	Wed Dec 22 18:13:02 2004
@@ -60,24 +60,25 @@
 		else if(strcmp(robotDesignStr,"ERS-7")==0)
 			robotDesign=ERS7Mask;
 		else {
-			cout << "ERROR: Unrecognized model: "<<robotDesignStr<<"\nTrying ERS-210..."<<endl;
-			robotDesign=ERS210Mask;
+			cout << "ERROR: Unrecognized model: "<<robotDesignStr<<"\nDoing the best I can by assuming ERS-7..."<<endl;
+			robotDesign=ERS7Mask;
 		}
 	}
 #else
+	//This is only compiled if we're targeting the local platform
+	//In other words, if target model is an AIBO, simulation mode
 # if TGT_ERS220
 	robotDesign=ERS220Mask;
 # elif TGT_ERS210
 	robotDesign=ERS210Mask;
-# elif TGT_ERS7
-	robotDesign=ERS7Mask;
-# else //default case, ERS2xx
-#	 if TGT_ERS2xx==0
-#		warning "TGT_<model> undefined - defaulting to TGT_ERS210"
-#  else
+# elif TGT_ERS2xx
 #   warning "TGT_ERS2xx can't be determined on non-Aperios - defaulting to TGT_ERS210"
-#	 endif
 	robotDesign=ERS210Mask;
+# elif TGT_ERS7
+	robotDesign=ERS7Mask;
+# else
+#		warning "TGT_<model> undefined - defaulting to TGT_ERS7"
+	robotDesign=ERS7Mask;
 # endif //model selection
 #endif
 }
@@ -306,7 +307,7 @@
 	for(unsigned int i=0; i<evtBuf.size(); i++)
 		er->postEvent(evtBuf[i]);
 	//we don't delete the events in evtBuf - we're handing them off to erouter, which will delete them itself
-	er->postEvent(EventBase::sensorEGID,SensorSourceID::UpdatedSID,EventBase::statusETID,dif);
+	er->postEvent(EventBase::sensorEGID,SensorSourceID::UpdatedSID,EventBase::statusETID,dif,"SensorSouceID::UpdatedSID",1);
 }
 
 /*! This will cause events to be posted */
@@ -379,7 +380,7 @@
 		powerFlags[i]=actmasks[i];
 	}
 
-	er->postEvent(EventBase::powerEGID,PowerSourceID::UpdatedSID,EventBase::statusETID,0);
+	er->postEvent(EventBase::powerEGID,PowerSourceID::UpdatedSID,EventBase::statusETID,0,"PowerSourceID::UpdatedSID",1);
 }
 
 #endif //PLATFORM_APERIOS
@@ -409,8 +410,8 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
diff -urdN ../Tekkotsu_2.2.1/Shared/WorldState.h ./Shared/WorldState.h
--- ../Tekkotsu_2.2.1/Shared/WorldState.h	Tue Jul 27 10:36:50 2004
+++ ./Shared/WorldState.h	Tue Jul 27 10:36:50 2004
@@ -214,7 +214,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Shared/debuget.h ./Shared/debuget.h
--- ../Tekkotsu_2.2.1/Shared/debuget.h	Thu Sep 25 11:31:53 2003
+++ ./Shared/debuget.h	Thu Sep 25 11:31:53 2003
@@ -73,7 +73,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Shared/get_time.cc ./Shared/get_time.cc
--- ../Tekkotsu_2.2.1/Shared/get_time.cc	Fri Jul 25 16:18:07 2003
+++ ./Shared/get_time.cc	Fri Jul 25 16:18:07 2003
@@ -19,7 +19,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Shared/get_time.h ./Shared/get_time.h
--- ../Tekkotsu_2.2.1/Shared/get_time.h	Fri Jul 25 16:18:08 2003
+++ ./Shared/get_time.h	Fri Jul 25 16:18:08 2003
@@ -9,7 +9,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Shared/newmat/newmat9.cpp ./Shared/newmat/newmat9.cpp
--- ../Tekkotsu_2.2.1/Shared/newmat/newmat9.cpp	Wed Jun 16 17:16:41 2004
+++ ./Shared/newmat/newmat9.cpp	Thu Dec 16 19:32:36 2004
@@ -37,7 +37,7 @@
 
 ostream& operator<<(ostream& s, const GeneralMatrix& X)
 {
-   MatrixRow mr((GeneralMatrix*)&X, LoadOnEntry);
+   MatrixRow mr(const_cast<GeneralMatrix*>(&X), LoadOnEntry);
    int w = s.width();  int nr = X.Nrows();  ios_format_flags f = s.flags();
    s.setf(ios::fixed, ios::floatfield);
    for (int i=1; i<=nr; i++)
@@ -51,6 +51,22 @@
    }
    s << flush;  s.flags(f); return s;
 }
+
+ostream& operator<<(ostream& s, const printmat& p) {
+  const int printwidth = s.width();
+  s.width(0);
+  s << "[";
+  for (int i = 1; i <= p.mat.Nrows(); i++) {
+    if (i > 1) s << "; ";
+    for (int j = 1; j <= p.mat.Ncols(); j++) {
+      if ( j > 1 ) s << ", ";
+      s << setw(printwidth) << p.mat(i,j);
+    }
+  }
+  s << "]";
+  return s;
+}
+
 
 // include this stuff if you are using an old version of G++
 // with an incomplete io library
diff -urdN ../Tekkotsu_2.2.1/Shared/newmat/newmatio.h ./Shared/newmat/newmatio.h
--- ../Tekkotsu_2.2.1/Shared/newmat/newmatio.h	Wed Jun 16 17:16:41 2004
+++ ./Shared/newmat/newmatio.h	Tue Dec 14 22:56:28 2004
@@ -23,6 +23,17 @@
 
 ostream& operator<<(ostream&, const GeneralMatrix&);
 
+/**************************** Matlab-code printer *****************************/
+
+class printmat {
+ public:
+  const Matrix &mat;
+  printmat(const Matrix &m) : mat(m) {}
+};
+
+ostream& operator<<(ostream&, const printmat&);
+
+/**************************** Old stuff *****************************/
 
 /*  Use in some old versions of G++ without complete iomanipulators
 
diff -urdN ../Tekkotsu_2.2.1/Shared/string_util.cc ./Shared/string_util.cc
--- ../Tekkotsu_2.2.1/Shared/string_util.cc	Wed Jan 14 15:45:28 2004
+++ ./Shared/string_util.cc	Wed Jan 14 15:45:28 2004
@@ -89,7 +89,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Shared/string_util.h ./Shared/string_util.h
--- ../Tekkotsu_2.2.1/Shared/string_util.h	Wed Jan 14 15:45:28 2004
+++ ./Shared/string_util.h	Wed Dec 22 20:47:07 2004
@@ -5,6 +5,7 @@
 #include <string>
 #include <vector>
 
+//! some common string processing functions, for std::string
 namespace string_util {
 	//! returns lower case version of @a s
 	std::string makeLower(const std::string& s);
@@ -24,10 +25,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/SoundPlay/SoundManager.cc ./SoundPlay/SoundManager.cc
--- ../Tekkotsu_2.2.1/SoundPlay/SoundManager.cc	Thu Nov  4 00:24:03 2004
+++ ./SoundPlay/SoundManager.cc	Wed Dec 22 18:13:04 2004
@@ -197,8 +197,13 @@
 		}
 		//		}
 		
-		if(sndlist[id].rcr!=NULL)
-			erouter->postEvent(EventBase::audioEGID,playid,EventBase::activateETID,0);
+		if(sndlist[id].rcr!=NULL) {
+			const char * name=sndlist[playlist[playid].snd_id].name;
+			if(name[0]!='\0')
+				erouter->postEvent(EventBase::audioEGID,playid,EventBase::activateETID,0,name,1);
+			else
+				erouter->postEvent(EventBase::audioEGID,playid,EventBase::activateETID,0);
+		}
 	}
 	return playid;
 }
@@ -273,12 +278,16 @@
 	//we start at the back (oldest) since these are the most likely to be removed...
 	for(chanlist_t::index_t it=chanlist.prev(chanlist.end()); it!=chanlist.end(); it=chanlist.prev(it))
 		if(chanlist[it]==id) {
+			std::string name=sndlist[playlist[id].snd_id].name;
 			Release(playlist[id].snd_id);
 			playlist.erase(id);
 			chanlist.erase(it);
 			playlist[id].cumulative+=playlist[id].offset;
 			unsigned int ms=playlist[id].cumulative/(config->sound.sample_bits/8)/(config->sound.sample_rate/1000);
-			erouter->postEvent(EventBase::audioEGID,id,EventBase::deactivateETID,ms);
+			if(name.size()>0)
+				erouter->postEvent(EventBase::audioEGID,id,EventBase::deactivateETID,ms,name,0);
+			else
+				erouter->postEvent(EventBase::audioEGID,id,EventBase::deactivateETID,ms);
 			return;
 		}
 	cout << "SoundManager::StopPlay(): " << id << " does not seem to be playing" << endl;
@@ -510,9 +519,14 @@
 			sndlist[msg->id].data=reinterpret_cast<byte*>(rcr->Base()+SoundManagerMsg::MSG_SIZE);
 			//look to see if there's any play's for the sound we just finished loading
 			for(playlist_t::index_t it=playlist.begin();it!=playlist.end();it=playlist.next(it))
-				if(playlist[it].snd_id==msg->id)
+				if(playlist[it].snd_id==msg->id) {
 					//send an event if there are
-					erouter->postEvent(EventBase::audioEGID,it,EventBase::activateETID,0);
+					const char * name=sndlist[playlist[it].snd_id].name;
+					if(name[0]!='\0')
+						erouter->postEvent(EventBase::audioEGID,it,EventBase::activateETID,0,name,1);
+					else
+						erouter->postEvent(EventBase::audioEGID,it,EventBase::activateETID,0);
+				}
 		} break;
 		case SoundManagerMsg::del: {
 			msg->region->RemoveReference();
@@ -655,7 +669,11 @@
 		playlist[id].next_id=playlist[next].next_id;
 		playlist.erase(next);
 		unsigned int ms=playlist[id].cumulative/(config->sound.sample_bits/8)/(config->sound.sample_rate/1000);
-		erouter->postEvent(EventBase::audioEGID,id,EventBase::statusETID,ms);
+		const char * name=sndlist[playlist[id].snd_id].name;
+		if(name[0]!='\0')
+			erouter->postEvent(EventBase::audioEGID,id,EventBase::statusETID,ms,name,1);
+		else
+			erouter->postEvent(EventBase::audioEGID,id,EventBase::statusETID,ms);
 		return false;
 	}
 }
@@ -676,10 +694,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 
diff -urdN ../Tekkotsu_2.2.1/SoundPlay/SoundManager.h ./SoundPlay/SoundManager.h
--- ../Tekkotsu_2.2.1/SoundPlay/SoundManager.h	Thu Nov  4 00:24:03 2004
+++ ./SoundPlay/SoundManager.h	Thu Nov  4 00:24:03 2004
@@ -262,7 +262,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/SoundPlay/SoundManagerMsg.h ./SoundPlay/SoundManagerMsg.h
--- ../Tekkotsu_2.2.1/SoundPlay/SoundManagerMsg.h	Thu Sep 25 11:32:08 2003
+++ ./SoundPlay/SoundManagerMsg.h	Thu Sep 25 11:32:08 2003
@@ -59,7 +59,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/SoundPlay/SoundPlay.cc ./SoundPlay/SoundPlay.cc
--- ../Tekkotsu_2.2.1/SoundPlay/SoundPlay.cc	Fri Jan 16 18:55:32 2004
+++ ./SoundPlay/SoundPlay.cc	Thu Dec 16 17:46:21 2004
@@ -56,23 +56,21 @@
 	sndman=new ((SoundManager*)soundManagerMemRgn->Base()) SoundManager;
 	sndman->InitAccess(subject[sbjSoundManagerComm]);
 	for(unsigned int i=0; i<config->sound.preload.size(); i++)
-		sndman->LoadFile(config->sound.preload[i].c_str());
+		sndman->LoadFile(config->sound.preload[i]);
 
 	OpenSpeaker();
 	NewSoundVectorData();
 	SetPowerAndVolume();
-
 	return oSUCCESS;
 }
 
 OStatus
 SoundPlay::DoStart(const OSystemEvent&)
 {
-	//OSYSDEBUG(("SoundPlay::DoStart()\n"));
+  //OSYSDEBUG(("SoundPlay::DoStart()\n"));
 
 	ENABLE_ALL_SUBJECT;
 	ASSERT_READY_TO_ALL_OBSERVER;
-
 	return oSUCCESS;
 }
 
@@ -93,7 +91,7 @@
 SoundPlay::DoDestroy(const OSystemEvent&)
 {
 	for(unsigned int i=0; i<config->sound.preload.size(); i++)
-		sndman->ReleaseFile(config->sound.preload[i].c_str());
+		sndman->ReleaseFile(config->sound.preload[i]);
 	delete erouter;
 	eventTranslatorQueueMemRgn->RemoveReference();
 	DELETE_ALL_SUBJECT_AND_OBSERVER;
@@ -268,10 +266,10 @@
  * either expressed or implied, including but not limited to the
  * implied warranties of fitness for a particular purpose.
  *
- * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Author: ejt $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
diff -urdN ../Tekkotsu_2.2.1/SoundPlay/SoundPlay.h ./SoundPlay/SoundPlay.h
--- ../Tekkotsu_2.2.1/SoundPlay/SoundPlay.h	Tue Dec 23 01:33:44 2003
+++ ./SoundPlay/SoundPlay.h	Tue Dec 23 01:33:44 2003
@@ -84,7 +84,7 @@
  * implied warranties of fitness for a particular purpose.
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/SoundPlay/WAV.cc ./SoundPlay/WAV.cc
--- ../Tekkotsu_2.2.1/SoundPlay/WAV.cc	Fri Jul 25 16:18:08 2003
+++ ./SoundPlay/WAV.cc	Fri Jul 25 16:18:08 2003
@@ -15,7 +15,7 @@
  * implied warranties of fitness for a particular purpose.
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/SoundPlay/WAV.h ./SoundPlay/WAV.h
--- ../Tekkotsu_2.2.1/SoundPlay/WAV.h	Fri Jul 25 16:18:08 2003
+++ ./SoundPlay/WAV.h	Fri Jul 25 16:18:08 2003
@@ -15,7 +15,7 @@
  * implied warranties of fitness for a particular purpose.
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Vision/BallDetectionGenerator.cc ./Vision/BallDetectionGenerator.cc
--- ../Tekkotsu_2.2.1/Vision/BallDetectionGenerator.cc	Tue Nov  9 15:01:49 2004
+++ ./Vision/BallDetectionGenerator.cc	Wed Dec 22 18:13:07 2004
@@ -247,7 +247,9 @@
 
 void
 BallDetectionGenerator::createEvent(EventBase::EventTypeID_t etid, float centerX, float centerY) const {
-	erouter->postEvent(new VisionObjectEvent(etid,mySourceID,centerX,centerY));
+	VisionObjectEvent * vo=new VisionObjectEvent(etid,mySourceID,centerX,centerY);
+	vo->setName(getName());
+	erouter->postEvent(vo);
 }
 
 int
@@ -276,8 +278,8 @@
  * reviewed the code, so I guess it's all ours...
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
diff -urdN ../Tekkotsu_2.2.1/Vision/BallDetectionGenerator.h ./Vision/BallDetectionGenerator.h
--- ../Tekkotsu_2.2.1/Vision/BallDetectionGenerator.h	Mon Feb  9 17:45:28 2004
+++ ./Vision/BallDetectionGenerator.h	Mon Feb  9 17:45:28 2004
@@ -89,7 +89,7 @@
  * reviewed the code, so I guess it's all ours...
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Vision/CDTGenerator.cc ./Vision/CDTGenerator.cc
--- ../Tekkotsu_2.2.1/Vision/CDTGenerator.cc	Tue Nov  9 15:01:49 2004
+++ ./Vision/CDTGenerator.cc	Tue Nov  9 15:01:49 2004
@@ -237,7 +237,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Vision/CDTGenerator.h ./Vision/CDTGenerator.h
--- ../Tekkotsu_2.2.1/Vision/CDTGenerator.h	Wed Feb 18 16:13:32 2004
+++ ./Vision/CDTGenerator.h	Wed Feb 18 16:13:32 2004
@@ -97,7 +97,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Vision/FilterBankGenerator.cc ./Vision/FilterBankGenerator.cc
--- ../Tekkotsu_2.2.1/Vision/FilterBankGenerator.cc	Tue Nov  9 15:01:49 2004
+++ ./Vision/FilterBankGenerator.cc	Tue Nov  9 15:01:49 2004
@@ -164,7 +164,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Vision/FilterBankGenerator.h ./Vision/FilterBankGenerator.h
--- ../Tekkotsu_2.2.1/Vision/FilterBankGenerator.h	Wed Nov 10 20:45:37 2004
+++ ./Vision/FilterBankGenerator.h	Mon Dec 20 16:47:59 2004
@@ -111,10 +111,8 @@
  */
 class FilterBankGenerator : public EventGeneratorBase, public LoadSave {
 public:
-	//! constructor
-	FilterBankGenerator(const std::string& name,EventBase::EventGeneratorID_t srcgid, unsigned int srcsid, EventBase::EventGeneratorID_t mgid, unsigned int msid)
-		: EventGeneratorBase(name,mgid,msid,srcgid,srcsid), src(NULL), numLayers(0), numChannels(0), widths(NULL), heights(NULL), skips(NULL), strides(NULL), increments(NULL), images(NULL), imageValids(NULL), selectedSaveLayer(0), selectedSaveChannel(0), frameNumber(0), framesProcessed(0)
-	{ }
+	// Constructors are all protected - doesn't make sense to
+	// instantiate this class directly, you want to use a subclass
 
 	//! destructor
 	/*! Your own subclasses should also have destructors which call
@@ -205,6 +203,16 @@
 
 
 protected:
+	//! constructor, @a name is both class and instance name
+	FilterBankGenerator(const std::string& name,EventBase::EventGeneratorID_t srcgid, unsigned int srcsid, EventBase::EventGeneratorID_t mgid, unsigned int msid)
+		: EventGeneratorBase(name,mgid,msid,srcgid,srcsid), src(NULL), numLayers(0), numChannels(0), widths(NULL), heights(NULL), skips(NULL), strides(NULL), increments(NULL), images(NULL), imageValids(NULL), selectedSaveLayer(0), selectedSaveChannel(0), frameNumber(0), framesProcessed(0)
+	{ }
+
+	//! constructor, separate class and instance names
+	FilterBankGenerator(const std::string& classname,const std::string& instancename,EventBase::EventGeneratorID_t srcgid, unsigned int srcsid, EventBase::EventGeneratorID_t mgid, unsigned int msid)
+		: EventGeneratorBase(classname,instancename,mgid,msid,srcgid,srcsid), src(NULL), numLayers(0), numChannels(0), widths(NULL), heights(NULL), skips(NULL), strides(NULL), increments(NULL), images(NULL), imageValids(NULL), selectedSaveLayer(0), selectedSaveChannel(0), frameNumber(0), framesProcessed(0)
+	{ }
+
 	//! resizes the filter bank information storage area, you should override this to do your setup and call it from your constructor
 	/*! In general, it isn't expected that FilterBankGenerator's should
 	 *  necessarily be dynamically resizeable (although it would be
@@ -280,10 +288,10 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Vision/InterleavedYUVGenerator.cc ./Vision/InterleavedYUVGenerator.cc
--- ../Tekkotsu_2.2.1/Vision/InterleavedYUVGenerator.cc	Tue Nov  9 15:01:49 2004
+++ ./Vision/InterleavedYUVGenerator.cc	Tue Nov  9 15:01:49 2004
@@ -128,7 +128,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Vision/InterleavedYUVGenerator.h ./Vision/InterleavedYUVGenerator.h
--- ../Tekkotsu_2.2.1/Vision/InterleavedYUVGenerator.h	Wed Feb 18 16:13:32 2004
+++ ./Vision/InterleavedYUVGenerator.h	Wed Feb 18 16:13:32 2004
@@ -78,7 +78,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Vision/JPEGGenerator.cc ./Vision/JPEGGenerator.cc
--- ../Tekkotsu_2.2.1/Vision/JPEGGenerator.cc	Tue Nov  9 15:01:49 2004
+++ ./Vision/JPEGGenerator.cc	Tue Nov  9 15:01:49 2004
@@ -241,7 +241,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Vision/JPEGGenerator.h ./Vision/JPEGGenerator.h
--- ../Tekkotsu_2.2.1/Vision/JPEGGenerator.h	Wed Feb 18 16:13:32 2004
+++ ./Vision/JPEGGenerator.h	Wed Feb 18 16:13:32 2004
@@ -107,7 +107,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Vision/RLEGenerator.cc ./Vision/RLEGenerator.cc
--- ../Tekkotsu_2.2.1/Vision/RLEGenerator.cc	Tue Nov  9 15:01:49 2004
+++ ./Vision/RLEGenerator.cc	Tue Nov  9 15:01:49 2004
@@ -149,7 +149,7 @@
  * @author ejt (reorganized)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Vision/RLEGenerator.h ./Vision/RLEGenerator.h
--- ../Tekkotsu_2.2.1/Vision/RLEGenerator.h	Wed Feb 18 16:13:32 2004
+++ ./Vision/RLEGenerator.h	Wed Feb 18 16:13:32 2004
@@ -117,7 +117,7 @@
  * @author ejt (reorganized)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Vision/RawCameraGenerator.cc ./Vision/RawCameraGenerator.cc
--- ../Tekkotsu_2.2.1/Vision/RawCameraGenerator.cc	Tue Nov  9 15:01:49 2004
+++ ./Vision/RawCameraGenerator.cc	Tue Nov  9 15:01:49 2004
@@ -425,7 +425,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Vision/RawCameraGenerator.h ./Vision/RawCameraGenerator.h
--- ../Tekkotsu_2.2.1/Vision/RawCameraGenerator.h	Wed Feb 18 16:13:32 2004
+++ ./Vision/RawCameraGenerator.h	Wed Feb 18 16:13:32 2004
@@ -115,7 +115,7 @@
  * @author ejt (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Vision/RegionGenerator.cc ./Vision/RegionGenerator.cc
--- ../Tekkotsu_2.2.1/Vision/RegionGenerator.cc	Tue Nov  9 15:01:49 2004
+++ ./Vision/RegionGenerator.cc	Tue Nov  9 15:01:49 2004
@@ -239,7 +239,7 @@
  * @author ejt (reorganized)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Vision/RegionGenerator.h ./Vision/RegionGenerator.h
--- ../Tekkotsu_2.2.1/Vision/RegionGenerator.h	Wed Feb 18 16:13:32 2004
+++ ./Vision/RegionGenerator.h	Wed Feb 18 16:13:32 2004
@@ -74,7 +74,7 @@
  * @author ejt (reorganized)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Vision/SegmentedColorGenerator.cc ./Vision/SegmentedColorGenerator.cc
--- ../Tekkotsu_2.2.1/Vision/SegmentedColorGenerator.cc	Tue Nov  9 15:01:49 2004
+++ ./Vision/SegmentedColorGenerator.cc	Tue Nov  9 15:01:49 2004
@@ -224,7 +224,7 @@
  * @author ejt (reorganized)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Vision/SegmentedColorGenerator.h ./Vision/SegmentedColorGenerator.h
--- ../Tekkotsu_2.2.1/Vision/SegmentedColorGenerator.h	Fri Jul 16 23:29:24 2004
+++ ./Vision/SegmentedColorGenerator.h	Wed Dec 22 20:47:07 2004
@@ -93,6 +93,7 @@
 	//! returns index of color corresponding to a string (uses a fast hash lookup)
 	unsigned int getColorIndex(const std::string& name) const { return getColorIndex(name.c_str()); }
 
+	//! returns index of color corresponding to a specific rgb color
 	unsigned int getColorIndex(const rgb color) const {
 		for(unsigned int index = 0; index < getNumColors(); index++)
 			if(getColorRGB((int)index) == color)
@@ -160,11 +161,11 @@
  * @author alokl (Creator)
  * @author ejt (reorganized)
  *
- * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Author: ejt $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Wireless/DummySocket.h ./Wireless/DummySocket.h
--- ../Tekkotsu_2.2.1/Wireless/DummySocket.h	Sun Jan 18 05:16:59 2004
+++ ./Wireless/DummySocket.h	Sun Jan 18 05:16:59 2004
@@ -42,7 +42,7 @@
  * @author alokl (Creator)
  * 
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Wireless/Socket.cc ./Wireless/Socket.cc
--- ../Tekkotsu_2.2.1/Wireless/Socket.cc	Mon Oct  4 16:38:05 2004
+++ ./Wireless/Socket.cc	Mon Oct  4 16:38:05 2004
@@ -172,7 +172,7 @@
  * @author alokl (Creator)
  * 
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Wireless/Socket.h ./Wireless/Socket.h
--- ../Tekkotsu_2.2.1/Wireless/Socket.h	Mon Oct  4 16:38:05 2004
+++ ./Wireless/Socket.h	Wed Dec 22 20:47:07 2004
@@ -8,7 +8,9 @@
 #include <stdarg.h>
 #include <stdlib.h>
 
+//! holds socket enumerations and constants
 namespace SocketNS {
+	
   //! Specifies transport type. TCP is usually a good idea
   enum TransportType_t {
     SOCK_STREAM=0, //!< TCP: guaranteed delivery, higher overhead
@@ -228,10 +230,10 @@
  * @author alokl (Creator)
  * 
  * $Author: ejt $
- * $Name: HEAD $
- * $Revision: 1.1 $
+ * $Name: HEAD $
+ * $Revision: 1.1 $
  * $State: Exp $
- * $Date: 2004/12/23 08:41:24 $
+ * $Date: 2004/12/23 08:41:24 $
  */
 
 #endif
diff -urdN ../Tekkotsu_2.2.1/Wireless/Wireless.cc ./Wireless/Wireless.cc
--- ../Tekkotsu_2.2.1/Wireless/Wireless.cc	Tue Sep 28 18:12:35 2004
+++ ./Wireless/Wireless.cc	Tue Sep 28 18:12:35 2004
@@ -495,7 +495,7 @@
  * @verbinclude CMPack_license.txt
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/Wireless/Wireless.h ./Wireless/Wireless.h
--- ../Tekkotsu_2.2.1/Wireless/Wireless.h	Wed Mar 24 01:38:21 2004
+++ ./Wireless/Wireless.h	Wed Mar 24 01:38:21 2004
@@ -155,7 +155,7 @@
  * @verbinclude CMPack_license.txt
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/docs/doxygencfg ./docs/doxygencfg
--- ../Tekkotsu_2.2.1/docs/doxygencfg	Tue Nov 16 19:09:35 2004
+++ ./docs/doxygencfg	Wed Dec 22 20:47:07 2004
@@ -23,7 +23,7 @@
 # This could be handy for archiving the generated documentation or 
 # if some version control system is used.
 
-PROJECT_NUMBER         = 2.2.1
+PROJECT_NUMBER         = 2.2.2
 
 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
 # base path where the generated documentation will be put. 
diff -urdN ../Tekkotsu_2.2.1/docs/exthead.html ./docs/exthead.html
--- ../Tekkotsu_2.2.1/docs/exthead.html	Wed Dec 31 19:00:00 1969
+++ ./docs/exthead.html	Wed Nov 24 16:30:39 2004
@@ -0,0 +1,36 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+	<head>
+		<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+		<title>$title</title>
+		<link href="doxygen.css" rel="stylesheet" type="text/css">
+		<link rel="home" href="../index.html">
+		<link rel="up" href="../index.html">
+		<link rel="SHORTCUT ICON" href="favicon.ico">
+	</head>
+	<body>
+		<!-- <img src="aibosmall.jpg" width=92 height=75 align=right> -->
+		<table cellpadding="1" cellspacing="6" border="0"
+					 style="text-align: left; margin-left: auto; margin-right: auto;">
+			<tbody>
+				<tr>
+					<!-- #Homepage# --> <td style="vertical-align: top;"><a target="_top" href="../../index.html">Homepage</a></td>
+					<!-- #Bar# --> <td style="vertical-align: top; background-color: rgb(0, 0, 0);"></td>
+					<!-- #Demos# --> <td style="vertical-align: top;"><a target="_top" href="../../Samples.html">Demos</a></td>
+					<!-- #Bar# --> <td style="vertical-align: top; background-color: rgb(0, 0, 0);"></td>
+					<!-- #Overview# --> <td style="vertical-align: top;"><a target="_top" href="../../Overview.html">Overview</a></td>
+					<!-- #Bar# --> <td style="vertical-align: top; background-color: rgb(0, 0, 0);"></td>
+					<!-- #Downloads# --> <td style="vertical-align: top;"><a target="_top" href="../../VersionHistory.html">Downloads</a></td>
+					<!-- #Bar# --> <td style="vertical-align: top; background-color: rgb(0, 0, 0);"></td>
+					<!-- #Tutorials# --> <td style="vertical-align: top;"><a target="_top" href="../../Tutorials.html">Tutorials</a></td>
+					<!-- #Bar# --> <td style="vertical-align: top; background-color: rgb(0, 0, 0);"></td>
+					<!-- #Reference# --> <td style="vertical-align: top;"><a target="_top" href="../index.html">Reference</a></td>
+					<!-- #Bar# --> <td style="vertical-align: top; background-color: rgb(0, 0, 0);"><br></td>
+					<!-- #Credits# --> <td style="vertical-align: top;"><a target="_top" href="../../Credits.html">Credits</a> </td>
+				</tr>
+			</tbody>
+		</table>
+<table style="text-align: left; margin-left: auto; margin-right: auto; width: 700px;" border="0" cellspacing="2" cellpadding="2">
+  <tbody>
+    <tr>
+      <td style="vertical-align: top;">
\ No newline at end of file
Binary files ../Tekkotsu_2.2.1/docs/html/favicon.ico and ./docs/html/favicon.ico differ
diff -urdN ../Tekkotsu_2.2.1/docs/html/index.html ./docs/html/index.html
--- ../Tekkotsu_2.2.1/docs/html/index.html	Tue Nov 16 19:09:35 2004
+++ ./docs/html/index.html	Wed Dec 22 20:47:07 2004
@@ -13,8 +13,8 @@
   <link href="favicon.ico" rel="SHORTCUT ICON">
 </head>
 <body>
-<table cellpadding="1" cellspacing="6" border="0"
- style="text-align: left; margin-left: auto; margin-right: auto;">
+<table style="text-align: left; margin-left: auto; margin-right: auto;"
+ border="0" cellpadding="1" cellspacing="6">
   <tbody>
     <tr>
 <!-- #Homepage# --> <td style="vertical-align: top;"><a
@@ -53,24 +53,24 @@
   </tbody>
 </table>
 <div class="qindex">
-<a class="qindexHL" href="main.html">Main&nbsp;Page</a> | 
-<a class="qindex" href="namespaces.html">Namespace List</a> | 
-<a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | 
-<a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | 
-<a class="qindex" href="annotated.html">Class&nbsp;List</a> | 
-<a class="qindex" href="dirs.html">Directories</a> | 
-<a class="qindex" href="files.html">File&nbsp;List</a> | 
-<a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | 
-<a class="qindex" href="functions.html">Class&nbsp;Members</a> | 
-<a class="qindex" href="globals.html">File&nbsp;Members</a> | 
-<a class="qindex" href="pages.html">Related&nbsp;Pages</a>
+<a class="qindexHL" href="main.html">Main&nbsp;Page</a> | <a
+ class="qindex" href="namespaces.html">Namespace List</a> | <a
+ class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a
+ class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a
+ class="qindex" href="annotated.html">Class&nbsp;List</a> | <a
+ class="qindex" href="dirs.html">Directories</a> | <a class="qindex"
+ href="files.html">File&nbsp;List</a> | <a class="qindex"
+ href="namespacemembers.html">Namespace&nbsp;Members</a> | <a
+ class="qindex" href="functions.html">Class&nbsp;Members</a> | <a
+ class="qindex" href="globals.html">File&nbsp;Members</a> | <a
+ class="qindex" href="pages.html">Related&nbsp;Pages</a>
 </div>
 <center>
 <h1>Tekkotsu Source Documentation</h1>
 </center>
 <table
  style="text-align: left; width: 620px; margin-left: auto; margin-right: auto; height: 100%;"
- border="0" cellspacing="2" cellpadding="2">
+ border="0" cellpadding="2" cellspacing="2">
   <tbody>
     <tr>
       <td style="vertical-align: top;">
@@ -98,12 +98,16 @@
         </li>
         <li><a href="pages.html">Related Pages</a> - Links to the <a
  href="todo.html">todo</a> and <a href="bug.html">bug</a> lists.</li>
+        <li>Local documentation of the included <a
+ href="newmat/index.html" target="_top">newmat</a> and <a
+ href="roboop/index.html" target="_top">ROBOOP</a> libraries<br>
+        </li>
         <li>You can also search the framework:<br>
-          <form action="http://cvs.tekkotsu.org/search.php" method="get" name="doxyform"><input
- value="0" name="page" type="hidden"><input value="" maxlength="1000"
- wrap="virtual" size="44" name="query"><input alt="Search" title=""
- name="search" border="0" width="74" height="16" src="search.png"
- type="image"></form>
+          <form action="http://cvs.tekkotsu.org/search.php" method="get"
+ name="doxyform"><input value="0" name="page" type="hidden"><input
+ value="" maxlength="1000" wrap="virtual" size="44" name="query"><input
+ alt="Search" title="" name="search" src="search.png" border="0"
+ height="16" type="image" width="74"></form>
         </li>
       </ul>
       <ul style="margin-left: 40px;">
@@ -124,8 +128,8 @@
 static copies of the documentation, there are two formats:<br>
       </p>
       <ul style="margin-left: 40px;">
-        <li><a href="../media/Tekkotsu_doc_2.2.1.tar.gz">HTML</a> (v2.2.1,
-5.9MB)</li>
+        <li><a href="../media/Tekkotsu_doc_2.2.2.tar.gz">HTML</a>
+(v2.2.2)</li>
       </ul>
       <div style="margin-left: 40px;">If you're using the most recent
 version from the <a href="http://cvs.tekkotsu.org/">CVS repository</a>,
@@ -135,21 +139,26 @@
       </div>
       <h3>External Documentation:<br>
       </h3>
-      <p style="margin-left: 40px;">
-We make use of two independent libraries: the <a
-href="http://www.robertnz.net/nm_intro.htm" target="_top">newmat</a> matrix library
+      <p style="margin-left: 40px;">We make use of two independent
+libraries: the <a href="http://www.robertnz.net/nm_intro.htm"
+ target="_top">newmat</a> matrix library
 and the <a href="http://www.cours.polymtl.ca/roboop/" target="_top">ROBOOP</a>
-kinematics library.  We mirror their own doxygen documentation on our
+kinematics library. We mirror their own doxygen documentation on our
 site so that our documentation can link to it.
-</p>
-      <p style="margin-left: 40px;">
-You can directly access these libraries' documentation with these links:
-<ul style="margin-left: 40px;">
-<li><a href="newmat/index.html" target="_top">newmat</a> Documentation
-<li><a href="roboop/index.html" target="_top">ROBOOP</a> Documentation
-</ul>
-</p>
-						</p>
+      </p>
+      <p style="margin-left: 40px;">You can directly access these
+libraries' documentation with these links:
+      </p>
+      <ul style="margin-left: 40px;">
+        <li><a href="newmat/index.html" target="_top">newmat</a>
+Documentation
+        </li>
+        <li><a href="roboop/index.html" target="_top">ROBOOP</a>
+Documentation
+        </li>
+      </ul>
+      <p></p>
+      <p></p>
       <p style="margin-left: 40px;"> This code is originally based on
 an early version of CMU's
 2002 Legged RoboSoccer entry, <a
@@ -157,13 +166,13 @@
 &nbsp;<a href="classWalkMC.html">WalkMC</a>
 and the <a href="http://www.cs.cmu.edu/%7Ejbruce/cmvision">CMVision</a>
 library
-still fall under their <a
- href="CMPack_license.txt">license</a>.
+still fall under their <a href="CMPack_license.txt">license</a>.
 &nbsp;This license is also included in the files themselves.<br>
       </p>
-      <p style="margin-left: 40px;"> Note that CMVision is not
-documented in this project.&nbsp;
-There is some documentation as <a
+      <p style="margin-left: 40px;"> Note that although we include the
+CMVision classes within our reference section, CMVision does not have
+any inline doxygen documentation.&nbsp; However, there is some external
+documentation as <a
  href="http://www-2.cs.cmu.edu/%7Ejbruce/cmvision/papers/JBThesis00.ps.gz">compressed
 postscript</a> and <a
  href="http://www-2.cs.cmu.edu/%7Ejbruce/cmvision/papers/JBThesis00.pdf">PDF</a>.</p>
diff -urdN ../Tekkotsu_2.2.1/docs/newmat.doxycfg ./docs/newmat.doxycfg
--- ../Tekkotsu_2.2.1/docs/newmat.doxycfg	Tue Jul 20 13:56:10 2004
+++ ./docs/newmat.doxycfg	Wed Nov 24 16:30:40 2004
@@ -12,5 +12,6 @@
 HTML_OUTPUT = newmat
 SEARCHENGINE = YES
 GENERATE_TAGFILE = generated/newmat.tag
+HTML_HEADER = exthead.html
 HTML_FOOTER = newmatfoot.html
 PREDEFINED += use_namespace
diff -urdN ../Tekkotsu_2.2.1/docs/roboop.doxycfg ./docs/roboop.doxycfg
--- ../Tekkotsu_2.2.1/docs/roboop.doxycfg	Tue Jul 20 13:56:10 2004
+++ ./docs/roboop.doxycfg	Wed Nov 24 16:30:40 2004
@@ -13,5 +13,6 @@
 SEARCHENGINE = YES
 TAGFILES += generated/newmat.tag=../newmat
 GENERATE_TAGFILE = generated/roboop.tag
+HTML_HEADER = exthead.html
 HTML_FOOTER = roboopfoot.html
 INCLUDE_PATH = ../Shared/newmat
diff -urdN ../Tekkotsu_2.2.1/project/Environment.conf ./project/Environment.conf
--- ../Tekkotsu_2.2.1/project/Environment.conf	Tue Nov 16 14:02:46 2004
+++ ./project/Environment.conf	Tue Nov 30 16:13:16 2004
@@ -1,4 +1,7 @@
-###########  ENVIRONMENT VARIABLES  ###############
+############  ENVIRONMENT VARIABLES  ##############
+############# $Name: HEAD $ ###############
+############### $Revision: 1.1 $ #################
+########## $Date: 2004/12/23 08:41:24 $ ###########
 # If you need to modify these, you should set them as environment
 # variables instead of changing them here - that way other tools (such
 # as mntmem and crashDebug) can use these as well.
@@ -54,10 +57,10 @@
 TEKKOTSU_BUILDDIR ?= $(TEKKOTSU_ROOT)/build
 PROJECT_BUILDDIR ?= build
 # or perhaps you would like one/both of these better:
-# puts build directory in local tmp, but avoids conflicts between
-# multiple frameworks or multiple projects
-#TEKKOTSU_BUILDDIR ?= $(shell echo /tmp/`cd $(TEKKOTSU_ROOT); pwd | tr / _`_build_$(USER) | sed "s/ /\\ /g")
-#PROJECT_BUILDDIR ?= $(shell echo /tmp/`pwd | tr / _`_build_$(USER) | sed "s/ /\\ /g")
+# puts build directory in local tmp, but uses pathnames to avoids
+# conflicts between multiple frameworks or multiple projects
+#TEKKOTSU_BUILDDIR ?= $(shell echo /tmp/$(subst /,_,$(TEKKOTSU_ROOT))_build_$(USER) | sed "s/ /\\\ /g")
+#PROJECT_BUILDDIR ?= $(shell echo /tmp/`pwd | tr / _`_build_$(USER) | sed "s/ /\\\ /g")
 
 
 ##########  TOOL SELECTION VARIABLES  #############
@@ -90,4 +93,7 @@
 TK_BD:=$(TEKKOTSU_BUILDDIR)/$(TGT_BD)
 PROJ_BD:=$(PROJECT_BUILDDIR)/$(TGT_BD)
 $(shell mkdir -p $(TK_BD))
-$(shell mkdir -p $(PROJ_BD))
+
+#test:=$(shell echo "TEKKOTSU_BUILDDIR: $(TEKKOTSU_BUILDDIR)" > /dev/tty)
+#test:=$(shell echo "PROJECT_BUILDDIR: $(PROJECT_BUILDDIR)" > /dev/tty)
+#$(error that's all folks)
diff -urdN ../Tekkotsu_2.2.1/project/Makefile ./project/Makefile
--- ../Tekkotsu_2.2.1/project/Makefile	Tue Nov 16 21:52:45 2004
+++ ./project/Makefile	Wed Dec 22 17:25:40 2004
@@ -1,3 +1,8 @@
+################ PROJECT MAKEFILE #################
+############# $Name: HEAD $ ###############
+############### $Revision: 1.1 $ #################
+########## $Date: 2004/12/23 08:41:24 $ ###########
+
 # Make sure the default target is 'all' by listing it first
 all:
 
@@ -6,6 +11,7 @@
 ###################################################
 TEKKOTSU_ENVIRONMENT_CONFIGURATION?=$(shell pwd | sed 's/ /\\ /g')/Environment.conf
 include $(TEKKOTSU_ENVIRONMENT_CONFIGURATION)
+$(shell mkdir -p $(PROJ_BD))
 
 
 #############  MAKEFILE VARIABLES  ################
@@ -428,6 +434,23 @@
 
 install: compile
 	@echo "Installing files to memory stick at $(MEMSTICK_ROOT)"
+	$(TEKKOTSU_ROOT)/tools/mntmem $(MEMSTICK_ROOT)
+	@if [ \! -r $(MEMSTICK_ROOT)/open-r/version.txt -o \! -r $(MEMSTICK_ROOT)/open-r/system/objs/ipstack.bin -o \! -r $(MEMSTICK_ROOT)/open-r/system/objs/vr.bin -o \! -r $(MEMSTICK_ROOT)/open-r/system/objs/wlanenbl.bin ] ; then \
+		echo "** ERROR: It looks like your memory stick is missing critical system files."; \
+		echo "**        You may want to 'make newstick' first to clear the memory stick"; \
+		echo "**        and copy the OPEN-R system files onto it."; \
+		echo $(TEKKOTSU_ROOT)/tools/umntmem $(MEMSTICK_ROOT); \
+		$(TEKKOTSU_ROOT)/tools/umntmem $(MEMSTICK_ROOT); \
+		exit 1; \
+	fi;
+	@if [ -z "`grep \"$(if $(findstring TGT_ERS7,$(TEKKOTSU_TARGET_MODEL)),ERS-7,ERS-210/220)\" \"$(MEMSTICK_ROOT)/open-r/version.txt\"`" ] ; then \
+		echo "** ERROR: It looks like your memory stick has the system files for the wrong"; \
+		echo "**        model of AIBO.  You may want to 'make newstick' first to clear the"; \
+		echo "**        memory stick and reinstall the OPEN-R system files onto it."; \
+		echo $(TEKKOTSU_ROOT)/tools/umntmem $(MEMSTICK_ROOT); \
+		$(TEKKOTSU_ROOT)/tools/umntmem $(MEMSTICK_ROOT); \
+		exit 1; \
+	fi;
 	@$(TEKKOTSU_ROOT)/tools/cpymem --all --img $(MSIMGDIR) --tgt $(MEMSTICK_ROOT) --tools $(TEKKOTSU_ROOT)/tools
 	@touch .copiedtomemstick.timestamp
 
diff -urdN ../Tekkotsu_2.2.1/project/StartupBehavior.cc ./project/StartupBehavior.cc
--- ../Tekkotsu_2.2.1/project/StartupBehavior.cc	Wed Nov 10 20:45:37 2004
+++ ./project/StartupBehavior.cc	Tue Dec 21 16:49:50 2004
@@ -80,10 +80,10 @@
 	if(state->robotDesign & WorldState::ERS7Mask)
 		mouthOffset=ERS7Info::MouthOffset;
 	if(mouthOffset!=-1U) {
-		SharedObject<MotionSequenceMC<MotionSequence::SizeTiny> > closeMouth;
-		closeMouth->setPlayTime(3000); //take 3 seconds to close the mouth
+		SharedObject<TinyMotionSequenceMC> closeMouth;
+		closeMouth->advanceTime(3000); //take 3 seconds to close the mouth
 		closeMouth->setOutputCmd(mouthOffset,outputRanges[mouthOffset][MaxRange]);
-		closeMouth->setPlayTime(3500); //and hold it for another .5 seconds
+		closeMouth->advanceTime(500); //and hold it for another .5 seconds
 		closeMouth->setOutputCmd(mouthOffset,outputRanges[mouthOffset][MaxRange]);
 		motman->addPrunableMotion(closeMouth,MotionManager::kEmergencyPriority+1);
 		erouter->addTimer(this,1,3250,false);
diff -urdN ../Tekkotsu_2.2.1/project/StartupBehavior_SetupFileAccess.cc ./project/StartupBehavior_SetupFileAccess.cc
--- ../Tekkotsu_2.2.1/project/StartupBehavior_SetupFileAccess.cc	Mon Oct 18 13:01:38 2004
+++ ./project/StartupBehavior_SetupFileAccess.cc	Tue Dec 21 15:29:18 2004
@@ -14,7 +14,7 @@
 	startSubMenu();
 	{ 
 		addItem(new PostureEditor(stop_id));
-		addItem(new RunSequenceControl<MotionSequence::SizeXLarge>("Run Motion Sequence",stop_id));
+		addItem(new RunSequenceControl<XLargeMotionSequenceMC::CAPACITY>("Run Motion Sequence",stop_id));
 		addItem(new PlaySoundControl("Play Sound"));
 		addItem(new WaypointWalkControl());
 		SetupWalkEdit();
diff -urdN ../Tekkotsu_2.2.1/project/StartupBehavior_SetupModeSwitch.cc ./project/StartupBehavior_SetupModeSwitch.cc
--- ../Tekkotsu_2.2.1/project/StartupBehavior_SetupModeSwitch.cc	Tue Nov 16 19:01:14 2004
+++ ./project/StartupBehavior_SetupModeSwitch.cc	Wed Dec 22 20:49:32 2004
@@ -6,7 +6,7 @@
 #include "Behaviors/Demos/AlanBehavior.h"
 #include "Behaviors/Demos/ChaseBallBehavior.h"
 #include "Behaviors/Demos/FollowHeadBehavior.h"
-#include "Behaviors/Demos/WalkToTargetMachine.h"
+#include "Behaviors/Nodes/WalkToTargetNode.h"
 #include "Behaviors/Demos/HelloWorldBehavior.h"
 #include "Behaviors/Demos/BanditMachine.h"
 #include "Behaviors/Demos/SoundTestBehavior.h"
@@ -46,7 +46,7 @@
 		addItem(new ControlBase("State Machine Demos","More fully developed demo applications"));
 		startSubMenu();
 		{
-			addItem(new BehaviorSwitchControlBase(new WalkToTargetMachine(ProjectInterface::visPinkBallSID),bg));
+			addItem(new BehaviorSwitchControlBase(new WalkToTargetNode("Walk To Target (ball)",ProjectInterface::visPinkBallSID),bg));
 			addItem(new BehaviorSwitchControl<BanditMachine>("Bandit State Machine",bg,false));
 			addItem(new BehaviorSwitchControl<ExploreMachine>("Explore State Machine",bg,false));
 			addItem(new BehaviorSwitchControl<PaceTargetsMachine>("Pace Targets State Machine",bg,false));
diff -urdN ../Tekkotsu_2.2.1/project/StartupBehavior_SetupTekkotsuMon.cc ./project/StartupBehavior_SetupTekkotsuMon.cc
--- ../Tekkotsu_2.2.1/project/StartupBehavior_SetupTekkotsuMon.cc	Fri Nov 12 17:07:39 2004
+++ ./project/StartupBehavior_SetupTekkotsuMon.cc	Mon Dec 13 21:54:01 2004
@@ -14,6 +14,7 @@
 #include "Behaviors/Mon/WorldStateSerializerBehavior.h"
 #include "Behaviors/Mon/MicrophoneServer.h"
 #include "Behaviors/Mon/SpeakerServer.h"
+#include "Behaviors/Mon/SpiderMachineBehavior.h"
 
 ControlBase*
 StartupBehavior::SetupTekkotsuMon() {
@@ -31,6 +32,7 @@
 		addItem((new BehaviorSwitchControlBase(new EStopControllerBehavior(stop_id)))->start());
 		addItem(new BehaviorSwitchControlBase(MicrophoneServer::GetInstance()));
 		addItem(new BehaviorSwitchControlBase(SpeakerServer::GetInstance()));
+		addItem((new BehaviorSwitchControl<SpiderMachineBehavior>("Spider State Machines Server",false)));
 	}
 	return endSubMenu();
 }
diff -urdN ../Tekkotsu_2.2.1/project/StartupBehavior_SetupWalkEdit.cc ./project/StartupBehavior_SetupWalkEdit.cc
--- ../Tekkotsu_2.2.1/project/StartupBehavior_SetupWalkEdit.cc	Fri May 14 03:18:19 2004
+++ ./project/StartupBehavior_SetupWalkEdit.cc	Fri May 14 03:18:19 2004
@@ -9,7 +9,7 @@
  * @author PA Gov. School for the Sciences 2003 Team Project - Motion group: Haoqian Chen, Yantian Martin, Jon Stahlman (creators)
  * 
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/project/ms/config/ers210.kin ./project/ms/config/ers210.kin
--- ../Tekkotsu_2.2.1/project/ms/config/ers210.kin	Fri Oct 29 19:25:11 2004
+++ ./project/ms/config/ers210.kin	Wed Dec 22 21:21:00 2004
@@ -4,6 +4,15 @@
 
 [Default]
 
+[Body]
+Name:       Body
+DH:         1
+Fix:        0
+MinPara:    0
+dof:        0
+Motor:      0
+Stl:        0
+
 
 [LFr]
 Name:       LFr
@@ -801,7 +810,7 @@
 
 
 [InterestPoints]
-Length:     109
+Length:     121
 
 [InterestPoint1]
    name: LFr:elvtr
@@ -965,601 +974,685 @@
       y: 0
       z: 0
 [InterestPoint24]
+   name: UpperLChest
+  chain: Body
+   link: 0
+      x: 95.979
+      y: 31.609
+      z: 0
+[InterestPoint25]
+   name: UpperRChest
+  chain: Body
+   link: 0
+      x: 95.979
+      y: -31.609
+      z: 0
+[InterestPoint26]
+   name: LowerLChest
+  chain: Body
+   link: 0
+      x: 88.298
+      y: 26.664
+      z: -28.809
+[InterestPoint27]
+   name: LowerRChest
+  chain: Body
+   link: 0
+      x: 88.298
+      y: -26.664
+      z: -28.809
+[InterestPoint28]
+   name: LFrBelly
+  chain: Body
+   link: 0
+      x: 53.402
+      y: 25.995
+      z: -51.758
+[InterestPoint29]
+   name: RFrBelly
+  chain: Body
+   link: 0
+      x: 53.402
+      y: -25.995
+      z: -51.758
+[InterestPoint30]
+   name: LBkBelly
+  chain: Body
+   link: 0
+      x: -60.487
+      y: 15.015
+      z: -51.758
+[InterestPoint31]
+   name: RBkBelly
+  chain: Body
+   link: 0
+      x: -60.487
+      y: -15.015
+      z: -51.758
+[InterestPoint32]
+   name: LowerLRump
+  chain: Body
+   link: 0
+      x: -91.844
+      y: 26.664
+      z: -32.354
+[InterestPoint33]
+   name: LowerRRump
+  chain: Body
+   link: 0
+      x: -91.844
+      y: -26.664
+      z: -32.354
+[InterestPoint34]
+   name: UpperLRump
+  chain: Body
+   link: 0
+      x: -101.324
+      y: 31.609
+      z: 0
+[InterestPoint35]
+   name: UpperRRump
+  chain: Body
+   link: 0
+      x: -101.324
+      y: -31.609
+      z: 0
+[InterestPoint36]
    name: LowerLeftLowerLip
   chain: Mouth
    link: 5
       x: 7.139
       y: 37.069
       z: 11.898
-[InterestPoint25]
+[InterestPoint37]
    name: LowerRightLowerLip
   chain: Mouth
    link: 5
       x: 7.139
       y: 37.069
       z: -11.898
-[InterestPoint26]
+[InterestPoint38]
    name: UpperLeftLowerLip
   chain: Mouth
    link: 5
       x: -1.827
       y: 38.225
       z: 11.630
-[InterestPoint27]
+[InterestPoint39]
    name: UpperRightLowerLip
   chain: Mouth
    link: 5
       x: -1.827
       y: 38.225
       z: -11.630
-[InterestPoint28]
+[InterestPoint40]
    name: LowerLeftUpperLip
   chain: Mouth
    link: 4
       x: -11.630
       y: 19.327
       z: 58.044
-[InterestPoint29]
+[InterestPoint41]
    name: LowerRightUpperLip
   chain: Mouth
    link: 4
       x: 11.630
       y: 19.327
       z: 58.044
-[InterestPoint30]
+[InterestPoint42]
    name: LowerLeftSnout
   chain: Camera
    link: 4
       x: -24.917
       y: 19.968
       z: 65.777
-[InterestPoint31]
+[InterestPoint43]
    name: LowerRightSnout
   chain: Camera
    link: 4
       x: 24.917
       y: 19.968
       z: 65.777
-[InterestPoint32]
+[InterestPoint44]
    name: UpperLeftSnout
   chain: Camera
    link: 4
       x: -20.338
       y: -5.542
       z: 71.216
-[InterestPoint33]
+[InterestPoint45]
    name: UpperRightSnout
   chain: Camera
    link: 4
       x: 20.338
       y: -5.542
       z: 71.216
-[InterestPoint34]
+[InterestPoint46]
    name: LeftMicrophone
   chain: Camera
    link: 4
       x: -36.515
       y: -3.396
       z: 21.030
-[InterestPoint35]
+[InterestPoint47]
    name: RightMicrophone
   chain: Camera
    link: 4
       x: 36.515
       y: -3.396
       z: 21.030
-[InterestPoint36]
+[InterestPoint48]
    name: FrontHeadButton
   chain: Camera
    link: 4
       x: 0
       y: -44.415
       z: 8.284
-[InterestPoint37]
+[InterestPoint49]
    name: RearHeadButton
   chain: Camera
    link: 4
       x: 0
       y: -41.221
       z: -6.880
-[InterestPoint38]
+[InterestPoint50]
    name: ToeLFrPaw
   chain: LFr
    link: 5
       x: 18.464
       y: 31.529
       z: 0
-[InterestPoint39]
+[InterestPoint51]
    name: ToeRFrPaw
   chain: RFr
    link: 5
       x: 18.464
       y: 31.529
       z: 0
-[InterestPoint40]
+[InterestPoint52]
    name: ToeLBkPaw
   chain: LBk
    link: 5
       x: -4.890
       y: 36.210
       z: 0
-[InterestPoint41]
+[InterestPoint53]
    name: ToeRBkPaw
   chain: RBk
    link: 5
       x: -4.890
       y: 36.210
       z: 0
-[InterestPoint42]
+[InterestPoint54]
    name: LowerOuterFrontLFrShin
   chain: LFr
    link: 4
       x: 45.272
       y: 11.600
       z: -15.843
-[InterestPoint43]
+[InterestPoint55]
    name: LowerInnerFrontRFrShin
   chain: RFr
    link: 4
       x: 45.272
       y: 11.600
       z: -14.684
-[InterestPoint44]
+[InterestPoint56]
    name: LowerOuterFrontLBkShin
   chain: LBk
    link: 4
       x: 31.457
       y: -30.571
       z: 15.843
-[InterestPoint45]
+[InterestPoint57]
    name: LowerInnerFrontRBkShin
   chain: RBk
    link: 4
       x: 31.457
       y: -30.571
       z: 14.684
-[InterestPoint46]
+[InterestPoint58]
    name: LowerInnerFrontLFrShin
   chain: LFr
    link: 4
       x: 45.272
       y: 11.600
       z: 14.684
-[InterestPoint47]
+[InterestPoint59]
    name: LowerOuterFrontRFrShin
   chain: RFr
    link: 4
       x: 45.272
       y: 11.600
       z: 15.843
-[InterestPoint48]
+[InterestPoint60]
    name: LowerInnerFrontLBkShin
   chain: LBk
    link: 4
       x: 31.457
       y: -30.571
       z: -14.684
-[InterestPoint49]
+[InterestPoint61]
    name: LowerOuterFrontRBkShin
   chain: RBk
    link: 4
       x: 31.457
       y: -30.571
       z: -15.843
-[InterestPoint50]
+[InterestPoint62]
    name: LowerOuterBackLFrShin
   chain: LFr
    link: 4
       x: 45.891
       y: -26.126
       z: -15.843
-[InterestPoint51]
+[InterestPoint63]
    name: LowerInnerBackRFrShin
   chain: RFr
    link: 4
       x: 45.891
       y: -26.126
       z: -14.684
-[InterestPoint52]
+[InterestPoint64]
    name: LowerOuterBackLBkShin
   chain: LBk
    link: 4
       x: 65.997
       y: -8.442
       z: 15.843
-[InterestPoint53]
+[InterestPoint65]
    name: LowerInnerBackRBkShin
   chain: RBk
    link: 4
       x: 65.997
       y: -8.442
       z: 14.684
-[InterestPoint54]
+[InterestPoint66]
    name: LowerInnerBackLFrShin
   chain: LFr
    link: 4
       x: 45.891
       y: -26.126
       z: 14.684
-[InterestPoint55]
+[InterestPoint67]
    name: LowerOuterBackRFrShin
   chain: RFr
    link: 4
       x: 45.891
       y: -26.126
       z: 15.843
-[InterestPoint56]
+[InterestPoint68]
    name: LowerInnerBackLBkShin
   chain: LBk
    link: 4
       x: 65.997
       y: -8.442
       z: -14.684
-[InterestPoint57]
+[InterestPoint69]
    name: LowerOuterBackRBkShin
   chain: RBk
    link: 4
       x: 65.997
       y: -8.442
       z: -15.843
-[InterestPoint58]
+[InterestPoint70]
    name: MiddleOuterBackLBkShin
   chain: LBk
    link: 4
       x: 43.912
       y: 7.434
       z: 15.843
-[InterestPoint59]
+[InterestPoint71]
    name: MiddleInnerBackRBkShin
   chain: RBk
    link: 4
       x: 43.912
       y: 7.434
       z: 14.684
-[InterestPoint60]
+[InterestPoint72]
    name: MiddleInnerBackLBkShin
   chain: LBk
    link: 4
       x: 43.912
       y: 7.434
       z: -14.684
-[InterestPoint61]
+[InterestPoint73]
    name: MiddleOuterBackRBkShin
   chain: RBk
    link: 4
       x: 43.912
       y: 7.434
       z: -15.843
-[InterestPoint62]
+[InterestPoint74]
    name: UpperOuterFrontLFrShin
   chain: LFr
    link: 4
       x: 11.839
       y: 5.510
       z: -15.843
-[InterestPoint63]
+[InterestPoint75]
    name: UpperInnerFrontRFrShin
   chain: RFr
    link: 4
       x: 11.839
       y: 5.510
       z: -14.684
-[InterestPoint64]
+[InterestPoint76]
    name: UpperOuterFrontLBkShin
   chain: LBk
    link: 4
       x: .931
       y: -25.377
       z: 15.843
-[InterestPoint65]
+[InterestPoint77]
    name: UpperInnerFrontRBkShin
   chain: RBk
    link: 4
       x: .931
       y: -25.377
       z: 14.684
-[InterestPoint66]
+[InterestPoint78]
    name: UpperInnerFrontLFrShin
   chain: LFr
    link: 4
       x: 11.839
       y: 5.510
       z: 14.684
-[InterestPoint67]
+[InterestPoint79]
    name: UpperOuterFrontRFrShin
   chain: RFr
    link: 4
       x: 11.839
       y: 5.510
       z: 15.843
-[InterestPoint68]
+[InterestPoint80]
    name: UpperInnerFrontLBkShin
   chain: LBk
    link: 4
       x: .931
       y: -25.377
       z: -14.684
-[InterestPoint69]
+[InterestPoint81]
    name: UpperOuterFrontRBkShin
   chain: RBk
    link: 4
       x: .931
       y: -25.377
       z: -15.843
-[InterestPoint70]
+[InterestPoint82]
    name: UpperOuterBackLFrShin
   chain: LFr
    link: 4
       x: -1.381
       y: -23.945
       z: -15.843
-[InterestPoint71]
+[InterestPoint83]
    name: UpperInnerBackRFrShin
   chain: RFr
    link: 4
       x: -1.381
       y: -23.945
       z: -14.684
-[InterestPoint72]
+[InterestPoint84]
    name: UpperOuterBackLBkShin
   chain: LBk
    link: 4
       x: 13.646
       y: 4.905
       z: 15.843
-[InterestPoint73]
+[InterestPoint85]
    name: UpperInnerBackRBkShin
   chain: RBk
    link: 4
       x: 13.646
       y: 4.905
       z: 14.684
-[InterestPoint74]
+[InterestPoint86]
    name: UpperInnerBackLFrShin
   chain: LFr
    link: 4
       x: -1.381
       y: -23.945
       z: 14.684
-[InterestPoint75]
+[InterestPoint87]
    name: UpperOuterBackRFrShin
   chain: RFr
    link: 4
       x: -1.381
       y: -23.945
       z: 15.843
-[InterestPoint76]
+[InterestPoint88]
    name: UpperInnerBackLBkShin
   chain: LBk
    link: 4
       x: 13.646
       y: 4.905
       z: -14.684
-[InterestPoint77]
+[InterestPoint89]
    name: UpperOuterBackRBkShin
   chain: RBk
    link: 4
       x: 13.646
       y: 4.905
       z: -15.843
-[InterestPoint78]
+[InterestPoint90]
    name: LowerOuterFrontLFrThigh
   chain: LFr
    link: 3
       x: 42.939
       y: 14.898
       z: 18.749
-[InterestPoint79]
+[InterestPoint91]
    name: LowerInnerFrontRFrThigh
   chain: RFr
    link: 3
       x: 42.939
       y: -14.496
       z: -18.749
-[InterestPoint80]
+[InterestPoint92]
    name: LowerOuterFrontLBkThigh
   chain: LBk
    link: 3
       x: 48.284
       y: 14.898
       z: 17.459
-[InterestPoint81]
+[InterestPoint93]
    name: LowerInnerFrontRBkThigh
   chain: RBk
    link: 3
       x: 48.284
       y: -14.496
       z: -17.459
-[InterestPoint82]
+[InterestPoint94]
    name: LowerInnerFrontLFrThigh
   chain: LFr
    link: 3
       x: 42.939
       y: -14.496
       z: 18.749
-[InterestPoint83]
+[InterestPoint95]
    name: LowerOuterFrontRFrThigh
   chain: RFr
    link: 3
       x: 42.939
       y: 14.898
       z: -18.749
-[InterestPoint84]
+[InterestPoint96]
    name: LowerInnerFrontLBkThigh
   chain: LBk
    link: 3
       x: 48.284
       y: -14.496
       z: 17.459
-[InterestPoint85]
+[InterestPoint97]
    name: LowerOuterFrontRBkThigh
   chain: RBk
    link: 3
       x: 48.284
       y: 14.898
       z: -17.459
-[InterestPoint86]
+[InterestPoint98]
    name: LowerOuterBackLFrThigh
   chain: LFr
    link: 3
       x: 48.284
       y: 14.436
       z: -17.459
-[InterestPoint87]
+[InterestPoint99]
    name: LowerInnerBackRFrThigh
   chain: RFr
    link: 3
       x: 48.284
       y: -14.027
       z: 17.459
-[InterestPoint88]
+[InterestPoint100]
    name: LowerOuterBackLBkThigh
   chain: LBk
    link: 3
       x: 42.939
       y: 14.436
       z: -18.749
-[InterestPoint89]
+[InterestPoint101]
    name: LowerInnerBackRBkThigh
   chain: RBk
    link: 3
       x: 42.939
       y: -14.027
       z: 18.749
-[InterestPoint90]
+[InterestPoint102]
    name: LowerInnerBackLFrThigh
   chain: LFr
    link: 3
       x: 48.284
       y: -14.027
       z: -17.459
-[InterestPoint91]
+[InterestPoint103]
    name: LowerOuterBackRFrThigh
   chain: RFr
    link: 3
       x: 48.284
       y: 14.436
       z: 17.459
-[InterestPoint92]
+[InterestPoint104]
    name: LowerInnerBackLBkThigh
   chain: LBk
    link: 3
       x: 42.939
       y: -14.027
       z: -18.749
-[InterestPoint93]
+[InterestPoint105]
    name: LowerOuterBackRBkThigh
   chain: RBk
    link: 3
       x: 42.939
       y: 14.436
       z: 18.749
-[InterestPoint94]
+[InterestPoint106]
    name: UpperOuterFrontLFrThigh
   chain: LFr
    link: 3
       x: 15.912
       y: -14.492
       z: 20.811
-[InterestPoint95]
+[InterestPoint107]
    name: UpperInnerFrontRFrThigh
   chain: RFr
    link: 3
       x: 0
       y: 16.072
       z: -20.811
-[InterestPoint96]
+[InterestPoint108]
    name: UpperOuterFrontLBkThigh
   chain: LBk
    link: 3
       x: 15.912
       y: -14.492
       z: 20.811
-[InterestPoint97]
+[InterestPoint109]
    name: UpperInnerFrontRBkThigh
   chain: RBk
    link: 3
       x: 0
       y: 16.072
       z: -20.811
-[InterestPoint98]
+[InterestPoint110]
    name: UpperInnerFrontLFrThigh
   chain: LFr
    link: 3
       x: 0
       y: 16.072
       z: 20.811
-[InterestPoint99]
+[InterestPoint111]
    name: UpperOuterFrontRFrThigh
   chain: RFr
    link: 3
       x: 15.912
       y: -14.492
       z: -20.811
-[InterestPoint100]
+[InterestPoint112]
    name: UpperInnerFrontLBkThigh
   chain: LBk
    link: 3
       x: 0
       y: 16.072
       z: 20.811
-[InterestPoint101]
+[InterestPoint113]
    name: UpperOuterFrontRBkThigh
   chain: RBk
    link: 3
       x: 15.912
       y: -14.492
       z: -20.811
-[InterestPoint102]
+[InterestPoint114]
    name: UpperOuterBackLFrThigh
   chain: LFr
    link: 3
       x: 15.912
       y: -14.492
       z: -20.811
-[InterestPoint103]
+[InterestPoint115]
    name: UpperInnerBackRFrThigh
   chain: RFr
    link: 3
       x: 0
       y: 16.072
       z: 20.811
-[InterestPoint104]
+[InterestPoint116]
    name: UpperOuterBackLBkThigh
   chain: LBk
    link: 3
       x: 15.912
       y: -14.492
       z: -20.811
-[InterestPoint105]
+[InterestPoint117]
    name: UpperInnerBackRBkThigh
   chain: RBk
    link: 3
       x: 0
       y: 16.072
       z: 20.811
-[InterestPoint106]
+[InterestPoint118]
    name: UpperInnerBackLFrThigh
   chain: LFr
    link: 3
       x: 0
       y: 16.072
       z: -20.811
-[InterestPoint107]
+[InterestPoint119]
    name: UpperOuterBackRFrThigh
   chain: RFr
    link: 3
       x: 15.912
       y: -14.492
       z: 20.811
-[InterestPoint108]
+[InterestPoint120]
    name: UpperInnerBackLBkThigh
   chain: LBk
    link: 3
       x: 0
       y: 16.072
       z: -20.811
-[InterestPoint109]
+[InterestPoint121]
    name: UpperOuterBackRBkThigh
   chain: RBk
    link: 3
diff -urdN ../Tekkotsu_2.2.1/project/ms/config/ers220.kin ./project/ms/config/ers220.kin
--- ../Tekkotsu_2.2.1/project/ms/config/ers220.kin	Fri Oct 29 19:25:12 2004
+++ ./project/ms/config/ers220.kin	Wed Dec 22 21:21:00 2004
@@ -4,6 +4,15 @@
 
 [Default]
 
+[Body]
+Name:       Body
+DH:         1
+Fix:        0
+MinPara:    0
+dof:        0
+Motor:      0
+Stl:        0
+
 
 [LFr]
 Name:       LFr
@@ -691,7 +700,7 @@
 
 
 [InterestPoints]
-Length:     103
+Length:     115
 
 [InterestPoint1]
    name: LFr:elvtr
@@ -848,566 +857,650 @@
       y: 0
       z: 0
 [InterestPoint23]
+   name: UpperLChest
+  chain: Body
+   link: 0
+      x: 100.701
+      y: 26.664
+      z: -11.980
+[InterestPoint24]
+   name: UpperRChest
+  chain: Body
+   link: 0
+      x: 100.701
+      y: -26.664
+      z: -11.980
+[InterestPoint25]
+   name: LowerLChest
+  chain: Body
+   link: 0
+      x: 88.298
+      y: 26.664
+      z: -28.809
+[InterestPoint26]
+   name: LowerRChest
+  chain: Body
+   link: 0
+      x: 88.298
+      y: -26.664
+      z: -28.809
+[InterestPoint27]
+   name: LFrBelly
+  chain: Body
+   link: 0
+      x: 53.402
+      y: 25.995
+      z: -51.758
+[InterestPoint28]
+   name: RFrBelly
+  chain: Body
+   link: 0
+      x: 53.402
+      y: -25.995
+      z: -51.758
+[InterestPoint29]
+   name: LBkBelly
+  chain: Body
+   link: 0
+      x: -60.487
+      y: 15.015
+      z: -51.758
+[InterestPoint30]
+   name: RBkBelly
+  chain: Body
+   link: 0
+      x: -60.487
+      y: -15.015
+      z: -51.758
+[InterestPoint31]
+   name: LowerLRump
+  chain: Body
+   link: 0
+      x: -91.844
+      y: 26.664
+      z: -32.354
+[InterestPoint32]
+   name: LowerRRump
+  chain: Body
+   link: 0
+      x: -91.844
+      y: -26.664
+      z: -32.354
+[InterestPoint33]
+   name: UpperLRump
+  chain: Body
+   link: 0
+      x: -101.324
+      y: 31.609
+      z: 0
+[InterestPoint34]
+   name: UpperRRump
+  chain: Body
+   link: 0
+      x: -101.324
+      y: -31.609
+      z: 0
+[InterestPoint35]
    name: LowerLeftSnout
   chain: Camera
    link: 4
       x: -16.369
       y: 14.469
       z: 57.925
-[InterestPoint24]
+[InterestPoint36]
    name: LowerRightSnout
   chain: Camera
    link: 4
       x: 16.369
       y: 14.469
       z: 57.925
-[InterestPoint25]
+[InterestPoint37]
    name: UpperLeftSnout
   chain: Camera
    link: 4
       x: -27.545
       y: -18.406
       z: 57.925
-[InterestPoint26]
+[InterestPoint38]
    name: UpperRightSnout
   chain: Camera
    link: 4
       x: 27.545
       y: -18.406
       z: 57.925
-[InterestPoint27]
+[InterestPoint39]
    name: LeftMicrophone
   chain: Camera
    link: 4
       x: -42.574
       y: -14.440
       z: 0
-[InterestPoint28]
+[InterestPoint40]
    name: RightMicrophone
   chain: Camera
    link: 4
       x: 42.574
       y: -14.440
       z: 0
-[InterestPoint29]
+[InterestPoint41]
    name: AntennaBase
   chain: Camera
    link: 4
       x: 23.286
       y: -36.059
       z: -1.042
-[InterestPoint30]
+[InterestPoint42]
    name: AntennaTip
   chain: Camera
    link: 4
       x: 23.286
       y: -67.273
       z: -12.955
-[InterestPoint31]
+[InterestPoint43]
    name: HeadLight
   chain: Camera
    link: 4
       x: 0
       y: -45.903
       z: 37.769
-[InterestPoint32]
+[InterestPoint44]
    name: ToeLFrPaw
   chain: LFr
    link: 5
       x: 18.464
       y: 31.529
       z: 0
-[InterestPoint33]
+[InterestPoint45]
    name: ToeRFrPaw
   chain: RFr
    link: 5
       x: 18.464
       y: 31.529
       z: 0
-[InterestPoint34]
+[InterestPoint46]
    name: ToeLBkPaw
   chain: LBk
    link: 5
       x: -4.890
       y: 36.210
       z: 0
-[InterestPoint35]
+[InterestPoint47]
    name: ToeRBkPaw
   chain: RBk
    link: 5
       x: -4.890
       y: 36.210
       z: 0
-[InterestPoint36]
+[InterestPoint48]
    name: LowerOuterFrontLFrShin
   chain: LFr
    link: 4
       x: 52.075
       y: 20.986
       z: -15.843
-[InterestPoint37]
+[InterestPoint49]
    name: LowerInnerFrontRFrShin
   chain: RFr
    link: 4
       x: 52.075
       y: 20.986
       z: -14.684
-[InterestPoint38]
+[InterestPoint50]
    name: LowerOuterFrontLBkShin
   chain: LBk
    link: 4
       x: 23.361
       y: -30.920
       z: 15.843
-[InterestPoint39]
+[InterestPoint51]
    name: LowerInnerFrontRBkShin
   chain: RBk
    link: 4
       x: 23.361
       y: -30.920
       z: 14.684
-[InterestPoint40]
+[InterestPoint52]
    name: LowerInnerFrontLFrShin
   chain: LFr
    link: 4
       x: 52.075
       y: 20.986
       z: 14.684
-[InterestPoint41]
+[InterestPoint53]
    name: LowerOuterFrontRFrShin
   chain: RFr
    link: 4
       x: 52.075
       y: 20.986
       z: 15.843
-[InterestPoint42]
+[InterestPoint54]
    name: LowerInnerFrontLBkShin
   chain: LBk
    link: 4
       x: 23.361
       y: -30.920
       z: -14.684
-[InterestPoint43]
+[InterestPoint55]
    name: LowerOuterFrontRBkShin
   chain: RBk
    link: 4
       x: 23.361
       y: -30.920
       z: -15.843
-[InterestPoint44]
+[InterestPoint56]
    name: LowerOuterBackLFrShin
   chain: LFr
    link: 4
       x: 45.891
       y: -26.126
       z: -15.843
-[InterestPoint45]
+[InterestPoint57]
    name: LowerInnerBackRFrShin
   chain: RFr
    link: 4
       x: 45.891
       y: -26.126
       z: -14.684
-[InterestPoint46]
+[InterestPoint58]
    name: LowerOuterBackLBkShin
   chain: LBk
    link: 4
       x: 65.997
       y: -8.442
       z: 15.843
-[InterestPoint47]
+[InterestPoint59]
    name: LowerInnerBackRBkShin
   chain: RBk
    link: 4
       x: 65.997
       y: -8.442
       z: 14.684
-[InterestPoint48]
+[InterestPoint60]
    name: LowerInnerBackLFrShin
   chain: LFr
    link: 4
       x: 45.891
       y: -26.126
       z: 14.684
-[InterestPoint49]
+[InterestPoint61]
    name: LowerOuterBackRFrShin
   chain: RFr
    link: 4
       x: 45.891
       y: -26.126
       z: 15.843
-[InterestPoint50]
+[InterestPoint62]
    name: LowerInnerBackLBkShin
   chain: LBk
    link: 4
       x: 65.997
       y: -8.442
       z: -14.684
-[InterestPoint51]
+[InterestPoint63]
    name: LowerOuterBackRBkShin
   chain: RBk
    link: 4
       x: 65.997
       y: -8.442
       z: -15.843
-[InterestPoint52]
+[InterestPoint64]
    name: MiddleOuterBackLBkShin
   chain: LBk
    link: 4
       x: 43.912
       y: 7.434
       z: 15.843
-[InterestPoint53]
+[InterestPoint65]
    name: MiddleInnerBackRBkShin
   chain: RBk
    link: 4
       x: 43.912
       y: 7.434
       z: 14.684
-[InterestPoint54]
+[InterestPoint66]
    name: MiddleInnerBackLBkShin
   chain: LBk
    link: 4
       x: 43.912
       y: 7.434
       z: -14.684
-[InterestPoint55]
+[InterestPoint67]
    name: MiddleOuterBackRBkShin
   chain: RBk
    link: 4
       x: 43.912
       y: 7.434
       z: -15.843
-[InterestPoint56]
+[InterestPoint68]
    name: UpperOuterFrontLFrShin
   chain: LFr
    link: 4
       x: 11.839
       y: 5.510
       z: -15.843
-[InterestPoint57]
+[InterestPoint69]
    name: UpperInnerFrontRFrShin
   chain: RFr
    link: 4
       x: 11.839
       y: 5.510
       z: -14.684
-[InterestPoint58]
+[InterestPoint70]
    name: UpperOuterFrontLBkShin
   chain: LBk
    link: 4
       x: 8.036
       y: -22.656
       z: 15.843
-[InterestPoint59]
+[InterestPoint71]
    name: UpperInnerFrontRBkShin
   chain: RBk
    link: 4
       x: 8.036
       y: -22.656
       z: 14.684
-[InterestPoint60]
+[InterestPoint72]
    name: UpperInnerFrontLFrShin
   chain: LFr
    link: 4
       x: 11.839
       y: 5.510
       z: 14.684
-[InterestPoint61]
+[InterestPoint73]
    name: UpperOuterFrontRFrShin
   chain: RFr
    link: 4
       x: 11.839
       y: 5.510
       z: 15.843
-[InterestPoint62]
+[InterestPoint74]
    name: UpperInnerFrontLBkShin
   chain: LBk
    link: 4
       x: 8.036
       y: -22.656
       z: -14.684
-[InterestPoint63]
+[InterestPoint75]
    name: UpperOuterFrontRBkShin
   chain: RBk
    link: 4
       x: 8.036
       y: -22.656
       z: -15.843
-[InterestPoint64]
+[InterestPoint76]
    name: UpperOuterBackLFrShin
   chain: LFr
    link: 4
       x: -1.381
       y: -23.945
       z: -15.843
-[InterestPoint65]
+[InterestPoint77]
    name: UpperInnerBackRFrShin
   chain: RFr
    link: 4
       x: -1.381
       y: -23.945
       z: -14.684
-[InterestPoint66]
+[InterestPoint78]
    name: UpperOuterBackLBkShin
   chain: LBk
    link: 4
       x: 13.646
       y: 4.905
       z: 15.843
-[InterestPoint67]
+[InterestPoint79]
    name: UpperInnerBackRBkShin
   chain: RBk
    link: 4
       x: 13.646
       y: 4.905
       z: 14.684
-[InterestPoint68]
+[InterestPoint80]
    name: UpperInnerBackLFrShin
   chain: LFr
    link: 4
       x: -1.381
       y: -23.945
       z: 14.684
-[InterestPoint69]
+[InterestPoint81]
    name: UpperOuterBackRFrShin
   chain: RFr
    link: 4
       x: -1.381
       y: -23.945
       z: 15.843
-[InterestPoint70]
+[InterestPoint82]
    name: UpperInnerBackLBkShin
   chain: LBk
    link: 4
       x: 13.646
       y: 4.905
       z: -14.684
-[InterestPoint71]
+[InterestPoint83]
    name: UpperOuterBackRBkShin
   chain: RBk
    link: 4
       x: 13.646
       y: 4.905
       z: -15.843
-[InterestPoint72]
+[InterestPoint84]
    name: LowerOuterFrontLFrThigh
   chain: LFr
    link: 3
       x: 36.841
       y: 15.300
       z: 17.244
-[InterestPoint73]
+[InterestPoint85]
    name: LowerInnerFrontRFrThigh
   chain: RFr
    link: 3
       x: 36.841
       y: -14.994
       z: -17.244
-[InterestPoint74]
+[InterestPoint86]
    name: LowerOuterFrontLBkThigh
   chain: LBk
    link: 3
       x: 42.819
       y: 15.300
       z: 17.814
-[InterestPoint75]
+[InterestPoint87]
    name: LowerInnerFrontRBkThigh
   chain: RBk
    link: 3
       x: 42.819
       y: -14.994
       z: -17.814
-[InterestPoint76]
+[InterestPoint88]
    name: LowerInnerFrontLFrThigh
   chain: LFr
    link: 3
       x: 36.841
       y: -14.994
       z: 17.244
-[InterestPoint77]
+[InterestPoint89]
    name: LowerOuterFrontRFrThigh
   chain: RFr
    link: 3
       x: 36.841
       y: 15.300
       z: -17.244
-[InterestPoint78]
+[InterestPoint90]
    name: LowerInnerFrontLBkThigh
   chain: LBk
    link: 3
       x: 42.819
       y: -14.994
       z: 17.814
-[InterestPoint79]
+[InterestPoint91]
    name: LowerOuterFrontRBkThigh
   chain: RBk
    link: 3
       x: 42.819
       y: 15.300
       z: -17.814
-[InterestPoint80]
+[InterestPoint92]
    name: LowerOuterBackLFrThigh
   chain: LFr
    link: 3
       x: 42.819
       y: 15.925
       z: -17.814
-[InterestPoint81]
+[InterestPoint93]
    name: LowerInnerBackRFrThigh
   chain: RFr
    link: 3
       x: 42.819
       y: -14.994
       z: 17.814
-[InterestPoint82]
+[InterestPoint94]
    name: LowerOuterBackLBkThigh
   chain: LBk
    link: 3
       x: 36.841
       y: 15.925
       z: -17.244
-[InterestPoint83]
+[InterestPoint95]
    name: LowerInnerBackRBkThigh
   chain: RBk
    link: 3
       x: 36.841
       y: -14.994
       z: 17.244
-[InterestPoint84]
+[InterestPoint96]
    name: LowerInnerBackLFrThigh
   chain: LFr
    link: 3
       x: 42.819
       y: -14.994
       z: -17.814
-[InterestPoint85]
+[InterestPoint97]
    name: LowerOuterBackRFrThigh
   chain: RFr
    link: 3
       x: 42.819
       y: 15.925
       z: 17.814
-[InterestPoint86]
+[InterestPoint98]
    name: LowerInnerBackLBkThigh
   chain: LBk
    link: 3
       x: 36.841
       y: -14.994
       z: -17.244
-[InterestPoint87]
+[InterestPoint99]
    name: LowerOuterBackRBkThigh
   chain: RBk
    link: 3
       x: 36.841
       y: 15.925
       z: 17.244
-[InterestPoint88]
+[InterestPoint100]
    name: UpperOuterFrontLFrThigh
   chain: LFr
    link: 3
       x: 15.238
       y: 14.844
       z: 16.736
-[InterestPoint89]
+[InterestPoint101]
    name: UpperInnerFrontRFrThigh
   chain: RFr
    link: 3
       x: 15.238
       y: -14.994
       z: -16.736
-[InterestPoint90]
+[InterestPoint102]
    name: UpperOuterFrontLBkThigh
   chain: LBk
    link: 3
       x: 15.238
       y: 14.844
       z: 16.736
-[InterestPoint91]
+[InterestPoint103]
    name: UpperInnerFrontRBkThigh
   chain: RBk
    link: 3
       x: 15.238
       y: -14.994
       z: -16.736
-[InterestPoint92]
+[InterestPoint104]
    name: UpperInnerFrontLFrThigh
   chain: LFr
    link: 3
       x: 15.238
       y: -14.994
       z: 16.736
-[InterestPoint93]
+[InterestPoint105]
    name: UpperOuterFrontRFrThigh
   chain: RFr
    link: 3
       x: 15.238
       y: 14.844
       z: -16.736
-[InterestPoint94]
+[InterestPoint106]
    name: UpperInnerFrontLBkThigh
   chain: LBk
    link: 3
       x: 15.238
       y: -14.994
       z: 16.736
-[InterestPoint95]
+[InterestPoint107]
    name: UpperOuterFrontRBkThigh
   chain: RBk
    link: 3
       x: 15.238
       y: 14.844
       z: -16.736
-[InterestPoint96]
+[InterestPoint108]
    name: UpperOuterBackLFrThigh
   chain: LFr
    link: 3
       x: 15.238
       y: 14.844
       z: -16.736
-[InterestPoint97]
+[InterestPoint109]
    name: UpperInnerBackRFrThigh
   chain: RFr
    link: 3
       x: 15.238
       y: -14.994
       z: 16.736
-[InterestPoint98]
+[InterestPoint110]
    name: UpperOuterBackLBkThigh
   chain: LBk
    link: 3
       x: 15.238
       y: 14.844
       z: -16.736
-[InterestPoint99]
+[InterestPoint111]
    name: UpperInnerBackRBkThigh
   chain: RBk
    link: 3
       x: 15.238
       y: -14.994
       z: 16.736
-[InterestPoint100]
+[InterestPoint112]
    name: UpperInnerBackLFrThigh
   chain: LFr
    link: 3
       x: 15.238
       y: -14.994
       z: -16.736
-[InterestPoint101]
+[InterestPoint113]
    name: UpperOuterBackRFrThigh
   chain: RFr
    link: 3
       x: 15.238
       y: 14.844
       z: 16.736
-[InterestPoint102]
+[InterestPoint114]
    name: UpperInnerBackLBkThigh
   chain: LBk
    link: 3
       x: 15.238
       y: -14.994
       z: -16.736
-[InterestPoint103]
+[InterestPoint115]
    name: UpperOuterBackRBkThigh
   chain: RBk
    link: 3
diff -urdN ../Tekkotsu_2.2.1/project/ms/config/ers7.kin ./project/ms/config/ers7.kin
--- ../Tekkotsu_2.2.1/project/ms/config/ers7.kin	Mon Oct 18 19:11:05 2004
+++ ./project/ms/config/ers7.kin	Wed Dec 22 21:21:00 2004
@@ -4,6 +4,15 @@
 
 [Default]
 
+[Body]
+Name:       Body
+DH:         1
+Fix:        0
+MinPara:    0
+dof:        0
+Motor:      0
+Stl:        0
+
 
 [LFr]
 Name:       LFr
@@ -1021,7 +1030,7 @@
 
 
 [InterestPoints]
-Length:     122
+Length:     134
 
 [InterestPoint1]
    name: LFr:elvtr
@@ -1199,678 +1208,762 @@
       y: 0
       z: 0
 [InterestPoint26]
+   name: UpperLChest
+  chain: Body
+   link: 0
+      x: 107.560
+      y: 23.448
+      z: 0
+[InterestPoint27]
+   name: UpperRChest
+  chain: Body
+   link: 0
+      x: 107.560
+      y: -23.448
+      z: 0
+[InterestPoint28]
+   name: LowerLChest
+  chain: Body
+   link: 0
+      x: 95.250
+      y: 29.631
+      z: -30.070
+[InterestPoint29]
+   name: LowerRChest
+  chain: Body
+   link: 0
+      x: 95.250
+      y: -29.631
+      z: -30.070
+[InterestPoint30]
+   name: LFrBelly
+  chain: Body
+   link: 0
+      x: 55.290
+      y: 20.238
+      z: -52.270
+[InterestPoint31]
+   name: RFrBelly
+  chain: Body
+   link: 0
+      x: 55.290
+      y: -20.238
+      z: -52.270
+[InterestPoint32]
+   name: LBkBelly
+  chain: Body
+   link: 0
+      x: -60.540
+      y: 25.238
+      z: -49.850
+[InterestPoint33]
+   name: RBkBelly
+  chain: Body
+   link: 0
+      x: -60.540
+      y: -25.238
+      z: -49.850
+[InterestPoint34]
+   name: LowerLRump
+  chain: Body
+   link: 0
+      x: -97.070
+      y: 29.631
+      z: -31.880
+[InterestPoint35]
+   name: LowerRRump
+  chain: Body
+   link: 0
+      x: -97.070
+      y: -29.631
+      z: -31.880
+[InterestPoint36]
+   name: UpperLRump
+  chain: Body
+   link: 0
+      x: -108.970
+      y: 29.631
+      z: 0
+[InterestPoint37]
+   name: UpperRRump
+  chain: Body
+   link: 0
+      x: -108.970
+      y: -29.631
+      z: 0
+[InterestPoint38]
    name: LowerLeftLowerLip
   chain: Mouth
    link: 5
       x: 40.851
       y: 12.275
       z: -16.128
-[InterestPoint27]
+[InterestPoint39]
    name: LowerRightLowerLip
   chain: Mouth
    link: 5
       x: 40.851
       y: 12.275
       z: 16.128
-[InterestPoint28]
+[InterestPoint40]
    name: UpperLeftLowerLip
   chain: Mouth
    link: 5
       x: 38.378
       y: 11.203
       z: -11.397
-[InterestPoint29]
+[InterestPoint41]
    name: UpperRightLowerLip
   chain: Mouth
    link: 5
       x: 38.378
       y: 11.203
       z: 11.397
-[InterestPoint30]
+[InterestPoint42]
    name: LowerLeftUpperLip
   chain: Mouth
    link: 4
       x: 79.518
       y: -22.291
       z: -11.397
-[InterestPoint31]
+[InterestPoint43]
    name: LowerRightUpperLip
   chain: Mouth
    link: 4
       x: 79.518
       y: -22.291
       z: 11.397
-[InterestPoint32]
+[InterestPoint44]
    name: LowerLeftSnout
   chain: Camera
    link: 4
       x: 54.223
       y: -21.146
       z: -37.291
-[InterestPoint33]
+[InterestPoint45]
    name: LowerRightSnout
   chain: Camera
    link: 4
       x: 54.223
       y: -21.146
       z: 37.291
-[InterestPoint34]
+[InterestPoint46]
    name: UpperLeftSnout
   chain: Camera
    link: 4
       x: 54.223
       y: 7.605
       z: -26.284
-[InterestPoint35]
+[InterestPoint47]
    name: UpperRightSnout
   chain: Camera
    link: 4
       x: 54.223
       y: 7.605
       z: 26.284
-[InterestPoint36]
+[InterestPoint48]
    name: LeftMicrophone
   chain: Camera
    link: 4
       x: -11.156
       y: 14.897
       z: -46.941
-[InterestPoint37]
+[InterestPoint49]
    name: RightMicrophone
   chain: Camera
    link: 4
       x: -11.156
       y: 14.897
       z: 46.941
-[InterestPoint38]
+[InterestPoint50]
    name: HeadButton
   chain: Camera
    link: 4
       x: -7.704
       y: 41.192
       z: 0
-[InterestPoint39]
+[InterestPoint51]
    name: ToeLFrPaw
   chain: LFr
    link: 5
       x: 7.180
       y: 29.548
       z: 0
-[InterestPoint40]
+[InterestPoint52]
    name: ToeRFrPaw
   chain: RFr
    link: 5
       x: 7.180
       y: 29.548
       z: 0
-[InterestPoint41]
+[InterestPoint53]
    name: ToeLBkPaw
   chain: LBk
    link: 5
       x: -6.414
       y: 27.759
       z: 0
-[InterestPoint42]
+[InterestPoint54]
    name: ToeRBkPaw
   chain: RBk
    link: 5
       x: -6.414
       y: 27.759
       z: 0
-[InterestPoint43]
+[InterestPoint55]
    name: LowerOuterFrontLFrShin
   chain: LFr
    link: 4
       x: 59.298
       y: 21.239
       z: -24.557
-[InterestPoint44]
+[InterestPoint56]
    name: LowerInnerFrontRFrShin
   chain: RFr
    link: 4
       x: 59.298
       y: 21.239
       z: -15.158
-[InterestPoint45]
+[InterestPoint57]
    name: LowerOuterFrontLBkShin
   chain: LBk
    link: 4
       x: 41.172
       y: -33.863
       z: 24.557
-[InterestPoint46]
+[InterestPoint58]
    name: LowerInnerFrontRBkShin
   chain: RBk
    link: 4
       x: 41.172
       y: -33.863
       z: 15.158
-[InterestPoint47]
+[InterestPoint59]
    name: LowerInnerFrontLFrShin
   chain: LFr
    link: 4
       x: 59.298
       y: 21.239
       z: 15.158
-[InterestPoint48]
+[InterestPoint60]
    name: LowerOuterFrontRFrShin
   chain: RFr
    link: 4
       x: 59.298
       y: 21.239
       z: 24.557
-[InterestPoint49]
+[InterestPoint61]
    name: LowerInnerFrontLBkShin
   chain: LBk
    link: 4
       x: 41.172
       y: -33.863
       z: -15.158
-[InterestPoint50]
+[InterestPoint62]
    name: LowerOuterFrontRBkShin
   chain: RBk
    link: 4
       x: 41.172
       y: -33.863
       z: -24.557
-[InterestPoint51]
+[InterestPoint63]
    name: LowerOuterMiddleLFrShin
   chain: LFr
    link: 4
       x: 63.011
       y: -15.573
       z: -24.557
-[InterestPoint52]
+[InterestPoint64]
    name: LowerInnerMiddleRFrShin
   chain: RFr
    link: 4
       x: 63.011
       y: -15.573
       z: -15.158
-[InterestPoint53]
+[InterestPoint65]
    name: LowerOuterMiddleLBkShin
   chain: LBk
    link: 4
       x: 75.203
       y: -8.342
       z: 24.557
-[InterestPoint54]
+[InterestPoint66]
    name: LowerInnerMiddleRBkShin
   chain: RBk
    link: 4
       x: 75.203
       y: -8.342
       z: 15.158
-[InterestPoint55]
+[InterestPoint67]
    name: LowerInnerMiddleLFrShin
   chain: LFr
    link: 4
       x: 63.011
       y: -15.573
       z: 15.158
-[InterestPoint56]
+[InterestPoint68]
    name: LowerOuterMiddleRFrShin
   chain: RFr
    link: 4
       x: 63.011
       y: -15.573
       z: 24.557
-[InterestPoint57]
+[InterestPoint69]
    name: LowerInnerMiddleLBkShin
   chain: LBk
    link: 4
       x: 75.203
       y: -8.342
       z: -15.158
-[InterestPoint58]
+[InterestPoint70]
    name: LowerOuterMiddleRBkShin
   chain: RBk
    link: 4
       x: 75.203
       y: -8.342
       z: -24.557
-[InterestPoint59]
+[InterestPoint71]
    name: LowerOuterBackLFrShin
   chain: LFr
    link: 4
       x: 40.581
       y: -26.402
       z: -24.557
-[InterestPoint60]
+[InterestPoint72]
    name: LowerInnerBackRFrShin
   chain: RFr
    link: 4
       x: 40.581
       y: -26.402
       z: -15.158
-[InterestPoint61]
+[InterestPoint73]
    name: LowerOuterBackLBkShin
   chain: LBk
    link: 4
       x: 71.133
       y: 8.187
       z: 24.557
-[InterestPoint62]
+[InterestPoint74]
    name: LowerInnerBackRBkShin
   chain: RBk
    link: 4
       x: 71.133
       y: 8.187
       z: 15.158
-[InterestPoint63]
+[InterestPoint75]
    name: LowerInnerBackLFrShin
   chain: LFr
    link: 4
       x: 40.581
       y: -26.402
       z: 15.158
-[InterestPoint64]
+[InterestPoint76]
    name: LowerOuterBackRFrShin
   chain: RFr
    link: 4
       x: 40.581
       y: -26.402
       z: 24.557
-[InterestPoint65]
+[InterestPoint77]
    name: LowerInnerBackLBkShin
   chain: LBk
    link: 4
       x: 71.133
       y: 8.187
       z: -15.158
-[InterestPoint66]
+[InterestPoint78]
    name: LowerOuterBackRBkShin
   chain: RBk
    link: 4
       x: 71.133
       y: 8.187
       z: -24.557
-[InterestPoint67]
+[InterestPoint79]
    name: MiddleOuterMiddleLFrShin
   chain: LFr
    link: 4
       x: 42.057
       y: -10.714
       z: -27.747
-[InterestPoint68]
+[InterestPoint80]
    name: MiddleInnerMiddleRFrShin
   chain: RFr
    link: 4
       x: 42.057
       y: -10.714
       z: -18.353
-[InterestPoint69]
+[InterestPoint81]
    name: MiddleOuterMiddleLBkShin
   chain: LBk
    link: 4
       x: 41.625
       y: -11.335
       z: 27.747
-[InterestPoint70]
+[InterestPoint82]
    name: MiddleInnerMiddleRBkShin
   chain: RBk
    link: 4
       x: 41.625
       y: -11.335
       z: 18.353
-[InterestPoint71]
+[InterestPoint83]
    name: MiddleInnerMiddleLFrShin
   chain: LFr
    link: 4
       x: 42.057
       y: -10.714
       z: 18.353
-[InterestPoint72]
+[InterestPoint84]
    name: MiddleOuterMiddleRFrShin
   chain: RFr
    link: 4
       x: 42.057
       y: -10.714
       z: 27.747
-[InterestPoint73]
+[InterestPoint85]
    name: MiddleInnerMiddleLBkShin
   chain: LBk
    link: 4
       x: 41.625
       y: -11.335
       z: -18.353
-[InterestPoint74]
+[InterestPoint86]
    name: MiddleOuterMiddleRBkShin
   chain: RBk
    link: 4
       x: 41.625
       y: -11.335
       z: -27.747
-[InterestPoint75]
+[InterestPoint87]
    name: UpperOuterFrontLFrShin
   chain: LFr
    link: 4
       x: 29.289
       y: 14.743
       z: -23.426
-[InterestPoint76]
+[InterestPoint88]
    name: UpperInnerFrontRFrShin
   chain: RFr
    link: 4
       x: 29.289
       y: 14.743
       z: -14.026
-[InterestPoint77]
+[InterestPoint89]
    name: UpperOuterFrontLBkShin
   chain: LBk
    link: 4
       x: 2.812
       y: -22.417
       z: 23.426
-[InterestPoint78]
+[InterestPoint90]
    name: UpperInnerFrontRBkShin
   chain: RBk
    link: 4
       x: 2.812
       y: -22.417
       z: 14.026
-[InterestPoint79]
+[InterestPoint91]
    name: UpperInnerFrontLFrShin
   chain: LFr
    link: 4
       x: 29.289
       y: 14.743
       z: 14.026
-[InterestPoint80]
+[InterestPoint92]
    name: UpperOuterFrontRFrShin
   chain: RFr
    link: 4
       x: 29.289
       y: 14.743
       z: 23.426
-[InterestPoint81]
+[InterestPoint93]
    name: UpperInnerFrontLBkShin
   chain: LBk
    link: 4
       x: 2.812
       y: -22.417
       z: -14.026
-[InterestPoint82]
+[InterestPoint94]
    name: UpperOuterFrontRBkShin
   chain: RBk
    link: 4
       x: 2.812
       y: -22.417
       z: -23.426
-[InterestPoint83]
+[InterestPoint95]
    name: UpperOuterBackLFrShin
   chain: LFr
    link: 4
       x: 6.397
       y: -20.060
       z: -23.426
-[InterestPoint84]
+[InterestPoint96]
    name: UpperInnerBackRFrShin
   chain: RFr
    link: 4
       x: 6.397
       y: -20.060
       z: -14.026
-[InterestPoint85]
+[InterestPoint97]
    name: UpperOuterBackLBkShin
   chain: LBk
    link: 4
       x: 32.869
       y: 9.622
       z: 23.426
-[InterestPoint86]
+[InterestPoint98]
    name: UpperInnerBackRBkShin
   chain: RBk
    link: 4
       x: 32.869
       y: 9.622
       z: 14.026
-[InterestPoint87]
+[InterestPoint99]
    name: UpperInnerBackLFrShin
   chain: LFr
    link: 4
       x: 6.397
       y: -20.060
       z: 14.026
-[InterestPoint88]
+[InterestPoint100]
    name: UpperOuterBackRFrShin
   chain: RFr
    link: 4
       x: 6.397
       y: -20.060
       z: 23.426
-[InterestPoint89]
+[InterestPoint101]
    name: UpperInnerBackLBkShin
   chain: LBk
    link: 4
       x: 32.869
       y: 9.622
       z: -14.026
-[InterestPoint90]
+[InterestPoint102]
    name: UpperOuterBackRBkShin
   chain: RBk
    link: 4
       x: 32.869
       y: 9.622
       z: -23.426
-[InterestPoint91]
+[InterestPoint103]
    name: LowerOuterFrontLFrThigh
   chain: LFr
    link: 3
       x: 47.947
       y: 14.539
       z: 17.189
-[InterestPoint92]
+[InterestPoint104]
    name: LowerInnerFrontRFrThigh
   chain: RFr
    link: 3
       x: 47.947
       y: -5.043
       z: -17.189
-[InterestPoint93]
+[InterestPoint105]
    name: LowerOuterFrontLBkThigh
   chain: LBk
    link: 3
       x: 47.947
       y: 14.539
       z: 17.189
-[InterestPoint94]
+[InterestPoint106]
    name: LowerInnerFrontRBkThigh
   chain: RBk
    link: 3
       x: 47.947
       y: -5.043
       z: -17.189
-[InterestPoint95]
+[InterestPoint107]
    name: LowerInnerFrontLFrThigh
   chain: LFr
    link: 3
       x: 47.947
       y: -5.043
       z: 17.189
-[InterestPoint96]
+[InterestPoint108]
    name: LowerOuterFrontRFrThigh
   chain: RFr
    link: 3
       x: 47.947
       y: 14.539
       z: -17.189
-[InterestPoint97]
+[InterestPoint109]
    name: LowerInnerFrontLBkThigh
   chain: LBk
    link: 3
       x: 47.947
       y: -5.043
       z: 17.189
-[InterestPoint98]
+[InterestPoint110]
    name: LowerOuterFrontRBkThigh
   chain: RBk
    link: 3
       x: 47.947
       y: 14.539
       z: -17.189
-[InterestPoint99]
+[InterestPoint111]
    name: LowerOuterBackLFrThigh
   chain: LFr
    link: 3
       x: 47.947
       y: 14.539
       z: -17.189
-[InterestPoint100]
+[InterestPoint112]
    name: LowerInnerBackRFrThigh
   chain: RFr
    link: 3
       x: 47.947
       y: -5.043
       z: 17.189
-[InterestPoint101]
+[InterestPoint113]
    name: LowerOuterBackLBkThigh
   chain: LBk
    link: 3
       x: 47.947
       y: 14.539
       z: -17.189
-[InterestPoint102]
+[InterestPoint114]
    name: LowerInnerBackRBkThigh
   chain: RBk
    link: 3
       x: 47.947
       y: -5.043
       z: 17.189
-[InterestPoint103]
+[InterestPoint115]
    name: LowerInnerBackLFrThigh
   chain: LFr
    link: 3
       x: 47.947
       y: -5.043
       z: -17.189
-[InterestPoint104]
+[InterestPoint116]
    name: LowerOuterBackRFrThigh
   chain: RFr
    link: 3
       x: 47.947
       y: 14.539
       z: 17.189
-[InterestPoint105]
+[InterestPoint117]
    name: LowerInnerBackLBkThigh
   chain: LBk
    link: 3
       x: 47.947
       y: -5.043
       z: -17.189
-[InterestPoint106]
+[InterestPoint118]
    name: LowerOuterBackRBkThigh
   chain: RBk
    link: 3
       x: 47.947
       y: 14.539
       z: 17.189
-[InterestPoint107]
+[InterestPoint119]
    name: UpperOuterFrontLFrThigh
   chain: LFr
    link: 3
       x: 0
       y: 10.310
       z: 17.189
-[InterestPoint108]
+[InterestPoint120]
    name: UpperInnerFrontRFrThigh
   chain: RFr
    link: 3
       x: 0
       y: -5.043
       z: -17.189
-[InterestPoint109]
+[InterestPoint121]
    name: UpperOuterFrontLBkThigh
   chain: LBk
    link: 3
       x: 0
       y: 10.310
       z: 17.189
-[InterestPoint110]
+[InterestPoint122]
    name: UpperInnerFrontRBkThigh
   chain: RBk
    link: 3
       x: 0
       y: -5.043
       z: -17.189
-[InterestPoint111]
+[InterestPoint123]
    name: UpperInnerFrontLFrThigh
   chain: LFr
    link: 3
       x: 0
       y: -5.043
       z: 17.189
-[InterestPoint112]
+[InterestPoint124]
    name: UpperOuterFrontRFrThigh
   chain: RFr
    link: 3
       x: 0
       y: 10.310
       z: -17.189
-[InterestPoint113]
+[InterestPoint125]
    name: UpperInnerFrontLBkThigh
   chain: LBk
    link: 3
       x: 0
       y: -5.043
       z: 17.189
-[InterestPoint114]
+[InterestPoint126]
    name: UpperOuterFrontRBkThigh
   chain: RBk
    link: 3
       x: 0
       y: 10.310
       z: -17.189
-[InterestPoint115]
+[InterestPoint127]
    name: UpperOuterBackLFrThigh
   chain: LFr
    link: 3
       x: 0
       y: 10.310
       z: -17.189
-[InterestPoint116]
+[InterestPoint128]
    name: UpperInnerBackRFrThigh
   chain: RFr
    link: 3
       x: 0
       y: -5.043
       z: 17.189
-[InterestPoint117]
+[InterestPoint129]
    name: UpperOuterBackLBkThigh
   chain: LBk
    link: 3
       x: 0
       y: 10.310
       z: -17.189
-[InterestPoint118]
+[InterestPoint130]
    name: UpperInnerBackRBkThigh
   chain: RBk
    link: 3
       x: 0
       y: -5.043
       z: 17.189
-[InterestPoint119]
+[InterestPoint131]
    name: UpperInnerBackLFrThigh
   chain: LFr
    link: 3
       x: 0
       y: -5.043
       z: -17.189
-[InterestPoint120]
+[InterestPoint132]
    name: UpperOuterBackRFrThigh
   chain: RFr
    link: 3
       x: 0
       y: 10.310
       z: 17.189
-[InterestPoint121]
+[InterestPoint133]
    name: UpperInnerBackLBkThigh
   chain: LBk
    link: 3
       x: 0
       y: -5.043
       z: -17.189
-[InterestPoint122]
+[InterestPoint134]
    name: UpperOuterBackRBkThigh
   chain: RBk
    link: 3
diff -urdN ../Tekkotsu_2.2.1/project/ms/config/ers7pnts.kin ./project/ms/config/ers7pnts.kin
--- ../Tekkotsu_2.2.1/project/ms/config/ers7pnts.kin	Wed Dec 31 19:00:00 1969
+++ ./project/ms/config/ers7pnts.kin	Wed Dec 22 21:21:00 2004
@@ -0,0 +1,1972 @@
+# ----------------------------------------------------------------
+# Robot configuration File
+# ----------------------------------------------------------------
+
+[Default]
+
+[Body]
+Name:       Body
+DH:         1
+Fix:        0
+MinPara:    0
+dof:        0
+Motor:      0
+Stl:        0
+
+
+[LFr]
+Name:       LFr
+DH:         1
+Fix:        0
+MinPara:    0
+dof:        5
+Motor:      0
+Stl:        0
+
+[LFr_LINK1]
+joint_type: 0
+immobile:   1
+theta:      0.0
+d:          0.0
+a:         65.0
+alpha:      1.570796326794895
+theta_min:  0.0
+theta_max:  0.0
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+
+[LFr_LINK2]
+joint_type: 0
+theta:     -1.570796326794895
+d:        -62.5
+a:          0.0
+alpha:     -1.570796326794895
+theta_min: -2.2689
+theta_max:  2.0071
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_output: 0
+
+[LFr_LINK3]
+joint_type: 0
+theta:      0.0
+d:          9.0
+a:         69.5
+alpha:      1.570796326794895
+theta_min: -0.1745
+theta_max:  1.5359
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_output: 1
+
+[LFr_LINK4]
+joint_type: 0
+theta:     -0.07122
+d:         -4.7
+a:         70.1646
+alpha:      0.0
+theta_min: -0.4363
+theta_max:  2.1293
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_output: 2
+
+[LFr_LINK5]
+joint_type: 0
+immobile:   1
+theta:      0.0
+d:          0.0
+a:          0.0
+alpha:      0.0
+theta_min:  0.0
+theta_max:  0.0
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_frame: 1
+
+
+[RFr]
+Name:       RFr
+DH:         1
+Fix:        0
+MinPara:    0
+dof:        5
+Motor:      0
+Stl:        0
+
+[RFr_LINK1]
+joint_type: 0
+immobile:   1
+theta:      0.0
+d:          0.0
+a:         65.0
+alpha:      1.570796326794895
+theta_min:  0.0
+theta_max:  0.0
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+
+[RFr_LINK2]
+joint_type: 0
+theta:     -1.570796326794895
+d:         62.5
+a:          0.0
+alpha:      1.570796326794895
+theta_min: -2.2689
+theta_max:  2.0071
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_output: 3
+
+[RFr_LINK3]
+joint_type: 0
+theta:      0.0
+d:         -9.0
+a:         69.5
+alpha:     -1.570796326794895
+theta_min: -0.1745
+theta_max:  1.5359
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_output: 4
+
+[RFr_LINK4]
+joint_type: 0
+theta:     -0.07122
+d:          4.7
+a:         70.1646
+alpha:      0.0
+theta_min: -0.4363
+theta_max:  2.1293
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_output: 5
+
+[RFr_LINK5]
+joint_type: 0
+immobile:   1
+theta:      0.0
+d:          0.0
+a:          0.0
+alpha:      0.0
+theta_min:  0.0
+theta_max:  0.0
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_frame: 2
+
+
+[LBk]
+Name:       LBk
+DH:         1
+Fix:        0
+MinPara:    0
+dof:        5
+Motor:      0
+Stl:        0
+
+[LBk_LINK1]
+joint_type: 0
+immobile:   1
+theta:      0.0
+d:          0.0
+a:        -65.0
+alpha:     -1.570796326794895
+theta_min:  0.0
+theta_max:  0.0
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+
+[LBk_LINK2]
+joint_type: 0
+theta:      1.570796326794895
+d:         62.5
+a:          0.0
+alpha:      1.570796326794895
+theta_min: -2.2689
+theta_max:  2.0071
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_output: 6
+
+[LBk_LINK3]
+joint_type: 0
+theta:      0.0
+d:         -9.0
+a:         69.5
+alpha:     -1.570796326794895
+theta_min: -0.1745
+theta_max:  1.5359
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_output: 7
+
+[LBk_LINK4]
+joint_type: 0
+theta:     -0.26686
+d:          4.7
+a:         70.1646
+alpha:      3.1415926535897932385
+theta_min: -0.4363
+theta_max:  2.1293
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_output: 8
+
+[LBk_LINK5]
+joint_type: 0
+immobile:   1
+theta:      0.0
+d:          0.0
+a:          0.0
+alpha:      0.0
+theta_min:  0.0
+theta_max:  0.0
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_frame: 3
+
+
+[RBk]
+Name:       RBk
+DH:         1
+Fix:        0
+MinPara:    0
+dof:        5
+Motor:      0
+Stl:        0
+
+[RBk_LINK1]
+joint_type: 0
+immobile:   1
+theta:      0.0
+d:          0.0
+a:        -65.0
+alpha:     -1.570796326794895
+theta_min:  0.0
+theta_max:  0.0
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+
+[RBk_LINK2]
+joint_type: 0
+theta:      1.570796326794895
+d:        -62.5
+a:          0.0
+alpha:     -1.570796326794895
+theta_min: -2.2689
+theta_max:  2.0071
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_output: 9
+
+[RBk_LINK3]
+joint_type: 0
+theta:      0.0
+d:          9.0
+a:         69.5
+alpha:      1.570796326794895
+theta_min: -0.1745
+theta_max:  1.5359
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_output: 10
+
+[RBk_LINK4]
+joint_type: 0
+theta:     -0.26686
+d:         -4.7
+a:         70.1646
+alpha:      3.1415926535897932385
+theta_min: -0.4363
+theta_max:  2.1293
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_output: 11
+
+[RBk_LINK5]
+joint_type: 0
+immobile:   1
+theta:      0.0
+d:          0.0
+a:          0.0
+alpha:      0.0
+theta_min:  0.0
+theta_max:  0.0
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_frame: 4
+
+
+[Mouth]
+Name:       Mouth
+DH:         1
+Fix:        0
+MinPara:    0
+dof:        5
+Motor:      0
+Stl:        0
+
+[Mouth_LINK1]
+joint_type: 0
+immobile:   1
+theta:      0.0
+d:         19.5
+a:         67.5
+alpha:      1.570796326794895
+theta_min:  0.0
+theta_max:  0.0
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+
+[Mouth_LINK2]
+joint_type: 0
+theta:      0.0
+d:          0.0
+a:          0.0
+alpha:     -1.570796326794895
+theta_min: -1.308996939
+theta_max:  0.0
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_output: 12
+
+[Mouth_LINK3]
+joint_type: 0
+theta:      0.0
+d:         80.0
+a:          0.0
+alpha:      1.570796326794895
+theta_min: -1.53588974176
+theta_max:  1.53588974176
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_output: 13
+
+[Mouth_LINK4]
+joint_type: 0
+theta:     -0.41241
+d:          0.0
+a:         43.6606
+alpha:      0.0
+theta_min: -0.261799387799
+theta_max:  0.785398163397
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_output: 14
+
+[Mouth_LINK5]
+joint_type: 0
+theta:      0.127935
+d:          0.0
+a:         42.0076
+alpha:     -1.570796326794895
+theta_min: -0.959931088597
+theta_max:  0.0
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_output: 17
+
+
+[Camera]
+Name:       Camera
+DH:         1
+Fix:        0
+MinPara:    0
+dof:        6
+Motor:      0
+Stl:        0
+
+[Camera_LINK1]
+joint_type: 0
+immobile:   1
+theta:      0.0
+d:         19.5
+a:         67.5
+alpha:      1.570796326794895
+theta_min:  0.0
+theta_max:  0.0
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+
+[Camera_LINK2]
+joint_type: 0
+theta:      0.0
+d:          0.0
+a:          0.0
+alpha:     -1.570796326794895
+theta_min: -1.308996939
+theta_max:  0.0
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_output: 12
+
+[Camera_LINK3]
+joint_type: 0
+theta:      0.0
+d:         80.0
+a:          0.0
+alpha:      1.570796326794895
+theta_min: -1.53588974176
+theta_max:  1.53588974176
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_output: 13
+
+[Camera_LINK4]
+joint_type: 0
+theta:     -1.570796326794895
+d:          0.0
+a:         14.6
+alpha:     -1.570796326794895
+theta_min: -0.261799387799
+theta_max:  0.785398163397
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_output: 14
+
+[Camera_LINK5]
+joint_type: 1
+immobile:   1
+theta:     -1.570796326794895
+d:         81.06
+a:          0.0
+alpha:      0.0
+theta_min:  0.0
+theta_max:  0.0
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+
+[Camera_LINK6]
+joint_type: 0
+immobile:   1
+theta:      0.0
+d:          0.0
+a:          0.0
+alpha:      0.0
+theta_min:  0.0
+theta_max:  0.0
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_frame: 5
+
+
+[NearIR]
+Name:       NearIR
+DH:         1
+Fix:        0
+MinPara:    0
+dof:        6
+Motor:      0
+Stl:        0
+
+[NearIR_LINK1]
+joint_type: 0
+immobile:   1
+theta:      0.0
+d:         19.5
+a:         67.5
+alpha:      1.570796326794895
+theta_min:  0.0
+theta_max:  0.0
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+
+[NearIR_LINK2]
+joint_type: 0
+theta:      0.0
+d:          0.0
+a:          0.0
+alpha:      -1.570796326794895
+theta_min: -1.308996939
+theta_max:  0.0
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_output: 12
+
+[NearIR_LINK3]
+joint_type: 0
+theta:      0.0
+d:         80.0
+a:          0.0
+alpha:      1.570796326794895
+theta_min: -1.53588974176
+theta_max:  1.53588974176
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_output: 13
+
+[NearIR_LINK4]
+joint_type: 0
+theta:      0.0249189
+d:          2.79525
+a:         76.9239
+alpha:      0.0
+theta_min: -0.261799387799
+theta_max:  0.785398163397
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_output: 14
+
+[NearIR_LINK5]
+joint_type: 0
+immobile:   1
+theta:      1.50041
+d:          0.0
+a:          0.0
+alpha:      1.55997
+theta_min:  0.0
+theta_max:  0.0
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+
+[NearIR_LINK6]
+joint_type: 1
+theta:      0.0
+d:          0.0
+a:          0.0
+alpha:      0.0
+theta_min:  0.0
+theta_max:  0.0
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_frame: 6
+
+
+[FarIR]
+Name:       FarIR
+DH:         1
+Fix:        0
+MinPara:    0
+dof:        6
+Motor:      0
+Stl:        0
+
+[FarIR_LINK1]
+joint_type: 0
+immobile:   1
+theta:      0.0
+d:         19.5
+a:         67.5
+alpha:      1.570796326794895
+theta_min:  0.0
+theta_max:  0.0
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+
+[FarIR_LINK2]
+joint_type: 0
+theta:      0.0
+d:          0.0
+a:          0.0
+alpha:      -1.570796326794895
+theta_min: -1.308996939
+theta_max:  0.0
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_output: 12
+
+[FarIR_LINK3]
+joint_type: 0
+theta:      0.0
+d:         80.0
+a:          0.0
+alpha:      1.570796326794895
+theta_min: -1.53588974176
+theta_max:  1.53588974176
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_output: 13
+
+[FarIR_LINK4]
+joint_type: 0
+theta:      0.0136814
+d:         -8.04682
+a:         76.9072
+alpha:      0.0
+theta_min: -0.261799387799
+theta_max:  0.785398163397
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_output: 14
+
+[FarIR_LINK5]
+joint_type: 0
+immobile:   1
+theta:      1.52305
+d:          0.0
+a:          0.0
+alpha:      1.56055
+theta_min:  0.0
+theta_max:  0.0
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+
+[FarIR_LINK6]
+joint_type: 1
+theta:      0.0
+d:          0.0
+a:          0.0
+alpha:      0.0
+theta_min:  0.0
+theta_max:  0.0
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_frame: 7
+
+
+[ChestIR]
+Name:       ChestIR
+DH:         1
+Fix:        0
+MinPara:    0
+dof:        3
+Motor:      0
+Stl:        0
+
+[ChestIR_LINK1]
+joint_type: 0
+immobile:   1
+theta:      0.0
+d:         -3.38397459622
+a:        109.13620668
+alpha:      1.570796326794895
+theta_min:  0.0
+theta_max:  0.0
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+
+[ChestIR_LINK2]
+joint_type: 0
+immobile:   1
+theta:      1.0471975512
+d:          0.0
+a:          0.0
+alpha:      1.570796326794895
+theta_min:  0.0
+theta_max:  0.0
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+
+[ChestIR_LINK3]
+joint_type: 1
+theta:      0.0
+d:          0.0
+a:          0.0
+alpha:      0.0
+theta_min:  0.0
+theta_max:  0.0
+m:          0.0
+cx:         0.0
+cy:         0.0
+cz:         0.0
+Ixx:        0.0
+Ixy:        0.0
+Ixz:        0.0
+Iyy:        0.0
+Iyz:        0.0
+Izz:        0.0
+tekkotsu_frame: 8
+
+
+[InterestPoints]
+Length:     134
+
+[InterestPoint1]
+   name: LFr:elvtr
+  chain: LFr
+   link: 2
+      x: 0
+      y: 0
+      z: 0
+[InterestPoint2]
+   name: LFr:rotor
+  chain: LFr
+   link: 3
+      x: 0
+      y: 0
+      z: 0
+[InterestPoint3]
+   name: LFr:knee~
+  chain: LFr
+   link: 4
+      x: 0
+      y: 0
+      z: 0
+[InterestPoint4]
+   name: RFr:elvtr
+  chain: RFr
+   link: 2
+      x: 0
+      y: 0
+      z: 0
+[InterestPoint5]
+   name: RFr:rotor
+  chain: RFr
+   link: 3
+      x: 0
+      y: 0
+      z: 0
+[InterestPoint6]
+   name: RFr:knee~
+  chain: RFr
+   link: 4
+      x: 0
+      y: 0
+      z: 0
+[InterestPoint7]
+   name: LBk:elvtr
+  chain: LBk
+   link: 2
+      x: 0
+      y: 0
+      z: 0
+[InterestPoint8]
+   name: LBk:rotor
+  chain: LBk
+   link: 3
+      x: 0
+      y: 0
+      z: 0
+[InterestPoint9]
+   name: LBk:knee~
+  chain: LBk
+   link: 4
+      x: 0
+      y: 0
+      z: 0
+[InterestPoint10]
+   name: RBk:elvtr
+  chain: RBk
+   link: 2
+      x: 0
+      y: 0
+      z: 0
+[InterestPoint11]
+   name: RBk:rotor
+  chain: RBk
+   link: 3
+      x: 0
+      y: 0
+      z: 0
+[InterestPoint12]
+   name: RBk:knee~
+  chain: RBk
+   link: 4
+      x: 0
+      y: 0
+      z: 0
+[InterestPoint13]
+   name: NECK:tilt
+  chain: Camera
+   link: 2
+      x: 0
+      y: 0
+      z: 0
+[InterestPoint14]
+   name: NECK:pan~
+  chain: Camera
+   link: 3
+      x: 0
+      y: 0
+      z: 0
+[InterestPoint15]
+   name: NECK:nod~
+  chain: Camera
+   link: 4
+      x: 0
+      y: 0
+      z: 0
+[InterestPoint16]
+   name: MOUTH~~~~
+  chain: Mouth
+   link: 5
+      x: 0
+      y: 0
+      z: 0
+[InterestPoint17]
+   name: Base
+  chain: Camera
+   link: 0
+      x: 0
+      y: 0
+      z: 0
+[InterestPoint18]
+   name: LFrPaw
+  chain: LFr
+   link: 5
+      x: 0
+      y: 0
+      z: 0
+[InterestPoint19]
+   name: RFrPaw
+  chain: RFr
+   link: 5
+      x: 0
+      y: 0
+      z: 0
+[InterestPoint20]
+   name: LBkPaw
+  chain: LBk
+   link: 5
+      x: 0
+      y: 0
+      z: 0
+[InterestPoint21]
+   name: RBkPaw
+  chain: RBk
+   link: 5
+      x: 0
+      y: 0
+      z: 0
+[InterestPoint22]
+   name: Camera
+  chain: Camera
+   link: 6
+      x: 0
+      y: 0
+      z: 0
+[InterestPoint23]
+   name: NearIR
+  chain: NearIR
+   link: 6
+      x: 0
+      y: 0
+      z: 0
+[InterestPoint24]
+   name: FarIR
+  chain: FarIR
+   link: 6
+      x: 0
+      y: 0
+      z: 0
+[InterestPoint25]
+   name: ChestIR
+  chain: ChestIR
+   link: 3
+      x: 0
+      y: 0
+      z: 0
+[InterestPoint26]
+   name: UpperLChest
+  chain: Body
+   link: 0
+      x: 107.560
+      y: 23.448
+      z: 0
+[InterestPoint27]
+   name: UpperRChest
+  chain: Body
+   link: 0
+      x: 107.560
+      y: -23.448
+      z: 0
+[InterestPoint28]
+   name: LowerLChest
+  chain: Body
+   link: 0
+      x: 95.250
+      y: 29.631
+      z: -30.070
+[InterestPoint29]
+   name: LowerRChest
+  chain: Body
+   link: 0
+      x: 95.250
+      y: -29.631
+      z: -30.070
+[InterestPoint30]
+   name: LFrBelly
+  chain: Body
+   link: 0
+      x: 55.290
+      y: 20.238
+      z: -52.270
+[InterestPoint31]
+   name: RFrBelly
+  chain: Body
+   link: 0
+      x: 55.290
+      y: -20.238
+      z: -52.270
+[InterestPoint32]
+   name: LBkBelly
+  chain: Body
+   link: 0
+      x: -60.540
+      y: 14.238
+      z: -52.270
+[InterestPoint33]
+   name: RBkBelly
+  chain: Body
+   link: 0
+      x: -60.540
+      y: -14.238
+      z: -52.270
+[InterestPoint34]
+   name: LowerLRump
+  chain: Body
+   link: 0
+      x: -104.140
+      y: 29.631
+      z: -38.950
+[InterestPoint35]
+   name: LowerRRump
+  chain: Body
+   link: 0
+      x: -104.140
+      y: -29.631
+      z: -38.950
+[InterestPoint36]
+   name: UpperLRump
+  chain: Body
+   link: 0
+      x: -108.970
+      y: 29.631
+      z: 0
+[InterestPoint37]
+   name: UpperRRump
+  chain: Body
+   link: 0
+      x: -108.970
+      y: -29.631
+      z: 0
+[InterestPoint38]
+   name: LowerLeftLowerLip
+  chain: Mouth
+   link: 5
+      x: 40.851
+      y: 12.275
+      z: -16.128
+[InterestPoint39]
+   name: LowerRightLowerLip
+  chain: Mouth
+   link: 5
+      x: 40.851
+      y: 12.275
+      z: 16.128
+[InterestPoint40]
+   name: UpperLeftLowerLip
+  chain: Mouth
+   link: 5
+      x: 38.378
+      y: 11.203
+      z: -11.397
+[InterestPoint41]
+   name: UpperRightLowerLip
+  chain: Mouth
+   link: 5
+      x: 38.378
+      y: 11.203
+      z: 11.397
+[InterestPoint42]
+   name: LowerLeftUpperLip
+  chain: Mouth
+   link: 4
+      x: 79.518
+      y: -22.291
+      z: -11.397
+[InterestPoint43]
+   name: LowerRightUpperLip
+  chain: Mouth
+   link: 4
+      x: 79.518
+      y: -22.291
+      z: 11.397
+[InterestPoint44]
+   name: LowerLeftSnout
+  chain: Camera
+   link: 4
+      x: 54.223
+      y: -21.146
+      z: -37.291
+[InterestPoint45]
+   name: LowerRightSnout
+  chain: Camera
+   link: 4
+      x: 54.223
+      y: -21.146
+      z: 37.291
+[InterestPoint46]
+   name: UpperLeftSnout
+  chain: Camera
+   link: 4
+      x: 54.223
+      y: 7.605
+      z: -26.284
+[InterestPoint47]
+   name: UpperRightSnout
+  chain: Camera
+   link: 4
+      x: 54.223
+      y: 7.605
+      z: 26.284
+[InterestPoint48]
+   name: LeftMicrophone
+  chain: Camera
+   link: 4
+      x: -11.156
+      y: 14.897
+      z: -46.941
+[InterestPoint49]
+   name: RightMicrophone
+  chain: Camera
+   link: 4
+      x: -11.156
+      y: 14.897
+      z: 46.941
+[InterestPoint50]
+   name: HeadButton
+  chain: Camera
+   link: 4
+      x: -7.704
+      y: 41.192
+      z: 0
+[InterestPoint51]
+   name: ToeLFrPaw
+  chain: LFr
+   link: 5
+      x: 7.180
+      y: 29.548
+      z: 0
+[InterestPoint52]
+   name: ToeRFrPaw
+  chain: RFr
+   link: 5
+      x: 7.180
+      y: 29.548
+      z: 0
+[InterestPoint53]
+   name: ToeLBkPaw
+  chain: LBk
+   link: 5
+      x: -6.414
+      y: 27.759
+      z: 0
+[InterestPoint54]
+   name: ToeRBkPaw
+  chain: RBk
+   link: 5
+      x: -6.414
+      y: 27.759
+      z: 0
+[InterestPoint55]
+   name: LowerOuterFrontLFrShin
+  chain: LFr
+   link: 4
+      x: 59.298
+      y: 21.239
+      z: -24.557
+[InterestPoint56]
+   name: LowerInnerFrontRFrShin
+  chain: RFr
+   link: 4
+      x: 59.298
+      y: 21.239
+      z: -15.158
+[InterestPoint57]
+   name: LowerOuterFrontLBkShin
+  chain: LBk
+   link: 4
+      x: 41.172
+      y: -33.863
+      z: 24.557
+[InterestPoint58]
+   name: LowerInnerFrontRBkShin
+  chain: RBk
+   link: 4
+      x: 41.172
+      y: -33.863
+      z: 15.158
+[InterestPoint59]
+   name: LowerInnerFrontLFrShin
+  chain: LFr
+   link: 4
+      x: 59.298
+      y: 21.239
+      z: 15.158
+[InterestPoint60]
+   name: LowerOuterFrontRFrShin
+  chain: RFr
+   link: 4
+      x: 59.298
+      y: 21.239
+      z: 24.557
+[InterestPoint61]
+   name: LowerInnerFrontLBkShin
+  chain: LBk
+   link: 4
+      x: 41.172
+      y: -33.863
+      z: -15.158
+[InterestPoint62]
+   name: LowerOuterFrontRBkShin
+  chain: RBk
+   link: 4
+      x: 41.172
+      y: -33.863
+      z: -24.557
+[InterestPoint63]
+   name: LowerOuterMiddleLFrShin
+  chain: LFr
+   link: 4
+      x: 63.011
+      y: -15.573
+      z: -24.557
+[InterestPoint64]
+   name: LowerInnerMiddleRFrShin
+  chain: RFr
+   link: 4
+      x: 63.011
+      y: -15.573
+      z: -15.158
+[InterestPoint65]
+   name: LowerOuterMiddleLBkShin
+  chain: LBk
+   link: 4
+      x: 75.203
+      y: -8.342
+      z: 24.557
+[InterestPoint66]
+   name: LowerInnerMiddleRBkShin
+  chain: RBk
+   link: 4
+      x: 75.203
+      y: -8.342
+      z: 15.158
+[InterestPoint67]
+   name: LowerInnerMiddleLFrShin
+  chain: LFr
+   link: 4
+      x: 63.011
+      y: -15.573
+      z: 15.158
+[InterestPoint68]
+   name: LowerOuterMiddleRFrShin
+  chain: RFr
+   link: 4
+      x: 63.011
+      y: -15.573
+      z: 24.557
+[InterestPoint69]
+   name: LowerInnerMiddleLBkShin
+  chain: LBk
+   link: 4
+      x: 75.203
+      y: -8.342
+      z: -15.158
+[InterestPoint70]
+   name: LowerOuterMiddleRBkShin
+  chain: RBk
+   link: 4
+      x: 75.203
+      y: -8.342
+      z: -24.557
+[InterestPoint71]
+   name: LowerOuterBackLFrShin
+  chain: LFr
+   link: 4
+      x: 40.581
+      y: -26.402
+      z: -24.557
+[InterestPoint72]
+   name: LowerInnerBackRFrShin
+  chain: RFr
+   link: 4
+      x: 40.581
+      y: -26.402
+      z: -15.158
+[InterestPoint73]
+   name: LowerOuterBackLBkShin
+  chain: LBk
+   link: 4
+      x: 71.133
+      y: 8.187
+      z: 24.557
+[InterestPoint74]
+   name: LowerInnerBackRBkShin
+  chain: RBk
+   link: 4
+      x: 71.133
+      y: 8.187
+      z: 15.158
+[InterestPoint75]
+   name: LowerInnerBackLFrShin
+  chain: LFr
+   link: 4
+      x: 40.581
+      y: -26.402
+      z: 15.158
+[InterestPoint76]
+   name: LowerOuterBackRFrShin
+  chain: RFr
+   link: 4
+      x: 40.581
+      y: -26.402
+      z: 24.557
+[InterestPoint77]
+   name: LowerInnerBackLBkShin
+  chain: LBk
+   link: 4
+      x: 71.133
+      y: 8.187
+      z: -15.158
+[InterestPoint78]
+   name: LowerOuterBackRBkShin
+  chain: RBk
+   link: 4
+      x: 71.133
+      y: 8.187
+      z: -24.557
+[InterestPoint79]
+   name: MiddleOuterMiddleLFrShin
+  chain: LFr
+   link: 4
+      x: 42.057
+      y: -10.714
+      z: -27.747
+[InterestPoint80]
+   name: MiddleInnerMiddleRFrShin
+  chain: RFr
+   link: 4
+      x: 42.057
+      y: -10.714
+      z: -18.353
+[InterestPoint81]
+   name: MiddleOuterMiddleLBkShin
+  chain: LBk
+   link: 4
+      x: 41.625
+      y: -11.335
+      z: 27.747
+[InterestPoint82]
+   name: MiddleInnerMiddleRBkShin
+  chain: RBk
+   link: 4
+      x: 41.625
+      y: -11.335
+      z: 18.353
+[InterestPoint83]
+   name: MiddleInnerMiddleLFrShin
+  chain: LFr
+   link: 4
+      x: 42.057
+      y: -10.714
+      z: 18.353
+[InterestPoint84]
+   name: MiddleOuterMiddleRFrShin
+  chain: RFr
+   link: 4
+      x: 42.057
+      y: -10.714
+      z: 27.747
+[InterestPoint85]
+   name: MiddleInnerMiddleLBkShin
+  chain: LBk
+   link: 4
+      x: 41.625
+      y: -11.335
+      z: -18.353
+[InterestPoint86]
+   name: MiddleOuterMiddleRBkShin
+  chain: RBk
+   link: 4
+      x: 41.625
+      y: -11.335
+      z: -27.747
+[InterestPoint87]
+   name: UpperOuterFrontLFrShin
+  chain: LFr
+   link: 4
+      x: 29.289
+      y: 14.743
+      z: -23.426
+[InterestPoint88]
+   name: UpperInnerFrontRFrShin
+  chain: RFr
+   link: 4
+      x: 29.289
+      y: 14.743
+      z: -14.026
+[InterestPoint89]
+   name: UpperOuterFrontLBkShin
+  chain: LBk
+   link: 4
+      x: 2.812
+      y: -22.417
+      z: 23.426
+[InterestPoint90]
+   name: UpperInnerFrontRBkShin
+  chain: RBk
+   link: 4
+      x: 2.812
+      y: -22.417
+      z: 14.026
+[InterestPoint91]
+   name: UpperInnerFrontLFrShin
+  chain: LFr
+   link: 4
+      x: 29.289
+      y: 14.743
+      z: 14.026
+[InterestPoint92]
+   name: UpperOuterFrontRFrShin
+  chain: RFr
+   link: 4
+      x: 29.289
+      y: 14.743
+      z: 23.426
+[InterestPoint93]
+   name: UpperInnerFrontLBkShin
+  chain: LBk
+   link: 4
+      x: 2.812
+      y: -22.417
+      z: -14.026
+[InterestPoint94]
+   name: UpperOuterFrontRBkShin
+  chain: RBk
+   link: 4
+      x: 2.812
+      y: -22.417
+      z: -23.426
+[InterestPoint95]
+   name: UpperOuterBackLFrShin
+  chain: LFr
+   link: 4
+      x: 6.397
+      y: -20.060
+      z: -23.426
+[InterestPoint96]
+   name: UpperInnerBackRFrShin
+  chain: RFr
+   link: 4
+      x: 6.397
+      y: -20.060
+      z: -14.026
+[InterestPoint97]
+   name: UpperOuterBackLBkShin
+  chain: LBk
+   link: 4
+      x: 32.869
+      y: 9.622
+      z: 23.426
+[InterestPoint98]
+   name: UpperInnerBackRBkShin
+  chain: RBk
+   link: 4
+      x: 32.869
+      y: 9.622
+      z: 14.026
+[InterestPoint99]
+   name: UpperInnerBackLFrShin
+  chain: LFr
+   link: 4
+      x: 6.397
+      y: -20.060
+      z: 14.026
+[InterestPoint100]
+   name: UpperOuterBackRFrShin
+  chain: RFr
+   link: 4
+      x: 6.397
+      y: -20.060
+      z: 23.426
+[InterestPoint101]
+   name: UpperInnerBackLBkShin
+  chain: LBk
+   link: 4
+      x: 32.869
+      y: 9.622
+      z: -14.026
+[InterestPoint102]
+   name: UpperOuterBackRBkShin
+  chain: RBk
+   link: 4
+      x: 32.869
+      y: 9.622
+      z: -23.426
+[InterestPoint103]
+   name: LowerOuterFrontLFrThigh
+  chain: LFr
+   link: 3
+      x: 47.947
+      y: 14.539
+      z: 17.189
+[InterestPoint104]
+   name: LowerInnerFrontRFrThigh
+  chain: RFr
+   link: 3
+      x: 47.947
+      y: -5.043
+      z: -17.189
+[InterestPoint105]
+   name: LowerOuterFrontLBkThigh
+  chain: LBk
+   link: 3
+      x: 47.947
+      y: 14.539
+      z: 17.189
+[InterestPoint106]
+   name: LowerInnerFrontRBkThigh
+  chain: RBk
+   link: 3
+      x: 47.947
+      y: -5.043
+      z: -17.189
+[InterestPoint107]
+   name: LowerInnerFrontLFrThigh
+  chain: LFr
+   link: 3
+      x: 47.947
+      y: -5.043
+      z: 17.189
+[InterestPoint108]
+   name: LowerOuterFrontRFrThigh
+  chain: RFr
+   link: 3
+      x: 47.947
+      y: 14.539
+      z: -17.189
+[InterestPoint109]
+   name: LowerInnerFrontLBkThigh
+  chain: LBk
+   link: 3
+      x: 47.947
+      y: -5.043
+      z: 17.189
+[InterestPoint110]
+   name: LowerOuterFrontRBkThigh
+  chain: RBk
+   link: 3
+      x: 47.947
+      y: 14.539
+      z: -17.189
+[InterestPoint111]
+   name: LowerOuterBackLFrThigh
+  chain: LFr
+   link: 3
+      x: 47.947
+      y: 14.539
+      z: -17.189
+[InterestPoint112]
+   name: LowerInnerBackRFrThigh
+  chain: RFr
+   link: 3
+      x: 47.947
+      y: -5.043
+      z: 17.189
+[InterestPoint113]
+   name: LowerOuterBackLBkThigh
+  chain: LBk
+   link: 3
+      x: 47.947
+      y: 14.539
+      z: -17.189
+[InterestPoint114]
+   name: LowerInnerBackRBkThigh
+  chain: RBk
+   link: 3
+      x: 47.947
+      y: -5.043
+      z: 17.189
+[InterestPoint115]
+   name: LowerInnerBackLFrThigh
+  chain: LFr
+   link: 3
+      x: 47.947
+      y: -5.043
+      z: -17.189
+[InterestPoint116]
+   name: LowerOuterBackRFrThigh
+  chain: RFr
+   link: 3
+      x: 47.947
+      y: 14.539
+      z: 17.189
+[InterestPoint117]
+   name: LowerInnerBackLBkThigh
+  chain: LBk
+   link: 3
+      x: 47.947
+      y: -5.043
+      z: -17.189
+[InterestPoint118]
+   name: LowerOuterBackRBkThigh
+  chain: RBk
+   link: 3
+      x: 47.947
+      y: 14.539
+      z: 17.189
+[InterestPoint119]
+   name: UpperOuterFrontLFrThigh
+  chain: LFr
+   link: 3
+      x: 0
+      y: 10.310
+      z: 17.189
+[InterestPoint120]
+   name: UpperInnerFrontRFrThigh
+  chain: RFr
+   link: 3
+      x: 0
+      y: -5.043
+      z: -17.189
+[InterestPoint121]
+   name: UpperOuterFrontLBkThigh
+  chain: LBk
+   link: 3
+      x: 0
+      y: 10.310
+      z: 17.189
+[InterestPoint122]
+   name: UpperInnerFrontRBkThigh
+  chain: RBk
+   link: 3
+      x: 0
+      y: -5.043
+      z: -17.189
+[InterestPoint123]
+   name: UpperInnerFrontLFrThigh
+  chain: LFr
+   link: 3
+      x: 0
+      y: -5.043
+      z: 17.189
+[InterestPoint124]
+   name: UpperOuterFrontRFrThigh
+  chain: RFr
+   link: 3
+      x: 0
+      y: 10.310
+      z: -17.189
+[InterestPoint125]
+   name: UpperInnerFrontLBkThigh
+  chain: LBk
+   link: 3
+      x: 0
+      y: -5.043
+      z: 17.189
+[InterestPoint126]
+   name: UpperOuterFrontRBkThigh
+  chain: RBk
+   link: 3
+      x: 0
+      y: 10.310
+      z: -17.189
+[InterestPoint127]
+   name: UpperOuterBackLFrThigh
+  chain: LFr
+   link: 3
+      x: 0
+      y: 10.310
+      z: -17.189
+[InterestPoint128]
+   name: UpperInnerBackRFrThigh
+  chain: RFr
+   link: 3
+      x: 0
+      y: -5.043
+      z: 17.189
+[InterestPoint129]
+   name: UpperOuterBackLBkThigh
+  chain: LBk
+   link: 3
+      x: 0
+      y: 10.310
+      z: -17.189
+[InterestPoint130]
+   name: UpperInnerBackRBkThigh
+  chain: RBk
+   link: 3
+      x: 0
+      y: -5.043
+      z: 17.189
+[InterestPoint131]
+   name: UpperInnerBackLFrThigh
+  chain: LFr
+   link: 3
+      x: 0
+      y: -5.043
+      z: -17.189
+[InterestPoint132]
+   name: UpperOuterBackRFrThigh
+  chain: RFr
+   link: 3
+      x: 0
+      y: 10.310
+      z: 17.189
+[InterestPoint133]
+   name: UpperInnerBackLBkThigh
+  chain: LBk
+   link: 3
+      x: 0
+      y: -5.043
+      z: -17.189
+[InterestPoint134]
+   name: UpperOuterBackRBkThigh
+  chain: RBk
+   link: 3
+      x: 0
+      y: 10.310
+      z: 17.189
diff -urdN ../Tekkotsu_2.2.1/project/ms/config/tekkotsu.cfg ./project/ms/config/tekkotsu.cfg
--- ../Tekkotsu_2.2.1/project/ms/config/tekkotsu.cfg	Fri Nov 12 17:07:39 2004
+++ ./project/ms/config/tekkotsu.cfg	Wed Dec 22 21:21:00 2004
@@ -1,9 +1,9 @@
 ##################################################################
 ######################   Tekkotsu config   #######################
 ##################################################################
-##################### $Name: HEAD $ ######################
-####################### $Revision: 1.1 $ ########################
-################## $Date: 2004/12/23 08:41:24 $ ##################
+##################### $Name: HEAD $ ######################
+####################### $Revision: 1.1 $ ########################
+################## $Date: 2004/12/23 08:41:24 $ ##################
 ##################################################################
 #
 # Format:
@@ -241,15 +241,18 @@
 <ERS-2*>
 <ERS-210>
 kinematics=/ms/config/ers210.kin
+kinematic_chains=Body
 kinematic_chains=Mouth
 </ERS-210>
 <ERS-220>
 kinematics=/ms/config/ers220.kin
+kinematic_chains=Body
 </ERS-220>
 kinematic_chains=IR
 </ERS-2*>
 <ERS-7>
 kinematics=/ms/config/ers7.kin
+kinematic_chains=Body
 kinematic_chains=Mouth
 kinematic_chains=NearIR
 kinematic_chains=FarIR
@@ -306,6 +309,10 @@
 max_head_pan_speed=5.78140315
 max_head_roll_speed=5.78140315
 </ERS-7>
+
+# If non-zero, robot should attempt to change directions instantaniously
+# If zero, robot should change directions more fluidly (following some internal acceleration calibration)
+inf_walk_accel=0
 
 console_port=10003
 stderr_port=10004
diff -urdN ../Tekkotsu_2.2.1/project/ms/data/motion/dance.mot ./project/ms/data/motion/dance.mot
--- ../Tekkotsu_2.2.1/project/ms/data/motion/dance.mot	Fri May  2 00:57:51 2003
+++ ./project/ms/data/motion/dance.mot	Wed Dec 22 21:21:00 2004
@@ -1,6 +1,6 @@
 #MSq
 radians
-delay	803
+advanceTime	803
 LFr:rotor	-0.253956
 LFr:elvtr	-0.131986
 LFr:knee~	0.470636
@@ -16,7 +16,7 @@
 NECK:tilt	0
 NECK:pan~	0
 NECK:roll	0
-delay	300
+advanceTime	300
 LFr:rotor	-0.263956
 LFr:elvtr	-0.141986
 LFr:knee~	0.484838
@@ -30,7 +30,7 @@
 RBk:elvtr	-0.162013
 RBk:knee~	2.27489
 NECK:tilt	0
-delay	300
+advanceTime	300
 LFr:rotor	-0.853081
 LFr:elvtr	-0.133808
 LFr:knee~	0.237025
@@ -44,7 +44,7 @@
 RBk:elvtr	0.412627
 RBk:knee~	2.56563
 NECK:tilt	-0.3
-delay	500
+advanceTime	500
 LFr:rotor	-0.848842
 LFr:elvtr	-0.133808
 LFr:knee~	0.231227
@@ -57,7 +57,7 @@
 RBk:elvtr	0.415625
 RBk:knee~	2.56563
 NECK:tilt	-0.5
-delay	500
+advanceTime	500
 LFr:rotor	-1.24884
 LFr:elvtr	-0.193808
 LFr:knee~	0.231227
@@ -70,7 +70,7 @@
 RBk:rotor	-0.851249
 RBk:elvtr	0.214532
 RBk:knee~	1.75006
-delay	1156
+advanceTime	1156
 LFr:rotor	2.004
 LFr:elvtr	-0.005817
 LFr:knee~	0.007958
@@ -79,14 +79,14 @@
 RFr:knee~	0.005634
 LBk:elvtr	0.215208
 RBk:knee~	1.75006
-delay	916
+advanceTime	916
 LFr:rotor	0.05999
 LFr:elvtr	0.005817
 LFr:knee~	2.60796
 RFr:rotor	0.055711
 RFr:elvtr	0.003084
 RFr:knee~	2.60563
-delay	916
+advanceTime	916
 LFr:rotor	2.004
 LFr:elvtr	-0.005817
 LFr:knee~	0.007958
@@ -99,7 +99,7 @@
 RBk:rotor	-0.851249
 RBk:elvtr	0.214532
 RBk:knee~	1.75006
-delay	914
+advanceTime	914
 LFr:rotor	0
 LFr:elvtr	0
 LFr:knee~	2.6
diff -urdN ../Tekkotsu_2.2.1/project/ms/data/motion/gu_back.mot ./project/ms/data/motion/gu_back.mot
--- ../Tekkotsu_2.2.1/project/ms/data/motion/gu_back.mot	Fri May  2 00:57:51 2003
+++ ./project/ms/data/motion/gu_back.mot	Wed Dec 22 21:21:00 2004
@@ -1,6 +1,6 @@
 #MSq
 radians
-delay	746
+advanceTime	746
 LFr:rotor	0
 LFr:elvtr	0
 LFr:knee~	0
@@ -16,7 +16,7 @@
 NECK:tilt	-1.5708
 NECK:pan~	0
 NECK:roll	0
-delay	881
+advanceTime	881
 LFr:rotor	0
 LFr:knee~	0
 RFr:rotor	0
@@ -25,7 +25,7 @@
 LBk:knee~	2.5
 RBk:rotor	-1.8
 RBk:knee~	2.5
-delay	500
+advanceTime	500
 LFr:rotor	1
 LFr:elvtr	0
 LFr:knee~	0.5
diff -urdN ../Tekkotsu_2.2.1/project/ms/data/motion/gu_front.mot ./project/ms/data/motion/gu_front.mot
--- ../Tekkotsu_2.2.1/project/ms/data/motion/gu_front.mot	Fri May  2 00:57:51 2003
+++ ./project/ms/data/motion/gu_front.mot	Wed Dec 22 21:21:00 2004
@@ -1,6 +1,6 @@
 #MSq
 radians
-delay	501
+advanceTime	501
 LFr:rotor	0
 LFr:elvtr	0
 LFr:knee~	0
@@ -16,7 +16,7 @@
 NECK:tilt	0
 NECK:pan~	0
 NECK:roll	0
-delay	881
+advanceTime	881
 LFr:rotor	0
 LFr:elvtr	1.6
 RFr:rotor	0
@@ -25,7 +25,7 @@
 LBk:knee~	2.5
 RBk:rotor	1
 RBk:knee~	2.5
-delay	994
+advanceTime	994
 LFr:rotor	1.8
 LFr:elvtr	1.6
 LFr:knee~	0
@@ -34,7 +34,7 @@
 RFr:knee~	0
 LBk:rotor	-1.8
 RBk:rotor	-1.8
-delay	881
+advanceTime	881
 LFr:rotor	1.8
 LFr:elvtr	0
 LFr:knee~	2.5
@@ -43,7 +43,7 @@
 RFr:knee~	2.5
 LBk:rotor	-1.8
 RBk:rotor	-1.8
-delay	705
+advanceTime	705
 LFr:rotor	1
 LFr:elvtr	0
 LFr:knee~	0.5
diff -urdN ../Tekkotsu_2.2.1/project/ms/data/motion/gu_side.mot ./project/ms/data/motion/gu_side.mot
--- ../Tekkotsu_2.2.1/project/ms/data/motion/gu_side.mot	Fri May  2 00:57:51 2003
+++ ./project/ms/data/motion/gu_side.mot	Wed Dec 22 21:21:00 2004
@@ -1,6 +1,6 @@
 #MSq
 radians
-delay	501
+advanceTime	501
 LFr:rotor	0
 LFr:elvtr	0
 LFr:knee~	0
@@ -16,7 +16,7 @@
 NECK:tilt	0
 NECK:pan~	0
 NECK:roll	0
-delay	881
+advanceTime	881
 LFr:rotor	2
 LFr:elvtr	0
 LFr:knee~	2.5
@@ -29,7 +29,7 @@
 RBk:rotor	2
 RBk:elvtr	0
 RBk:knee~	2.5
-delay	700
+advanceTime	700
 LFr:rotor	2
 LFr:elvtr	1.6
 LFr:knee~	2.5
@@ -40,7 +40,7 @@
 LBk:elvtr	1.6
 RBk:rotor	2
 RBk:elvtr	1.6
-delay	1137
+advanceTime	1137
 LFr:rotor	1
 LFr:elvtr	0
 LFr:knee~	0.5
diff -urdN ../Tekkotsu_2.2.1/project/ms/data/motion/k_bump.mot ./project/ms/data/motion/k_bump.mot
--- ../Tekkotsu_2.2.1/project/ms/data/motion/k_bump.mot	Fri May  2 00:57:52 2003
+++ ./project/ms/data/motion/k_bump.mot	Wed Dec 22 21:21:00 2004
@@ -1,6 +1,6 @@
 #MSq
 radians
-delay	652
+advanceTime	652
 LFr:rotor	0.185475
 LFr:elvtr	0.00453314
 LFr:knee~	1.80106
@@ -16,7 +16,7 @@
 NECK:tilt	0
 NECK:pan~	0
 NECK:roll	0
-delay	262
+advanceTime	262
 LFr:rotor	0.735959
 LFr:elvtr	0.00266154
 LFr:knee~	1.05702
@@ -29,7 +29,7 @@
 RBk:rotor	-1.15181
 RBk:elvtr	0.255151
 RBk:knee~	1.84981
-delay	540
+advanceTime	540
 LFr:rotor	-0.785992
 LFr:elvtr	0.00638608
 LFr:knee~	2.07946
@@ -42,7 +42,7 @@
 RBk:rotor	0.101941
 RBk:elvtr	0.153667
 RBk:knee~	1.3203
-delay	400
+advanceTime	400
 LFr:rotor	-0.785992
 LFr:elvtr	0.00638608
 LFr:knee~	2.07946
diff -urdN ../Tekkotsu_2.2.1/project/ms/data/motion/k_diag.mot ./project/ms/data/motion/k_diag.mot
--- ../Tekkotsu_2.2.1/project/ms/data/motion/k_diag.mot	Fri May  2 00:57:52 2003
+++ ./project/ms/data/motion/k_diag.mot	Wed Dec 22 21:21:00 2004
@@ -1,6 +1,6 @@
 #MSq
 radians
-delay	644
+advanceTime	644
 LFr:rotor	-0.145629
 LFr:elvtr	0.405273
 LFr:knee~	1.82849
@@ -16,7 +16,7 @@
 NECK:tilt	0
 NECK:pan~	0
 NECK:roll	0
-delay	569
+advanceTime	569
 LFr:rotor	-1.14237
 LFr:elvtr	1.56166
 LFr:knee~	1.96605
@@ -31,7 +31,7 @@
 RBk:knee~	1.34195
 NECK:tilt	-1.2
 NECK:pan~	-1.5
-delay	996
+advanceTime	996
 LFr:rotor	0
 LFr:elvtr	0.5
 LFr:knee~	0
diff -urdN ../Tekkotsu_2.2.1/project/ms/data/motion/k_dive.mot ./project/ms/data/motion/k_dive.mot
--- ../Tekkotsu_2.2.1/project/ms/data/motion/k_dive.mot	Fri May  2 00:57:52 2003
+++ ./project/ms/data/motion/k_dive.mot	Wed Dec 22 21:21:00 2004
@@ -1,6 +1,6 @@
 #MSq
 radians
-delay	613
+advanceTime	613
 LFr:rotor	0.3
 LFr:elvtr	0.4
 LFr:knee~	1.6
@@ -16,7 +16,7 @@
 NECK:tilt	0.5
 NECK:pan~	1.5
 NECK:roll	0
-delay	259
+advanceTime	259
 LFr:rotor	1.03
 LFr:elvtr	0.09
 LFr:knee~	0.9
@@ -29,7 +29,7 @@
 RBk:rotor	-1.17
 RBk:elvtr	0.14
 RBk:knee~	1.74
-delay	215
+advanceTime	215
 LFr:rotor	1.53
 LFr:elvtr	-0.11
 LFr:knee~	0.72
@@ -42,7 +42,7 @@
 RBk:rotor	-1.45
 RBk:elvtr	0.54
 RBk:knee~	2.35
-delay	472
+advanceTime	472
 LFr:rotor	0.2
 LFr:elvtr	0.4
 LFr:knee~	1.5
@@ -55,7 +55,7 @@
 RBk:rotor	-1.13
 RBk:elvtr	0.14
 RBk:knee~	1.74
-delay	542
+advanceTime	542
 LFr:elvtr	0.15
 LFr:knee~	0
 RFr:elvtr	0.15
@@ -66,7 +66,7 @@
 RBk:rotor	-0.2
 RBk:elvtr	0.5
 RBk:knee~	0.2
-delay	50
+advanceTime	50
 LFr:rotor	0.2
 RFr:rotor	0.2
 LBk:rotor	-0.2
@@ -74,7 +74,7 @@
 RBk:rotor	-0.2
 RBk:knee~	0.2
 NECK:pan~	1.5
-delay	458
+advanceTime	458
 LFr:rotor	0
 LFr:elvtr	0.15
 RFr:rotor	0
@@ -83,7 +83,7 @@
 LBk:knee~	1.5
 RBk:rotor	0
 RBk:knee~	1.5
-delay	426
+advanceTime	426
 LFr:rotor	-1.2
 LFr:elvtr	0.5
 RFr:rotor	-1.2
@@ -91,7 +91,7 @@
 LBk:rotor	1.2
 RBk:rotor	1.2
 NECK:pan~	1.5
-delay	100
+advanceTime	100
 LFr:rotor	-1.2
 LFr:elvtr	0.5
 RFr:rotor	-1.2
@@ -100,7 +100,7 @@
 LBk:elvtr	0.5
 RBk:rotor	1.2
 RBk:elvtr	0.5
-delay	426
+advanceTime	426
 LFr:rotor	0
 LFr:elvtr	1.5
 LFr:knee~	0
@@ -111,12 +111,12 @@
 LBk:elvtr	1.5
 RBk:rotor	0
 RBk:elvtr	1.5
-delay	528
+advanceTime	528
 LFr:knee~	1.5
 RFr:knee~	1.5
 LBk:knee~	1.5
 RBk:knee~	1.5
-delay	500
+advanceTime	500
 LFr:rotor	0
 LFr:elvtr	1.5
 LFr:knee~	1.5
diff -urdN ../Tekkotsu_2.2.1/project/ms/data/motion/k_fwd.mot ./project/ms/data/motion/k_fwd.mot
--- ../Tekkotsu_2.2.1/project/ms/data/motion/k_fwd.mot	Fri May  2 00:57:52 2003
+++ ./project/ms/data/motion/k_fwd.mot	Wed Dec 22 21:21:00 2004
@@ -1,6 +1,6 @@
 #MSq
 radians
-delay	355
+advanceTime	355
 LFr:rotor	1
 LFr:elvtr	-0.2
 LFr:knee~	1
@@ -16,7 +16,7 @@
 NECK:tilt	-0.3
 NECK:pan~	0
 NECK:roll	0
-delay	728
+advanceTime	728
 LFr:elvtr	-0.2
 LFr:knee~	0.5
 RFr:elvtr	-0.2
@@ -28,14 +28,14 @@
 RBk:elvtr	0.5
 RBk:knee~	2.5
 NECK:tilt	-0.5
-delay	120
+advanceTime	120
 LFr:rotor	1
 LFr:elvtr	0.1
 LFr:knee~	0.5
 RFr:rotor	1
 RFr:elvtr	0.1
 RFr:knee~	0.5
-delay	390
+advanceTime	390
 LFr:rotor	2.1
 LFr:elvtr	0.1
 LFr:knee~	1.6
@@ -43,7 +43,7 @@
 RFr:elvtr	0.1
 RFr:knee~	1.6
 NECK:tilt	-0.5
-delay	332
+advanceTime	332
 LFr:rotor	2.1
 LFr:elvtr	-0.3
 RFr:rotor	2.1
@@ -53,7 +53,7 @@
 RBk:rotor	-2
 RBk:knee~	2.5
 NECK:tilt	0.2
-delay	355
+advanceTime	355
 LFr:rotor	1.5
 LFr:knee~	1.6
 RFr:rotor	1.5
@@ -62,7 +62,7 @@
 LBk:knee~	1.5
 RBk:rotor	-1
 RBk:knee~	1.5
-delay	564
+advanceTime	564
 LFr:rotor	1
 LFr:elvtr	-0.3
 LFr:knee~	0
@@ -72,7 +72,7 @@
 LBk:elvtr	0.5
 RBk:elvtr	0.5
 NECK:tilt	0.2
-delay	352
+advanceTime	352
 LFr:rotor	1
 LFr:elvtr	-0.2
 LFr:knee~	1
diff -urdN ../Tekkotsu_2.2.1/project/ms/data/motion/k_grab.mot ./project/ms/data/motion/k_grab.mot
--- ../Tekkotsu_2.2.1/project/ms/data/motion/k_grab.mot	Fri May  2 00:57:52 2003
+++ ./project/ms/data/motion/k_grab.mot	Wed Dec 22 21:21:00 2004
@@ -1,6 +1,6 @@
 #MSq
 radians
-delay	501
+advanceTime	501
 LFr:rotor	1.2
 LFr:elvtr	-0.2
 LFr:knee~	0.5
@@ -16,7 +16,7 @@
 NECK:tilt	0
 NECK:pan~	0
 NECK:roll	0
-delay	1314
+advanceTime	1314
 LBk:rotor	-2.5
 LBk:elvtr	1
 LBk:knee~	2.5
@@ -25,31 +25,31 @@
 RBk:knee~	2.5
 NECK:tilt	0.5
 NECK:pan~	1.5
-delay	881
+advanceTime	881
 LBk:rotor	-1
 LBk:elvtr	0.5
 LBk:knee~	0
 RBk:rotor	-1
 RBk:elvtr	0.5
 RBk:knee~	0
-delay	400
+advanceTime	400
 LFr:elvtr	-0.2
 RFr:elvtr	-0.2
-delay	200
+advanceTime	200
 LFr:rotor	1.2
 LFr:elvtr	0.1
 LFr:knee~	0.5
 RFr:rotor	1.2
 RFr:elvtr	0.1
 RFr:knee~	0.5
-delay	352
+advanceTime	352
 LFr:rotor	1.9
 LFr:elvtr	0.1
 LFr:knee~	-0.5
 RFr:rotor	1.9
 RFr:elvtr	0.1
 RFr:knee~	-0.5
-delay	800
+advanceTime	800
 LFr:rotor	1.9
 LFr:elvtr	-0.2
 LFr:knee~	-0.5
@@ -58,7 +58,7 @@
 RFr:knee~	-0.5
 LBk:rotor	-1
 RBk:rotor	-1
-delay	852
+advanceTime	852
 LFr:rotor	-0.5
 LFr:elvtr	-0.1
 LFr:knee~	0
@@ -67,7 +67,7 @@
 RFr:knee~	0
 LBk:rotor	-0.2
 RBk:rotor	-0.2
-delay	100
+advanceTime	100
 LFr:rotor	-0.5
 LFr:elvtr	-0.1
 LFr:knee~	0
@@ -76,7 +76,7 @@
 RFr:knee~	0
 LBk:rotor	-0.2
 RBk:rotor	-0.2
-delay	710
+advanceTime	710
 LFr:rotor	1.5
 LFr:elvtr	1
 LFr:knee~	1.5
@@ -89,7 +89,7 @@
 RBk:rotor	-2
 RBk:elvtr	0.5
 RBk:knee~	0
-delay	881
+advanceTime	881
 LFr:rotor	1
 LFr:elvtr	0
 LFr:knee~	0.5
@@ -103,10 +103,10 @@
 RBk:elvtr	0
 RBk:knee~	2.5
 NECK:pan~	1.5
-delay	1000
+advanceTime	1000
 LBk:rotor	-1
 RBk:rotor	-1
-delay	1
+advanceTime	1
 LFr:rotor	1
 LFr:elvtr	0
 LFr:knee~	0.5
diff -urdN ../Tekkotsu_2.2.1/project/ms/data/motion/k_head.mot ./project/ms/data/motion/k_head.mot
--- ../Tekkotsu_2.2.1/project/ms/data/motion/k_head.mot	Fri May  2 00:57:52 2003
+++ ./project/ms/data/motion/k_head.mot	Wed Dec 22 21:21:00 2004
@@ -1,6 +1,6 @@
 #MSq
 radians
-delay	644
+advanceTime	644
 LFr:rotor	-0.145629
 LFr:elvtr	0.405273
 LFr:knee~	1.82849
@@ -16,7 +16,7 @@
 NECK:tilt	0
 NECK:pan~	0
 NECK:roll	0
-delay	569
+advanceTime	569
 LFr:rotor	-1.14237
 LFr:elvtr	1.56166
 LFr:knee~	1.96605
@@ -31,7 +31,7 @@
 RBk:knee~	1.34195
 NECK:tilt	-1.2
 NECK:pan~	-1.5
-delay	996
+advanceTime	996
 LFr:rotor	-0.743775
 LFr:elvtr	-0.191986
 LFr:knee~	2.33428
diff -urdN ../Tekkotsu_2.2.1/project/ms/data/motion/k_heads.mot ./project/ms/data/motion/k_heads.mot
--- ../Tekkotsu_2.2.1/project/ms/data/motion/k_heads.mot	Fri May  2 00:57:52 2003
+++ ./project/ms/data/motion/k_heads.mot	Wed Dec 22 21:21:00 2004
@@ -1,6 +1,6 @@
 #MSq
 radians
-delay	644
+advanceTime	644
 LFr:rotor	-0.145629
 LFr:elvtr	0.405273
 LFr:knee~	1.82849
@@ -16,7 +16,7 @@
 NECK:tilt	0
 NECK:pan~	0
 NECK:roll	0
-delay	569
+advanceTime	569
 LFr:rotor	-1.14237
 LFr:elvtr	1.56166
 LFr:knee~	1.96605
@@ -31,7 +31,7 @@
 RBk:knee~	1.34195
 NECK:tilt	-1.2
 NECK:pan~	-1.5
-delay	996
+advanceTime	996
 LFr:rotor	-0.743775
 LFr:elvtr	-0.191986
 LFr:knee~	2.33428
diff -urdN ../Tekkotsu_2.2.1/project/ms/data/motion/k_hold.mot ./project/ms/data/motion/k_hold.mot
--- ../Tekkotsu_2.2.1/project/ms/data/motion/k_hold.mot	Fri May  2 00:57:52 2003
+++ ./project/ms/data/motion/k_hold.mot	Wed Dec 22 21:21:00 2004
@@ -1,6 +1,6 @@
 #MSq
 radians
-delay	553
+advanceTime	553
 LFr:rotor	0.6
 LFr:elvtr	-0.1
 LFr:knee~	1.57
@@ -16,7 +16,7 @@
 NECK:tilt	0.349066
 NECK:pan~	1.5708
 NECK:roll	0
-delay	1042
+advanceTime	1042
 LFr:rotor	0.6
 LFr:elvtr	-0.1
 LFr:knee~	1.57
diff -urdN ../Tekkotsu_2.2.1/project/ms/data/motion/k_punch.mot ./project/ms/data/motion/k_punch.mot
--- ../Tekkotsu_2.2.1/project/ms/data/motion/k_punch.mot	Fri May  2 00:57:52 2003
+++ ./project/ms/data/motion/k_punch.mot	Wed Dec 22 21:21:00 2004
@@ -1,6 +1,6 @@
 #MSq
 radians
-delay	595
+advanceTime	595
 LFr:rotor	0.183246
 LFr:elvtr	0.556069
 LFr:knee~	1.36377
@@ -16,18 +16,18 @@
 NECK:tilt	0
 NECK:pan~	0
 NECK:roll	0
-delay	500
+advanceTime	500
 LFr:rotor	0
 LFr:elvtr	0
 LFr:knee~	2.5
-delay	710
+advanceTime	710
 LFr:rotor	2
 LFr:knee~	1
 RFr:knee~	1.68938
 LBk:knee~	1.30206
-delay	100
+advanceTime	100
 LFr:rotor	2
-delay	500
+advanceTime	500
 LFr:rotor	1
 LFr:elvtr	0
 LFr:knee~	1
@@ -40,7 +40,7 @@
 RBk:rotor	-0.870673
 RBk:elvtr	-0.110773
 RBk:knee~	1.49363
-delay	500
+advanceTime	500
 LFr:rotor	0.108853
 LFr:elvtr	0.325006
 LFr:knee~	1.61054
diff -urdN ../Tekkotsu_2.2.1/project/ms/data/motion/pan_head.mot ./project/ms/data/motion/pan_head.mot
--- ../Tekkotsu_2.2.1/project/ms/data/motion/pan_head.mot	Sat Nov 22 15:34:39 2003
+++ ./project/ms/data/motion/pan_head.mot	Wed Dec 22 21:21:00 2004
@@ -1,11 +1,11 @@
 #MSq
 degrees
-delay 50
+advanceTime 50
 NECK:tilt	15
 NECK:roll	0
-delay	850
+advanceTime	850
 NECK:pan~	-45
-delay	900
+advanceTime	900
 NECK:pan~	45
 NECK:tilt	15
 NECK:roll	0
diff -urdN ../Tekkotsu_2.2.1/project/templates/behavior_header.h ./project/templates/behavior_header.h
--- ../Tekkotsu_2.2.1/project/templates/behavior_header.h	Thu Nov 11 15:35:00 2004
+++ ./project/templates/behavior_header.h	Thu Nov 11 15:35:00 2004
@@ -41,7 +41,7 @@
  * @author YOURNAMEHERE (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/project/templates/header.h ./project/templates/header.h
--- ../Tekkotsu_2.2.1/project/templates/header.h	Tue Aug 24 21:09:24 2004
+++ ./project/templates/header.h	Tue Aug 24 21:09:24 2004
@@ -15,7 +15,7 @@
  * @author YOURNAMEHERE (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/project/templates/implementation.cc ./project/templates/implementation.cc
--- ../Tekkotsu_2.2.1/project/templates/implementation.cc	Tue Aug 24 21:09:24 2004
+++ ./project/templates/implementation.cc	Tue Aug 24 21:09:24 2004
@@ -5,7 +5,7 @@
  * @author YOURNAMEHERE (Creator)
  *
  * $Author: ejt $
- * $Name: HEAD $
+ * $Name: HEAD $
  * $Revision: 1.1 $
  * $State: Exp $
  * $Date: 2004/12/23 08:41:24 $
diff -urdN ../Tekkotsu_2.2.1/tools/buildRelease ./tools/buildRelease
--- ../Tekkotsu_2.2.1/tools/buildRelease	Tue Nov 16 22:36:00 2004
+++ ./tools/buildRelease	Wed Dec 22 20:52:13 2004
@@ -52,7 +52,7 @@
 	exit 1;
 fi;
 
-if [ `grep -c "(v$1," docs/html/index.html` -eq 0 ] ; then
+if [ `grep -c "(v$1)" docs/html/index.html` -eq 0 ] ; then
 	echo "Version mismatch with docs/html/index.html - you forgot to update the documentation link's text";
 	exit 1;
 fi;
@@ -86,6 +86,7 @@
 
 echo "Building patch files..."
 cd ${tmp};
+rm -rf Tekkotsu_$2
 cvs -q export -r ${oldtag} -d Tekkotsu_$2 Tekkotsu
 cd Tekkotsu_$1;
 diff -urdN ../Tekkotsu_$2 . > "${tmp}/Tekkotsu_patch_$2_to_$1.diff";
@@ -213,6 +214,7 @@
 
 echo "Building TekkotsuMon tarball..."
 cd ${tmp};
+rm -rf Tekkotsu_mon_$1;
 cp -r Tekkotsu_$1/tools/mon Tekkotsu_mon_$1;
 tar -cvzf Tekkotsu_mon_$1.tar.gz Tekkotsu_mon_$1;
 
@@ -235,4 +237,4 @@
 echo "Done!"
 echo ""
 echo "If you disabled robot access on the staging website, don't forget to"
-echo "turn it back on!"
+echo "turn it back on for the real site when you copy up the files!"
diff -urdN ../Tekkotsu_2.2.1/tools/convertmot/tekkotsu.cfg ./tools/convertmot/tekkotsu.cfg
--- ../Tekkotsu_2.2.1/tools/convertmot/tekkotsu.cfg	Mon Nov  8 16:48:19 2004
+++ ./tools/convertmot/tekkotsu.cfg	Mon Nov  8 16:48:19 2004
@@ -1,7 +1,7 @@
 ##################################################################
 ################   Tekkotsu::convertmot config   #################
 ##################################################################
-##################### $Name: HEAD $ ######################
+##################### $Name: HEAD $ ######################
 ####################### $Revision: 1.1 $ ########################
 ################## $Date: 2004/12/23 08:41:24 $ ##################
 ##################################################################
diff -urdN ../Tekkotsu_2.2.1/tools/makelowercase ./tools/makelowercase
--- ../Tekkotsu_2.2.1/tools/makelowercase	Tue Nov 16 18:52:32 2004
+++ ./tools/makelowercase	Tue Nov 16 23:48:22 2004
@@ -11,11 +11,14 @@
 for x in $* ; do
 	dir=`echo "$x" | sed 's@\(.*\)/.*@\1@'`;
 	file=`echo "$x" | sed 's@\(.*\)/@@'`;
-	pushd "$dir" > /dev/null;
-	if [ -r "$file" ] ; then
-		conv="`echo $file | tr '[A-Z]' '[a-z]'`";
-		if [ "$file" != "$conv" ] ; then
-			if [ -e "$conv" -a ! "$file" -ef "$conv" ] ; then
+	if [ ! -r "$x" ] ; then
+		if [ "$file" != "*" ] ; then
+			echo "WARNING: Could not read '$x'";
+		fi;
+	else
+		conv="$dir/`echo $file | tr '[A-Z]' '[a-z]'`";
+		if [ "$dir/$file" != "$conv" ] ; then
+			if [ -e "$conv" -a ! "$dir/$file" -ef "$conv" ] ; then
 				echo "ERROR: $conv already exists (from $x)";
 				echo "exiting..."
 				exit 1;
@@ -23,12 +26,11 @@
 			#wish i could do this:
 			# mv "$x" "$conv";
 			#but cygwin doesn't like that...
-			mv "$file" "$file"_tmp;
-			mv "$file"_tmp "$conv";
+			mv "$dir/$file" "$dir/$file"_tmp;
+			mv "$dir/$file"_tmp "$conv";
 		fi;
 		if [ $recurse -gt 0 -a -d "$conv" ] ; then
 			"$0" -r "$conv"/*;
 		fi;
 	fi;
-	popd > /dev/null;
 done;
diff -urdN ../Tekkotsu_2.2.1/tools/makeuppercase ./tools/makeuppercase
--- ../Tekkotsu_2.2.1/tools/makeuppercase	Tue Nov 16 18:52:32 2004
+++ ./tools/makeuppercase	Tue Nov 16 23:48:23 2004
@@ -11,11 +11,14 @@
 for x in $* ; do
 	dir=`echo "$x" | sed 's@\(.*\)/.*@\1@'`;
 	file=`echo "$x" | sed 's@\(.*\)/@@'`;
-	pushd "$dir" > /dev/null;
-	if [ -r "$file" ] ; then
-		conv="`echo $file | tr '[a-z]' '[A-Z]'`";
-		if [ "$file" != "$conv" ] ; then
-			if [ -e "$conv" -a ! "$file" -ef "$conv" ] ; then
+	if [ ! -r "$x" ] ; then
+		if [ "$file" != "*" ] ; then
+			echo "WARNING: Could not read '$x'";
+		fi;
+	else
+		conv="$dir/`echo $file | tr '[a-z]' '[A-Z]'`";
+		if [ "$dir/$file" != "$conv" ] ; then
+			if [ -e "$conv" -a ! "$dir/$file" -ef "$conv" ] ; then
 				echo "ERROR: $conv already exists (from $x)";
 				echo "exiting..."
 				exit 1;
@@ -23,12 +26,11 @@
 			#wish i could do this:
 			# mv "$x" "$conv";
 			#but cygwin doesn't like that...
-			mv "$file" "$file"_tmp;
-			mv "$file"_tmp "$conv";
+			mv "$dir/$file" "$dir/$file"_tmp;
+			mv "$dir/$file"_tmp "$conv";
 		fi;
 		if [ $recurse -gt 0 -a -d "$conv" ] ; then
 			"$0" -r "$conv"/*;
 		fi;
 	fi;
-	popd > /dev/null;
 done;
diff -urdN ../Tekkotsu_2.2.1/tools/mon/org/tekkotsu/mon/SketchGUI.java ./tools/mon/org/tekkotsu/mon/SketchGUI.java
--- ../Tekkotsu_2.2.1/tools/mon/org/tekkotsu/mon/SketchGUI.java	Tue Sep 28 14:56:12 2004
+++ ./tools/mon/org/tekkotsu/mon/SketchGUI.java	Tue Dec  7 19:05:20 2004
@@ -24,7 +24,7 @@
 import java.io.*;
 import java.util.StringTokenizer;
 
-public class SketchGUI extends JFrame implements ActionListener,TreeSelectionListener {
+public class SketchGUI extends JFrame implements ActionListener,TreeSelectionListener,VisionUpdatedListener {
 	boolean isCam; // true if this GUI is displaying a camera space (not world)
 
 	JFrame sketchFrame;
@@ -48,7 +48,7 @@
 	// the socket over which listings are retrieved and Sketch commands are sent
 	Socket listingSocket=null;
 	PrintWriter netout = null; // network output
-    BufferedReader netin = null; // network input
+	BufferedReader netin = null; // network input
 
     public static void main(String args[]) {
 	if(args.length<4)
@@ -64,7 +64,7 @@
 //	gui.listingPort = _listingPort;
 //	gui.sketchPort = Integer.parseInt(args[3]);
 	gui.addWindowListener(new WindowAdapter() {
-		 public void windowClosing(WindowEvent e) {}});
+		 public void windowClosing(WindowEvent e) {System.exit(0);}});
 	gui.show();
     }
 		
@@ -95,21 +95,28 @@
 		}*/
 
 		TreePath[] paths = sketchTree.getSelectionPaths();
-		for (int path_i = 0; path_i < paths.length; path_i++) {
-			DefaultMutableTreeNode node 
-				=(DefaultMutableTreeNode)(paths[path_i].getLastPathComponent());
-		
-			if (node == root) continue;
-			VisualObjectInfo vinfo = (VisualObjectInfo)(node.getUserObject());
-			sketchPanel.scaleToVisualObject(vinfo);
+		if(paths!=null) {
+			for (int path_i = 0; path_i < paths.length; path_i++) {
+				DefaultMutableTreeNode node 
+					=(DefaultMutableTreeNode)(paths[path_i].getLastPathComponent());
+				
+				if (node == root) continue;
+				if(!(node.getUserObject() instanceof VisualObjectInfo)) {
+					System.out.println("placeholder text can't be selected");
+					continue;
+				}
+				
+				VisualObjectInfo vinfo = (VisualObjectInfo)(node.getUserObject());
+				sketchPanel.scaleToVisualObject(vinfo);
+			}
 		}
 
-		Graphics2D g = sketchPanel._image.createGraphics();
-		g.setBackground(Color.GRAY);
-		g.clearRect(0,0,176,144);
-		sketchPanel.repaint();
-		valueChanged(null); // redraw
-		sketchPanel.repaint();
+		//Graphics2D g = sketchPanel._image.createGraphics();
+		//g.setBackground(Color.GRAY);
+		//g..clearRect(0,0,sketchPanel._image.getWidth(),sketchPanel._image.getHeight());
+		//sketchPanel.repaint();
+		//valueChanged(null); // redraw
+		//sketchPanel.repaint();
 		valueChanged(null); // redraw
 	} else if(e.getActionCommand().compareTo("saveimg")==0) {
 	    File cursavepath = new File(prefs.get("cursavepath",""));
@@ -136,6 +143,11 @@
 	    }
 	} else if(e.getActionCommand().compareTo("refreshlist")==0) {
 		// send command to refresh the sketch tree list
+		if(netout==null)
+			reconnect();
+		if(netout==null)
+			return;
+
 		netout.println("list");
 //		DefaultMutableTreeNode root = new DefaultMutableTreeNode("camspace");
 		root.removeAllChildren();
@@ -148,26 +160,26 @@
 			sketchPanel.bottomBound = 144;
 
 			String inputLine;
-			System.out.println(inputLine = netin.readLine());
-			while((inputLine=netin.readLine()).compareTo("list end") != 0) {
+			System.out.println(inputLine = readLine());
+			while((inputLine=readLine()).compareTo("list end") != 0) {
 				// parse type (sketch or shape)	
 				StringTokenizer st = new StringTokenizer(inputLine,": ");
 				String type = st.nextToken();
 
 				// parse id
-				inputLine = netin.readLine();
+				inputLine = readLine();
 				st = new StringTokenizer(inputLine,": ");
 				st.nextToken();
 				int id = Integer.parseInt(st.nextToken());
 				
 				//parse parentId
-				inputLine = netin.readLine();
+				inputLine = readLine();
 				st = new StringTokenizer(inputLine,": ");
 				st.nextToken();
 				int parentId = Integer.parseInt(st.nextToken());
 			
 				// parse name
-				inputLine = netin.readLine();
+				inputLine = readLine();
 				st = new StringTokenizer(inputLine,":\r\n");
 				st.nextToken();
 				String name = st.nextToken();
@@ -178,20 +190,20 @@
 				if(type.equals("sketch")) {
 					oinfo = new SketchInfo(id, parentId, name);
 				} else if (type.equals("shape")) {
-					inputLine = netin.readLine();
+					inputLine = readLine();
 					st = new StringTokenizer(inputLine,": ");
 					st.nextToken();
 					int shapetype = Integer.parseInt(st.nextToken());
 					System.out.println("shapetype:" + shapetype);
 
 					// parse shape color
-					inputLine = netin.readLine();
+					inputLine = readLine();
 					st = new StringTokenizer(inputLine,": ");
 					st.nextToken();
 					int color = Integer.parseInt(st.nextToken());
 					System.out.println("color:" + color);
 
-					inputLine = netin.readLine();
+					inputLine = readLine();
 					st = new StringTokenizer(inputLine,": ");
 					st.nextToken();
 					float cx = Float.parseFloat(st.nextToken());
@@ -200,7 +212,7 @@
 					System.out.println("cxyz:" +cx+" "+cy+" "+cz);
 
 					if(shapetype == 1) { // lineshape
-						inputLine = netin.readLine();
+						inputLine = readLine();
 						st = new StringTokenizer(inputLine,": ");
 						st.nextToken();
 						float e1x = Float.parseFloat(st.nextToken());
@@ -208,7 +220,7 @@
 						float e1v = Float.parseFloat(st.nextToken());
 						System.out.println("e1xyv:"+e1x+" "+e1y +" "+e1v);
 
-						inputLine = netin.readLine();
+						inputLine = readLine();
 						st = new StringTokenizer(inputLine,": ");
 						st.nextToken();
 						float e2x = Float.parseFloat(st.nextToken());
@@ -216,13 +228,13 @@
 						float e2v = Float.parseFloat(st.nextToken());
 						System.out.println("e1xyv:"+e1x+" "+e1y +" "+e1v);
 
-						inputLine = netin.readLine();
+						inputLine = readLine();
 						st = new StringTokenizer(inputLine,": ");
 						st.nextToken();
 						float r = Float.parseFloat(st.nextToken());
 						System.out.println("r:"+r);
 
-						inputLine = netin.readLine();
+						inputLine = readLine();
 						st = new StringTokenizer(inputLine,": ");
 						st.nextToken();
 						float theta = Float.parseFloat(st.nextToken());
@@ -232,14 +244,14 @@
 							cx,cy,cz, e1x, e1y, e1v, e2x, e2y, e2v, r, theta);
 
 					} else if(shapetype == 2) { // ellipseshape
-						inputLine = netin.readLine();
+						inputLine = readLine();
 						st = new StringTokenizer(inputLine,": ");
 						st.nextToken();
 						float semimajor = Float.parseFloat(st.nextToken());
 						float semiminor = Float.parseFloat(st.nextToken());
 						System.out.println("axes:"+semimajor+" "+semiminor);
 
-						inputLine = netin.readLine();
+						inputLine = readLine();
 						st = new StringTokenizer(inputLine,": ");
 						st.nextToken();
 						float orientation = Float.parseFloat(st.nextToken());
@@ -249,7 +261,7 @@
 								cx,cy,cz, semimajor, semiminor, orientation);
 
 					} else if (shapetype == 4) { // agentshape
-						inputLine = netin.readLine();
+						inputLine = readLine();
 						st = new StringTokenizer(inputLine,": ");
 						st.nextToken();
 						float orientation = Float.parseFloat(st.nextToken());
@@ -301,13 +313,13 @@
 			// display the first sketch
 			SketchInfo firstinfo = (SketchInfo)(((DefaultMutableTreeNode)(root.getFirstChild())).getUserObject());
 			netout.println("get "+firstinfo.getId());
-			while((inputLine=netin.readLine()).compareTo("get end") != 0) {
+			while((inputLine=readLine()).compareTo("get end") != 0) {
 				System.out.println(inputLine);
 			}	
-			netout.println("get "+firstinfo.getId()); // why a 2nd time?
-			while((inputLine=netin.readLine()).compareTo("get end") != 0) {
-				System.out.println(inputLine);
-			}
+			//netout.println("get "+firstinfo.getId()); // why a 2nd time?
+			//while((inputLine=readLine()).compareTo("get end") != 0) {
+			//System.out.println(inputLine);
+			//}
 
 
 			System.out.println(inputLine);
@@ -318,51 +330,55 @@
 			// expand all the rows
 			for (int i = 0; i < sketchTree.getRowCount(); i++) {
 				sketchTree.expandRow(i);
-			sketchTree.updateUI();
+//			sketchTree.updateUI();
 			}
+			sketchTree.clearSelection();
 			sketchTree.updateUI();
 		} catch(IOException ioe) {
 			System.err.println("Transfer error");
+			reconnect();
+			actionPerformed(e);
 		}
 	}
     }
 
-    public SketchGUI(String host, int _listingPort, int _sketchPort, 
-			boolean _isCam) {
-	super();
-	this.host = host;
-	this.listingPort = _listingPort;
-	this.sketchPort = _sketchPort;
-	this.isCam = _isCam;
-	//this.port = port;
+	public SketchGUI(String host, int _listingPort, int _sketchPort, 
+									 boolean _isCam) {
+		super();
+		this.host = host;
+		this.listingPort = _listingPort;
+		this.sketchPort = _sketchPort;
+		this.isCam = _isCam;
+		//this.port = port;
+		
+		if(isCam)
+			root = new DefaultMutableTreeNode("camspace");
+		else root = new DefaultMutableTreeNode("worldspace");
 
-	if(isCam)
-		root = new DefaultMutableTreeNode("camspace");
-	else root = new DefaultMutableTreeNode("worldspace");
+		init();
 
-	// network setup
-	try {
-		System.out.println("Trying to open socket...");
-		listingSocket = new Socket(host,listingPort);
-		netout = new PrintWriter(listingSocket.getOutputStream(), true);
-  		netin = new BufferedReader(new InputStreamReader(
-					listingSocket.getInputStream()));
-	} catch (UnknownHostException e) {
-		System.err.println("Don't know about host:"+host);
-		System.exit(1);
-	} catch (IOException e) {
-		System.err.println("Couldn't get I/O for "
-				+ "the connection to:" + host + ".");
-		System.exit(1);
+		// network setup
+		reconnect();
+		/*
+			try {
+			System.out.println("Trying to open socket...");
+			listingSocket = new Socket(host,listingPort);
+			netout = new PrintWriter(listingSocket.getOutputStream(), true);
+			netin = new BufferedReader(new InputStreamReader(listingSocket.getInputStream()));
+			} catch (UnknownHostException e) {
+			System.err.println("Don't know about host:"+host);
+			System.exit(1);
+			} catch (IOException e) {
+			System.err.println("Couldn't get I/O for "
+			+ "the connection to:" + host + ".");
+			//System.exit(1);
+			}*/
 	}
-
-	init();
-    }
-
+	
 	
 
     public void init() {
-	enableEvents(AWTEvent.FOCUS_EVENT_MASK);// want to receive FocusEvents
+			//enableEvents(AWTEvent.FOCUS_EVENT_MASK);// want to receive FocusEvents
 
 	int strutsize=10;
 	int sepsize=5;
@@ -377,7 +393,6 @@
 	sketchPanel.setMinimumSize(new Dimension(VisionListener.DEFAULT_WIDTH/2, VisionListener.DEFAULT_HEIGHT/2));
 	sketchPanel.setPreferredSize(new Dimension(VisionListener.DEFAULT_WIDTH*2, VisionListener.DEFAULT_HEIGHT*2));
 	sketchPanel.setLockAspectRatio(true);
-	
 
 	//getContentPane().add(sketch,BorderLayout.NORTH);
 
@@ -387,6 +402,8 @@
 	else sketchFrame = new JFrame("World Sketch/Shape Frame");
 	sketchFrame.getContentPane().add(sketchPanel);
 	sketchFrame.pack();
+	sketchFrame.setLocation(prefs.getInt("SketchPanel.location.x",50),prefs.getInt("SketchPanel.location.y",50));
+
 	sketchFrame.show();
 
 	{
@@ -471,11 +488,46 @@
 	
 	String name="SketchGUI"+".location";
 	setLocation(prefs.getInt(name+".x",50),prefs.getInt(name+".y",50));
+	addWindowListener(new CloseSketchGUIAdapter(this));
 
+	sketchPanel.getListener().addListener(this);
+	
 	// trigger some beginning events
 //	actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, "refreshlist"));
     }
 
+	class CloseSketchGUIAdapter extends WindowAdapter {
+		SketchGUI gui;
+		CloseSketchGUIAdapter(SketchGUI gui) {this.gui=gui;}
+		public void windowClosing(WindowEvent e) {
+			gui.close();
+		}
+	}
+	
+	public void close() {
+		try {
+			if(listingSocket!=null && !listingSocket.isClosed())
+				listingSocket.close();
+		} catch (IOException ioe) {
+			System.err.println("close failed:");
+			ioe.printStackTrace();
+		}
+		prefs.putInt("SketchGUI.location.x",getLocation().x);
+		prefs.putInt("SketchGUI.location.y",getLocation().y);
+		sketchPanel.getListener().removeListener(this);
+		Component p=sketchPanel;
+		while(p.getParent()!=null)
+			p=p.getParent();
+		if(p instanceof Window) {
+			Window w=(Window)p;
+			prefs.putInt("SketchPanel.location.x",w.getLocation().x);
+			prefs.putInt("SketchPanel.location.y",w.getLocation().y);
+			w.dispose();
+		} else
+			System.out.println("That's weird - root container isn't window");
+		dispose();
+	}
+
     public TreeNode initSketchTree(String host, int port) {
 
 	// Just for demonstration:
@@ -522,59 +574,118 @@
 
 	// gets called when a Sketch selection is clicked
 	public void valueChanged(TreeSelectionEvent e) {
-		Graphics2D tempgraphics = sketchPanel._image.createGraphics();
-		tempgraphics.setBackground(Color.GRAY);
-		tempgraphics.clearRect(0,0,176,144);
-
-		Graphics2D g = sketchPanel._image.createGraphics(); 
-
 		TreePath[] paths = sketchTree.getSelectionPaths();
-		if (paths == null) return;
+		if (paths == null) {
+			renderSelectedInTree(null);
+			return;
+		}
+		int sketches=0;
 		for (int path_i = 0; path_i < paths.length; path_i++) {
 			DefaultMutableTreeNode node 
 				=(DefaultMutableTreeNode)(paths[path_i].getLastPathComponent());
 
 			if (node == root) continue;	
-			if (node == null) return;
+			if (node == null) {System.err.println("node is null???"); return; }
 	
+			if(!(node.getUserObject() instanceof VisualObjectInfo)) {
+				System.out.println("placeholder text can't be displayed");
+				continue;
+			}
+			
 			VisualObjectInfo vinfo = (VisualObjectInfo)(node.getUserObject());
-			System.out.println(vinfo.toString());
+			if(vinfo instanceof SketchInfo)
+				sketches++;
 			if (!node.isRoot()) {
 				System.out.println("id clicked:"+vinfo.id);
 				netout.println("get "+vinfo.id);
 				try {
 					String inputLine;
-					while((inputLine=netin.readLine()).compareTo("get end") != 0) {
+					while((inputLine=readLine()).compareTo("get end") != 0) {
 						System.out.println(inputLine);
 					}
 				} catch (IOException ioe) {
 					System.err.println("Transfer error");
+					reconnect();
+					valueChanged(null);
 				}
+				System.out.println("done with id:"+vinfo.id);
 			} else {
 				//displayURL(helpURL); 
 			}
 		}
-		renderSelectedInTree(g);
+		if(sketches==0)
+			renderSelectedInTree(null);
+	}
+	
+	protected String readLine() throws java.io.IOException {
+		if(netin==null)
+			reconnect();
+		if(netin==null)
+			throw new java.io.IOException("no connection");
+		String ans=netin.readLine();
+		if(ans==null)
+			throw new java.io.IOException("lost connection");
+		return ans;
+	}
+	
+	public void reconnect() {
+		System.out.print(host+":"+listingPort+" reconnecting...");
+		try {
+			if(listingSocket!=null && !listingSocket.isClosed())
+				listingSocket.close();
+			netin=null;
+			netout=null;
+			listingSocket = new Socket(host,listingPort);
+			netout = new PrintWriter(listingSocket.getOutputStream(), true);
+			netin = new BufferedReader(new InputStreamReader(listingSocket.getInputStream()));
+		} catch (UnknownHostException e) {
+			System.err.println("Don't know about host:"+host);
+			System.exit(1);
+		} catch (IOException ioe) {
+			System.err.println("reconnection failed:");
+			//ioe.printStackTrace();
+			return;
+		}
+		System.out.println("done");
+		refreshListBut.doClick(); //auto refresh on reconnect
 	}
 
+	public void visionUpdated(VisionListener l) {
+		renderSelectedInTree(l.getImage().createGraphics());
+		l.removeListener(this);
+		l.fireVisionUpdate();
+		l.addListener(this);
+	}
+	
 	// called when the window receives focus
-	public void processFocusEvent(FocusEvent e) {
-		System.out.println("received focus");
+	/*public void processFocusEvent(FocusEvent e) {
 		repaint(); // keeps window from getting overwritten; bit of a hack
-	}
+		}*/
 
 	// renders all the currently selected elements in the tree
 	public void renderSelectedInTree(Graphics2D g) {
-		g = sketchPanel._image.createGraphics(); 
+		if(g==null) {
+			g = sketchPanel._image.createGraphics();
+			g.setBackground(Color.GRAY);
+			g.clearRect(0,0,sketchPanel._image.getWidth(),sketchPanel._image.getHeight());
+		}
 		TreePath[] paths = sketchTree.getSelectionPaths();
-		if (paths == null) return;
+		if (paths == null) {
+			sketchPanel.repaint();
+			return;
+		}
 		for (int path_i = 0; path_i < paths.length; path_i++) {
 			DefaultMutableTreeNode node 
 				=(DefaultMutableTreeNode)(paths[path_i].getLastPathComponent());
 
-			if (node == root) continue;	
+			if (node == root) continue;
 			if (node == null) return;
-
+			
+			if(!(node.getUserObject() instanceof VisualObjectInfo)) {
+				System.out.println("placeholder text can't be displayed");
+				continue;
+			}
+			
 			VisualObjectInfo vinfo = (VisualObjectInfo)(node.getUserObject());
 			int cval = vinfo.getColor();
 			IndexColorModel cmodel = sketchPanel._listener.getColorModel();
diff -urdN ../Tekkotsu_2.2.1/tools/mon/org/tekkotsu/mon/SketchPanel.java ./tools/mon/org/tekkotsu/mon/SketchPanel.java
--- ../Tekkotsu_2.2.1/tools/mon/org/tekkotsu/mon/SketchPanel.java	Fri Nov 12 17:07:40 2004
+++ ./tools/mon/org/tekkotsu/mon/SketchPanel.java	Wed Dec  1 18:18:30 2004
@@ -24,9 +24,13 @@
 		super(listener);
 		gui = _gui;
 		isCam = _isCam;
-		listener.run();
+		//listener.run();
 	}	
 	
+	public void visionUpdated(VisionListener l) {
+		super.visionUpdated(l);
+	}
+	
 	protected void drawImage(Graphics _g, BufferedImage img, int x, int y, 
 			int w, int h) {
 		Graphics2D g2d = (Graphics2D)_g;
@@ -68,19 +72,28 @@
 		}
 	
 		// redraw shapes if necessary
-		gui.renderSelectedInTree(g2d);
+		//gui.renderSelectedInTree(g2d);
 
 		// draw coordinates
 		if (isCam) {
-		g2d.drawString("("+String.valueOf((int)leftBound)+","
-				+String.valueOf((int)topBound)+")", 0, 10);
-		g2d.drawString("("+String.valueOf((int)rightBound)+","
-				+String.valueOf((int)bottomBound)+")", 145*2, 141*2);
+			g2d.setColor(getForeground());
+			FontMetrics tmp=g2d.getFontMetrics();
+			String msg="("+String.valueOf((int)leftBound)+","+String.valueOf((int)topBound)+")";
+			int strw=tmp.stringWidth(msg);
+			g2d.drawString(msg,x,y+tmp.getAscent());
+			msg="("+String.valueOf((int)rightBound)+","+String.valueOf((int)bottomBound)+")";
+			strw=tmp.stringWidth(msg);
+			g2d.drawString(msg,x+w-strw,y+h-tmp.getDescent());
 		} else {
-		g2d.drawString("("+String.valueOf((int)leftBound)+","
-				+String.valueOf((int)bottomBound)+")", 0, 10);
-		g2d.drawString("("+String.valueOf((int)rightBound)+","
-				+String.valueOf((int)topBound)+")", 145*2, 141*2);
+			g2d.setColor(getForeground());
+			FontMetrics tmp=g2d.getFontMetrics();
+			int strh=tmp.getHeight();
+			String msg="("+String.valueOf((int)leftBound)+","+String.valueOf((int)bottomBound)+")";
+			int strw=tmp.stringWidth(msg);
+			g2d.drawString(msg,x,y+tmp.getAscent());
+			msg="("+String.valueOf((int)rightBound)+","+String.valueOf((int)topBound)+")";
+			strw=tmp.stringWidth(msg);
+			g2d.drawString(msg,x+w-strw,y+h-tmp.getDescent());
 		}
 
 	}
diff -urdN ../Tekkotsu_2.2.1/tools/mon/org/tekkotsu/mon/TCPVisionListener.java ./tools/mon/org/tekkotsu/mon/TCPVisionListener.java
--- ../Tekkotsu_2.2.1/tools/mon/org/tekkotsu/mon/TCPVisionListener.java	Fri Nov 12 17:07:40 2004
+++ ./tools/mon/org/tekkotsu/mon/TCPVisionListener.java	Mon Nov 29 20:15:52 2004
@@ -20,13 +20,16 @@
 	Date timestamp;
 	long frameNum=0;
 
-	Vector listeners = new Vector();
+	protected Vector listeners = new Vector();
+	protected boolean updating;
+
 	public void addListener(VisionUpdatedListener l) { listeners.add(l); }
 	public void removeListener(VisionUpdatedListener l) { listeners.remove(l); }
 	public void fireVisionUpdate() {
-		updatedFlag=true;
-		for(int i=0; i<listeners.size(); i++)
+		updating=true;
+		for(int i=0; i<listeners.size() && updating; i++)
 			((VisionUpdatedListener)listeners.get(i)).visionUpdated(this);
+		updating=false;
 	}
 
 	public Date getTimeStamp() { return timestamp; }
@@ -340,6 +343,8 @@
 
 	public void connected(Socket socket) {
 		_isConnected=true;
+		while(listeners==null) //fixes a race condition, since Listener constructor spawns thread, subclass constructors may not be finished
+			Thread.yield();
 		fireVisionUpdate();
 		try {
 			InputStream in=socket.getInputStream();
@@ -481,10 +486,10 @@
 						int tempi=newjpegLen;
 						newjpegLen=jpegLen;
 						jpegLen=tempi;
-						updatedFlag = true;
 					}
 					timestamp=new Date(timest);
 				}
+				updatedFlag = true;
 				fireVisionUpdate();
 			}
 		} catch (Exception ex) {
@@ -597,6 +602,7 @@
 				img=new BufferedImage(width,height,BufferedImage.TYPE_BYTE_INDEXED,cmodel);
 			img.getRaster().setDataElements(0,0,width,height,data);
 		} else {
+			updatedFlag=false;
 			int[] pix;
 			if(img.getWidth()!=width || img.getHeight()!=height || img.getType()!=BufferedImage.TYPE_BYTE_INDEXED)
 				img=new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB);
diff -urdN ../Tekkotsu_2.2.1/tools/mon/org/tekkotsu/mon/UDPVisionListener.java ./tools/mon/org/tekkotsu/mon/UDPVisionListener.java
--- ../Tekkotsu_2.2.1/tools/mon/org/tekkotsu/mon/UDPVisionListener.java	Fri Nov 12 17:07:40 2004
+++ ./tools/mon/org/tekkotsu/mon/UDPVisionListener.java	Mon Nov 29 20:15:52 2004
@@ -27,13 +27,16 @@
 	Date timestamp;
 	long frameNum=0;
 
-	Vector listeners = new Vector();
+	protected Vector listeners = new Vector();
+	protected boolean updating;
+	
 	public void addListener(VisionUpdatedListener l) { listeners.add(l); }
 	public void removeListener(VisionUpdatedListener l) { listeners.remove(l); }
 	public void fireVisionUpdate() {
-		updatedFlag=true;
-		for(int i=0; i<listeners.size(); i++)
+		updating=true;
+		for(int i=0; i<listeners.size() && updating; i++)
 			((VisionUpdatedListener)listeners.get(i)).visionUpdated(this);
+		updating=false;
 	}
 
 	public Date getTimeStamp() { return timestamp; }
@@ -345,9 +348,10 @@
 
 	public void connected(DatagramSocket UDPsocket) {
 		_isConnected=true;
-		fireVisionUpdate();
 		mysock = UDPsocket;
-		_isConnected=true;
+		while(listeners==null) //fixes a race condition, since Listener constructor spawns thread, subclass constructors may not be finished
+			Thread.yield();
+		fireVisionUpdate();
 		try {
 			while(!mysock.isClosed()) {
 				mysock.receive(incoming);
@@ -488,10 +492,10 @@
 						int tempi=newjpegLen;
 						newjpegLen=jpegLen;
 						jpegLen=tempi;
-						updatedFlag = true;
 					}
 					timestamp=new Date(timest);
 				}
+				updatedFlag=true;
 				fireVisionUpdate();
 			}
 		} catch (Exception ex) {
@@ -603,6 +607,7 @@
 				img=new BufferedImage(width,height,BufferedImage.TYPE_BYTE_INDEXED,cmodel);
 			img.getRaster().setDataElements(0,0,width,height,data);
 		} else {
+			updatedFlag=false;
 			int[] pix;
 			if(img.getWidth()!=width || img.getHeight()!=height || img.getType()!=BufferedImage.TYPE_BYTE_INDEXED)
 				img=new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB);
diff -urdN ../Tekkotsu_2.2.1/tools/safemot/tekkotsu.cfg ./tools/safemot/tekkotsu.cfg
--- ../Tekkotsu_2.2.1/tools/safemot/tekkotsu.cfg	Mon Nov  8 16:48:19 2004
+++ ./tools/safemot/tekkotsu.cfg	Mon Nov  8 16:48:19 2004
@@ -1,7 +1,7 @@
 ##################################################################
 ##################   Tekkotsu::safemot config   ##################
 ##################################################################
-##################### $Name: HEAD $ ######################
+##################### $Name: HEAD $ ######################
 ####################### $Revision: 1.1 $ ########################
 ################## $Date: 2004/12/23 08:41:24 $ ##################
 ##################################################################
diff -urdN ../Tekkotsu_2.2.1/tools/test/kinematics/IP210Body.txt ./tools/test/kinematics/IP210Body.txt
--- ../Tekkotsu_2.2.1/tools/test/kinematics/IP210Body.txt	Wed Dec 31 19:00:00 1969
+++ ./tools/test/kinematics/IP210Body.txt	Fri Dec 10 15:43:22 2004
@@ -0,0 +1,12 @@
+0	95.979	31.609	0
+0	95.979	-31.609	0
+0	88.298	26.664	-28.809
+0	88.298	-26.664	-28.809
+0	53.402	25.995	-51.758
+0	53.402	-25.995	-51.758
+0	-60.487	15.015	-51.758
+0	-60.487	-15.015	-51.758
+0	-91.844	26.664	-32.354
+0	-91.844	-26.664	-32.354
+0	-101.324	31.609	0
+0	-101.324	-31.609	0
diff -urdN ../Tekkotsu_2.2.1/tools/test/kinematics/IP210Camera.txt ./tools/test/kinematics/IP210Camera.txt
--- ../Tekkotsu_2.2.1/tools/test/kinematics/IP210Camera.txt	Mon Oct 11 15:44:52 2004
+++ ./tools/test/kinematics/IP210Camera.txt	Fri Dec 10 15:43:22 2004
@@ -3,11 +3,11 @@
 4	0	0	0
 0	0	0	0
 6	0	0	0
-4	-30.396	24.359	80.239
-4	30.396	24.359	80.239
-4	-24.81	-6.761	86.874
-4	24.81	-6.761	86.874
-4	-44.544	-4.143	25.654
-4	44.544	-4.143	25.654
-4	0	-54.181	10.106
-4	0	-50.284	-8.393
+4	-24.917	19.968	65.777
+4	24.917	19.968	65.777
+4	-20.338	-5.542	71.216
+4	20.338	-5.542	71.216
+4	-36.515	-3.396	21.030
+4	36.515	-3.396	21.030
+4	0	-44.415	8.284
+4	0	-41.221	-6.880
diff -urdN ../Tekkotsu_2.2.1/tools/test/kinematics/IP210LBk.txt ./tools/test/kinematics/IP210LBk.txt
--- ../Tekkotsu_2.2.1/tools/test/kinematics/IP210LBk.txt	Mon Oct 11 15:44:52 2004
+++ ./tools/test/kinematics/IP210LBk.txt	Fri Dec 10 15:43:22 2004
@@ -2,22 +2,22 @@
 3	0	0	0
 4	0	0	0
 5	0	0	0
-5	-3.461	25.628	0
-4	22.264	-21.637	11.213
-4	22.264	-21.637	-10.393
-4	46.709	-5.975	11.213
-4	46.709	-5.975	-10.393
-4	31.079	5.262	11.213
-4	31.079	5.262	-10.393
-4	0.659	-17.961	11.213
-4	0.659	-17.961	-10.393
-4	9.658	3.472	11.213
-4	9.658	3.472	-10.393
-3	34.173	10.544	12.357
-3	34.173	-10.26	12.357
-3	30.39	10.217	-13.27
-3	30.39	-9.928	-13.27
-3	11.262	-10.257	14.729
-3	0	11.375	14.729
-3	11.262	-10.257	-14.729
-3	0	11.375	-14.729
+5	-4.890	36.210	0
+4	31.457	-30.571	15.843
+4	31.457	-30.571	-14.684
+4	65.997	-8.442	15.843
+4	65.997	-8.442	-14.684
+4	43.912	7.434	15.843
+4	43.912	7.434	-14.684
+4	.931	-25.377	15.843
+4	.931	-25.377	-14.684
+4	13.646	4.905	15.843
+4	13.646	4.905	-14.684
+3	48.284	14.898	17.459
+3	48.284	-14.496	17.459
+3	42.939	14.436	-18.749
+3	42.939	-14.027	-18.749
+3	15.912	-14.492	20.811
+3	0	16.072	20.811
+3	15.912	-14.492	-20.811
+3	0	16.072	-20.811
diff -urdN ../Tekkotsu_2.2.1/tools/test/kinematics/IP210LFr.txt ./tools/test/kinematics/IP210LFr.txt
--- ../Tekkotsu_2.2.1/tools/test/kinematics/IP210LFr.txt	Mon Oct 11 15:44:52 2004
+++ ./tools/test/kinematics/IP210LFr.txt	Fri Dec 10 15:43:22 2004
@@ -2,20 +2,20 @@
 3	0	0	0
 4	0	0	0
 5	0	0	0
-5	13.068	22.315	0
-4	32.041	8.21	11.213
-4	32.041	8.21	-10.393
-4	32.479	-18.491	11.213
-4	32.479	-18.491	-10.393
-4	8.379	3.9	11.213
-4	8.379	3.9	-10.393
-4	-0.978	-16.947	11.213
-4	-0.978	-16.947	-10.393
-3	30.39	10.544	13.27
-3	30.39	-10.26	13.27
-3	34.173	10.217	-12.357
-3	34.173	-9.928	-12.357
-3	11.262	-10.257	14.729
-3	0	11.375	14.729
-3	11.262	-10.257	-14.729
-3	0	11.375	-14.729
+5	18.464	31.529	0
+4	45.272	11.600	-15.843
+4	45.272	11.600	14.684
+4	45.891	-26.126	-15.843
+4	45.891	-26.126	14.684
+4	11.839	5.510	-15.843
+4	11.839	5.510	14.684
+4	-1.381	-23.945	-15.843
+4	-1.381	-23.945	14.684
+3	42.939	14.898	18.749
+3	42.939	-14.496	18.749
+3	48.284	14.436	-17.459
+3	48.284	-14.027	-17.459
+3	15.912	-14.492	20.811
+3	0	16.072	20.811
+3	15.912	-14.492	-20.811
+3	0	16.072	-20.811
diff -urdN ../Tekkotsu_2.2.1/tools/test/kinematics/IP210Mouth.txt ./tools/test/kinematics/IP210Mouth.txt
--- ../Tekkotsu_2.2.1/tools/test/kinematics/IP210Mouth.txt	Mon Oct 11 15:44:52 2004
+++ ./tools/test/kinematics/IP210Mouth.txt	Fri Dec 10 15:43:22 2004
@@ -1,7 +1,7 @@
 5	0	0	0
-5	8.709	45.22	14.514
-5	8.709	45.22	-14.514
-5	-2.229	46.63	14.187
-5	-2.229	46.63	-14.187
-4	-14.187	23.577	70.806
-4	14.187	23.577	70.806
+5	7.139	37.069	11.898
+5	7.139	37.069	-11.898
+5	-1.827	38.225	11.630
+5	-1.827	38.225	-11.630
+4	-11.630	19.327	58.044
+4	11.630	19.327	58.044
diff -urdN ../Tekkotsu_2.2.1/tools/test/kinematics/IP210RBk.txt ./tools/test/kinematics/IP210RBk.txt
--- ../Tekkotsu_2.2.1/tools/test/kinematics/IP210RBk.txt	Mon Oct 11 15:44:52 2004
+++ ./tools/test/kinematics/IP210RBk.txt	Fri Dec 10 15:43:22 2004
@@ -2,22 +2,22 @@
 3	0	0	0
 4	0	0	0
 5	0	0	0
-5	-3.461	25.628	0
-4	22.264	-21.637	-10.393
-4	22.264	-21.637	11.213
-4	46.709	-5.975	-10.393
-4	46.709	-5.975	11.213
-4	31.079	5.262	-10.393
-4	31.079	5.262	11.213
-4	0.659	-17.961	-10.393
-4	0.659	-17.961	11.213
-4	9.658	3.472	-10.393
-4	9.658	3.472	11.213
-3	34.173	-10.26	-12.357
-3	34.173	10.544	-12.357
-3	30.39	-9.928	13.27
-3	30.39	10.217	13.27
-3	0	11.375	-14.729
-3	11.262	-10.257	-14.729
-3	0	11.375	14.729
-3	11.262	-10.257	14.729
+5	-4.890	36.210	0
+4	31.457	-30.571	14.684
+4	31.457	-30.571	-15.843
+4	65.997	-8.442	14.684
+4	65.997	-8.442	-15.843
+4	43.912	7.434	14.684
+4	43.912	7.434	-15.843
+4	.931	-25.377	14.684
+4	.931	-25.377	-15.843
+4	13.646	4.905	14.684
+4	13.646	4.905	-15.843
+3	48.284	-14.496	-17.459
+3	48.284	14.898	-17.459
+3	42.939	-14.027	18.749
+3	42.939	14.436	18.749
+3	0	16.072	-20.811
+3	15.912	-14.492	-20.811
+3	0	16.072	20.811
+3	15.912	-14.492	20.811
diff -urdN ../Tekkotsu_2.2.1/tools/test/kinematics/IP210RFr.txt ./tools/test/kinematics/IP210RFr.txt
--- ../Tekkotsu_2.2.1/tools/test/kinematics/IP210RFr.txt	Mon Oct 11 15:44:52 2004
+++ ./tools/test/kinematics/IP210RFr.txt	Fri Dec 10 15:43:22 2004
@@ -2,20 +2,20 @@
 3	0	0	0
 4	0	0	0
 5	0	0	0
-5	13.068	22.315	0
-4	32.041	8.21	-10.393
-4	32.041	8.21	11.213
-4	32.479	-18.491	-10.393
-4	32.479	-18.491	11.213
-4	8.379	3.9	-10.393
-4	8.379	3.9	11.213
-4	-0.978	-16.947	-10.393
-4	-0.978	-16.947	11.213
-3	30.39	-10.26	-13.27
-3	30.39	10.544	-13.27
-3	34.173	-9.928	12.357
-3	34.173	10.217	12.357
-3	0	11.375	-14.729
-3	11.262	-10.257	-14.729
-3	0	11.375	14.729
-3	11.262	-10.257	14.729
+5	18.464	31.529	0
+4	45.272	11.600	-14.684
+4	45.272	11.600	15.843
+4	45.891	-26.126	-14.684
+4	45.891	-26.126	15.843
+4	11.839	5.510	-14.684
+4	11.839	5.510	15.843
+4	-1.381	-23.945	-14.684
+4	-1.381	-23.945	15.843
+3	42.939	-14.496	-18.749
+3	42.939	14.898	-18.749
+3	48.284	-14.027	17.459
+3	48.284	14.436	17.459
+3	0	16.072	-20.811
+3	15.912	-14.492	-20.811
+3	0	16.072	20.811
+3	15.912	-14.492	20.811
diff -urdN ../Tekkotsu_2.2.1/tools/test/kinematics/IP220Body.txt ./tools/test/kinematics/IP220Body.txt
--- ../Tekkotsu_2.2.1/tools/test/kinematics/IP220Body.txt	Wed Dec 31 19:00:00 1969
+++ ./tools/test/kinematics/IP220Body.txt	Fri Dec 10 15:43:22 2004
@@ -0,0 +1,12 @@
+0	100.701	26.664	-11.980
+0	100.701	-26.664	-11.980
+0	88.298	26.664	-28.809
+0	88.298	-26.664	-28.809
+0	53.402	25.995	-51.758
+0	53.402	-25.995	-51.758
+0	-60.487	15.015	-51.758
+0	-60.487	-15.015	-51.758
+0	-91.844	26.664	-32.354
+0	-91.844	-26.664	-32.354
+0	-101.324	31.609	0
+0	-101.324	-31.609	0
diff -urdN ../Tekkotsu_2.2.1/tools/test/kinematics/IP220Camera.txt ./tools/test/kinematics/IP220Camera.txt
--- ../Tekkotsu_2.2.1/tools/test/kinematics/IP220Camera.txt	Mon Oct 11 15:44:52 2004
+++ ./tools/test/kinematics/IP220Camera.txt	Fri Dec 10 15:43:22 2004
@@ -3,12 +3,12 @@
 4	0	0	0
 0	0	0	0
 6	0	0	0
-4	-20.075	17.745	71.039
-4	20.075	17.745	71.039
-4	-33.782	-22.574	71.039
-4	33.782	-22.574	71.039
-4	-52.213	-17.71	0
-4	52.213	-17.71	0
-4	28.558	-44.223	-1.279
-4	28.558	-82.504	-15.888
-4	0	-56.295	46.32
+4	-16.369	14.469	57.925
+4	16.369	14.469	57.925
+4	-27.545	-18.406	57.925
+4	27.545	-18.406	57.925
+4	-42.574	-14.440	0
+4	42.574	-14.440	0
+4	23.286	-36.059	-1.042
+4	23.286	-67.273	-12.955
+4	0	-45.903	37.769
diff -urdN ../Tekkotsu_2.2.1/tools/test/kinematics/IP220LBk.txt ./tools/test/kinematics/IP220LBk.txt
--- ../Tekkotsu_2.2.1/tools/test/kinematics/IP220LBk.txt	Mon Oct 11 15:44:52 2004
+++ ./tools/test/kinematics/IP220LBk.txt	Fri Dec 10 15:43:22 2004
@@ -2,22 +2,22 @@
 3	0	0	0
 4	0	0	0
 5	0	0	0
-5	-3.461	25.628	0
-4	16.534	-21.884	11.213
-4	16.534	-21.884	-10.393
-4	46.709	-5.975	11.213
-4	46.709	-5.975	-10.393
-4	31.079	5.262	11.213
-4	31.079	5.262	-10.393
-4	5.688	-16.035	11.213
-4	5.688	-16.035	-10.393
-4	9.658	3.472	11.213
-4	9.658	3.472	-10.393
-3	30.305	10.829	12.608
-3	30.305	-10.612	12.608
-3	26.074	11.271	-12.205
-3	26.074	-10.612	-12.205
-3	10.785	10.506	11.845
-3	10.785	-10.612	11.845
-3	10.785	10.506	-11.845
-3	10.785	-10.612	-11.845
+5	-4.890	36.210	0
+4	23.361	-30.920	15.843
+4	23.361	-30.920	-14.684
+4	65.997	-8.442	15.843
+4	65.997	-8.442	-14.684
+4	43.912	7.434	15.843
+4	43.912	7.434	-14.684
+4	8.036	-22.656	15.843
+4	8.036	-22.656	-14.684
+4	13.646	4.905	15.843
+4	13.646	4.905	-14.684
+3	42.819	15.300	17.814
+3	42.819	-14.994	17.814
+3	36.841	15.925	-17.244
+3	36.841	-14.994	-17.244
+3	15.238	14.844	16.736
+3	15.238	-14.994	16.736
+3	15.238	14.844	-16.736
+3	15.238	-14.994	-16.736
diff -urdN ../Tekkotsu_2.2.1/tools/test/kinematics/IP220LFr.txt ./tools/test/kinematics/IP220LFr.txt
--- ../Tekkotsu_2.2.1/tools/test/kinematics/IP220LFr.txt	Mon Oct 11 15:44:52 2004
+++ ./tools/test/kinematics/IP220LFr.txt	Fri Dec 10 15:43:22 2004
@@ -2,20 +2,20 @@
 3	0	0	0
 4	0	0	0
 5	0	0	0
-5	13.068	22.315	0
-4	36.856	14.853	11.213
-4	36.856	14.853	-10.393
-4	32.479	-18.491	11.213
-4	32.479	-18.491	-10.393
-4	8.379	3.9	11.213
-4	8.379	3.9	-10.393
-4	-0.978	-16.947	11.213
-4	-0.978	-16.947	-10.393
-3	26.074	10.829	12.205
-3	26.074	-10.612	12.205
-3	30.305	11.271	-12.608
-3	30.305	-10.612	-12.608
-3	10.785	10.506	11.845
-3	10.785	-10.612	11.845
-3	10.785	10.506	-11.845
-3	10.785	-10.612	-11.845
+5	18.464	31.529	0
+4	52.075	20.986	-15.843
+4	52.075	20.986	14.684
+4	45.891	-26.126	-15.843
+4	45.891	-26.126	14.684
+4	11.839	5.510	-15.843
+4	11.839	5.510	14.684
+4	-1.381	-23.945	-15.843
+4	-1.381	-23.945	14.684
+3	36.841	15.300	17.244
+3	36.841	-14.994	17.244
+3	42.819	15.925	-17.814
+3	42.819	-14.994	-17.814
+3	15.238	14.844	16.736
+3	15.238	-14.994	16.736
+3	15.238	14.844	-16.736
+3	15.238	-14.994	-16.736
diff -urdN ../Tekkotsu_2.2.1/tools/test/kinematics/IP220RBk.txt ./tools/test/kinematics/IP220RBk.txt
--- ../Tekkotsu_2.2.1/tools/test/kinematics/IP220RBk.txt	Mon Oct 11 15:44:52 2004
+++ ./tools/test/kinematics/IP220RBk.txt	Fri Dec 10 15:43:22 2004
@@ -2,22 +2,22 @@
 3	0	0	0
 4	0	0	0
 5	0	0	0
-5	-3.461	25.628	0
-4	16.534	-21.884	-10.393
-4	16.534	-21.884	11.213
-4	46.709	-5.975	-10.393
-4	46.709	-5.975	11.213
-4	31.079	5.262	-10.393
-4	31.079	5.262	11.213
-4	5.688	-16.035	-10.393
-4	5.688	-16.035	11.213
-4	9.658	3.472	-10.393
-4	9.658	3.472	11.213
-3	30.305	-10.612	-12.608
-3	30.305	10.829	-12.608
-3	26.074	-10.612	12.205
-3	26.074	11.271	12.205
-3	10.785	-10.612	-11.845
-3	10.785	10.506	-11.845
-3	10.785	-10.612	11.845
-3	10.785	10.506	11.845
+5	-4.890	36.210	0
+4	23.361	-30.920	14.684
+4	23.361	-30.920	-15.843
+4	65.997	-8.442	14.684
+4	65.997	-8.442	-15.843
+4	43.912	7.434	14.684
+4	43.912	7.434	-15.843
+4	8.036	-22.656	14.684
+4	8.036	-22.656	-15.843
+4	13.646	4.905	14.684
+4	13.646	4.905	-15.843
+3	42.819	-14.994	-17.814
+3	42.819	15.300	-17.814
+3	36.841	-14.994	17.244
+3	36.841	15.925	17.244
+3	15.238	-14.994	-16.736
+3	15.238	14.844	-16.736
+3	15.238	-14.994	16.736
+3	15.238	14.844	16.736
diff -urdN ../Tekkotsu_2.2.1/tools/test/kinematics/IP220RFr.txt ./tools/test/kinematics/IP220RFr.txt
--- ../Tekkotsu_2.2.1/tools/test/kinematics/IP220RFr.txt	Mon Oct 11 15:44:52 2004
+++ ./tools/test/kinematics/IP220RFr.txt	Fri Dec 10 15:43:22 2004
@@ -2,20 +2,20 @@
 3	0	0	0
 4	0	0	0
 5	0	0	0
-5	13.068	22.315	0
-4	36.856	14.853	-10.393
-4	36.856	14.853	11.213
-4	32.479	-18.491	-10.393
-4	32.479	-18.491	11.213
-4	8.379	3.9	-10.393
-4	8.379	3.9	11.213
-4	-0.978	-16.947	-10.393
-4	-0.978	-16.947	11.213
-3	26.074	-10.612	-12.205
-3	26.074	10.829	-12.205
-3	30.305	-10.612	12.608
-3	30.305	11.271	12.608
-3	10.785	-10.612	-11.845
-3	10.785	10.506	-11.845
-3	10.785	-10.612	11.845
-3	10.785	10.506	11.845
+5	18.464	31.529	0
+4	52.075	20.986	-14.684
+4	52.075	20.986	15.843
+4	45.891	-26.126	-14.684
+4	45.891	-26.126	15.843
+4	11.839	5.510	-14.684
+4	11.839	5.510	15.843
+4	-1.381	-23.945	-14.684
+4	-1.381	-23.945	15.843
+3	36.841	-14.994	-17.244
+3	36.841	15.300	-17.244
+3	42.819	-14.994	17.814
+3	42.819	15.925	17.814
+3	15.238	-14.994	-16.736
+3	15.238	14.844	-16.736
+3	15.238	-14.994	16.736
+3	15.238	14.844	16.736
diff -urdN ../Tekkotsu_2.2.1/tools/test/kinematics/IP7Body.txt ./tools/test/kinematics/IP7Body.txt
--- ../Tekkotsu_2.2.1/tools/test/kinematics/IP7Body.txt	Wed Dec 31 19:00:00 1969
+++ ./tools/test/kinematics/IP7Body.txt	Fri Dec 10 15:43:22 2004
@@ -0,0 +1,12 @@
+0	107.560	23.448	0
+0	107.560	-23.448	0
+0	95.250	29.631	-30.070
+0	95.250	-29.631	-30.070
+0	55.290	20.238	-52.270
+0	55.290	-20.238	-52.270
+0	-60.540	25.238	-49.850
+0	-60.540	-25.238	-49.850
+0	-97.070	29.631	-31.880
+0	-97.070	-29.631	-31.880
+0	-108.970	29.631	0
+0	-108.970	-29.631	0
diff -urdN ../Tekkotsu_2.2.1/tools/test/kinematics/IP7Camera.txt ./tools/test/kinematics/IP7Camera.txt
--- ../Tekkotsu_2.2.1/tools/test/kinematics/IP7Camera.txt	Mon Oct 11 15:44:52 2004
+++ ./tools/test/kinematics/IP7Camera.txt	Fri Dec 10 15:43:23 2004
@@ -3,10 +3,10 @@
 4	0	0	0
 0	0	0	0
 6	0	0	0
-4	71.234	-27.781	-48.99
-4	71.234	-27.781	48.99
-4	71.234	9.992	-34.53
-4	71.234	9.992	34.53
-4	-14.657	19.571	-61.668
-4	-14.657	19.571	61.668
-4	-10.121	54.115	0
+4	54.223	-21.146	-37.291
+4	54.223	-21.146	37.291
+4	54.223	7.605	-26.284
+4	54.223	7.605	26.284
+4	-11.156	14.897	-46.941
+4	-11.156	14.897	46.941
+4	-7.704	41.192	0
diff -urdN ../Tekkotsu_2.2.1/tools/test/kinematics/IP7LBk.txt ./tools/test/kinematics/IP7LBk.txt
--- ../Tekkotsu_2.2.1/tools/test/kinematics/IP7LBk.txt	Mon Oct 18 17:16:36 2004
+++ ./tools/test/kinematics/IP7LBk.txt	Fri Dec 10 15:43:23 2004
@@ -2,24 +2,24 @@
 3	0	0	0
 4	0	0	0
 5	0	0	0
-5	-4.112	17.796	0
-4	26.395	-21.709	15.743		
-4	26.395	-21.709	-9.718
-4	48.211	-5.348	15.743
-4	48.211	-5.348	-9.718
-4	45.602	5.249	15.743
-4	45.602	5.249	-9.718
-4	26.685	-7.267	17.788
-4	26.685	-7.267	-11.766
-4	1.803	-14.371	15.018
-4	1.803	-14.371	-8.992
-4	21.072	6.169	15.018
-4	21.072	6.169	-8.992
-3	30.738	9.321	11.02
-3	30.738	-3.233	11.02
-3	30.738	9.321	-11.02
-3	30.738	-3.233	-11.02
-3	0	6.61	11.02
-3	0	-3.233	11.02
-3	0	6.61	-11.02
-3	0	-3.233	-11.02
+5	-6.414	27.759	0
+4	41.172	-33.863	24.557
+4	41.172	-33.863	-15.158
+4	75.203	-8.342	24.557
+4	75.203	-8.342	-15.158
+4	71.133	8.187	24.557
+4	71.133	8.187	-15.158
+4	41.625	-11.335	27.747
+4	41.625	-11.335	-18.353
+4	2.812	-22.417	23.426
+4	2.812	-22.417	-14.026
+4	32.869	9.622	23.426
+4	32.869	9.622	-14.026
+3	47.947	14.539	17.189
+3	47.947	-5.043	17.189
+3	47.947	14.539	-17.189
+3	47.947	-5.043	-17.189
+3	0	10.310	17.189
+3	0	-5.043	17.189
+3	0	10.310	-17.189
+3	0	-5.043	-17.189
diff -urdN ../Tekkotsu_2.2.1/tools/test/kinematics/IP7LFr.txt ./tools/test/kinematics/IP7LFr.txt
--- ../Tekkotsu_2.2.1/tools/test/kinematics/IP7LFr.txt	Mon Oct 18 17:16:36 2004
+++ ./tools/test/kinematics/IP7LFr.txt	Fri Dec 10 15:43:23 2004
@@ -2,24 +2,24 @@
 3	0	0	0
 4	0	0	0
 5	0	0	0
-5	4.603	18.943	0
-4	38.015	13.616	-15.743
-4	38.015	13.616	9.718
-4	40.395	-9.984	-15.743
-4	40.395	-9.984	9.718
-4	26.016	-16.926	-15.743
-4	26.016	-16.926	9.718
-4	26.962	-6.869	-17.788
-4	26.962	-6.869	11.766
-4	18.777	9.452	-15.018
-4	18.777	9.452	8.992
-4	4.101	-12.860	-15.018
-4	4.101	-12.860	8.992
-3	30.738	9.321	11.02
-3	30.738	-3.233	11.02
-3	30.738	9.321	-11.02
-3	30.738	-3.233	-11.02
-3	0	6.61	11.02
-3	0	-3.233	11.02
-3	0	6.61	-11.02
-3	0	-3.233	-11.02
+5	7.180	29.548	0
+4	59.298	21.239	-24.557
+4	59.298	21.239	15.158
+4	63.011	-15.573	-24.557
+4	63.011	-15.573	15.158
+4	40.581	-26.402	-24.557
+4	40.581	-26.402	15.158
+4	42.057	-10.714	-27.747
+4	42.057	-10.714	18.353
+4	29.289	14.743	-23.426
+4	29.289	14.743	14.026
+4	6.397	-20.060	-23.426
+4	6.397	-20.060	14.026
+3	47.947	14.539	17.189
+3	47.947	-5.043	17.189
+3	47.947	14.539	-17.189
+3	47.947	-5.043	-17.189
+3	0	10.310	17.189
+3	0	-5.043	17.189
+3	0	10.310	-17.189
+3	0	-5.043	-17.189
diff -urdN ../Tekkotsu_2.2.1/tools/test/kinematics/IP7Mouth.txt ./tools/test/kinematics/IP7Mouth.txt
--- ../Tekkotsu_2.2.1/tools/test/kinematics/IP7Mouth.txt	Mon Oct 11 15:44:52 2004
+++ ./tools/test/kinematics/IP7Mouth.txt	Fri Dec 10 15:43:23 2004
@@ -1,7 +1,7 @@
 5	0	0	0
-5	53.667	16.127	-21.188
-5	53.667	16.127	21.188
-5	50.419	14.718	-14.973
-5	50.419	14.718	14.973
-4	104.465	-29.285	-14.973
-4	104.465	-29.285	14.973
+5	40.851	12.275	-16.128
+5	40.851	12.275	16.128
+5	38.378	11.203	-11.397
+5	38.378	11.203	11.397
+4	79.518	-22.291	-11.397
+4	79.518	-22.291	11.397
diff -urdN ../Tekkotsu_2.2.1/tools/test/kinematics/IP7PantsBody.txt ./tools/test/kinematics/IP7PantsBody.txt
--- ../Tekkotsu_2.2.1/tools/test/kinematics/IP7PantsBody.txt	Wed Dec 31 19:00:00 1969
+++ ./tools/test/kinematics/IP7PantsBody.txt	Fri Dec 10 15:43:23 2004
@@ -0,0 +1,12 @@
+0	107.560	23.448	0
+0	107.560	-23.448	0
+0	95.250	29.631	-30.070
+0	95.250	-29.631	-30.070
+0	55.290	20.238	-52.270
+0	55.290	-20.238	-52.270
+0	-60.540	14.238	-52.270
+0	-60.540	-14.238	-52.270
+0	-104.140	29.631	-38.950
+0	-104.140	-29.631	-38.950
+0	-108.970	29.631	0
+0	-108.970	-29.631	0
diff -urdN ../Tekkotsu_2.2.1/tools/test/kinematics/IP7RBk.txt ./tools/test/kinematics/IP7RBk.txt
--- ../Tekkotsu_2.2.1/tools/test/kinematics/IP7RBk.txt	Mon Oct 18 17:16:36 2004
+++ ./tools/test/kinematics/IP7RBk.txt	Fri Dec 10 15:43:23 2004
@@ -2,24 +2,24 @@
 3	0	0	0
 4	0	0	0
 5	0	0	0
-5	-4.112	17.796	0
-4	26.395	-21.709	9.718
-4	26.395	-21.709	-15.743
-4	48.211	-5.348	9.718
-4	48.211	-5.348	-15.743
-4	45.602	5.249	9.718
-4	45.602	5.249	-15.743
-4	26.685	-7.267	11.766
-4	26.685	-7.267	-17.788
-4	1.803	-14.371	8.992
-4	1.803	-14.371	-15.018
-4	21.072	6.169	8.992
-4	21.072	6.169	-15.018
-3	30.738	-3.233	-11.02
-3	30.738	9.321	-11.02
-3	30.738	-3.233	11.02
-3	30.738	9.321	11.02
-3	0	-3.233	-11.02
-3	0	6.61	-11.02
-3	0	-3.233	11.02
-3	0	6.61	11.02
+5	-6.414	27.759	0
+4	41.172	-33.863	15.158
+4	41.172	-33.863	-24.557
+4	75.203	-8.342	15.158
+4	75.203	-8.342	-24.557
+4	71.133	8.187	15.158
+4	71.133	8.187	-24.557
+4	41.625	-11.335	18.353
+4	41.625	-11.335	-27.747
+4	2.812	-22.417	14.026
+4	2.812	-22.417	-23.426
+4	32.869	9.622	14.026
+4	32.869	9.622	-23.426
+3	47.947	-5.043	-17.189
+3	47.947	14.539	-17.189
+3	47.947	-5.043	17.189
+3	47.947	14.539	17.189
+3	0	-5.043	-17.189
+3	0	10.310	-17.189
+3	0	-5.043	17.189
+3	0	10.310	17.189
diff -urdN ../Tekkotsu_2.2.1/tools/test/kinematics/IP7RFr.txt ./tools/test/kinematics/IP7RFr.txt
--- ../Tekkotsu_2.2.1/tools/test/kinematics/IP7RFr.txt	Mon Oct 18 17:16:36 2004
+++ ./tools/test/kinematics/IP7RFr.txt	Fri Dec 10 15:43:23 2004
@@ -2,24 +2,24 @@
 3	0	0	0
 4	0	0	0
 5	0	0	0
-5	4.603	18.943	0
-4	38.015	13.616	-9.718
-4	38.015	13.616	15.743
-4	40.395	-9.984	-9.718
-4	40.395	-9.984	15.743
-4	26.016	-16.926	-9.718
-4	26.016	-16.926	15.743
-4	26.962	-6.869	-11.766
-4	26.962	-6.869	17.788
-4	18.777	9.452	-8.992
-4	18.777	9.452	15.018
-4	4.101	-12.860	-8.992
-4	4.101	-12.860	15.018
-3	30.738	-3.233	-11.02
-3	30.738	9.321	-11.02
-3	30.738	-3.233	11.02
-3	30.738	9.321	11.02
-3	0	-3.233	-11.02
-3	0	6.61	-11.02
-3	0	-3.233	11.02
-3	0	6.61	11.02
+5	7.180	29.548	0
+4	59.298	21.239	-15.158
+4	59.298	21.239	24.557
+4	63.011	-15.573	-15.158
+4	63.011	-15.573	24.557
+4	40.581	-26.402	-15.158
+4	40.581	-26.402	24.557
+4	42.057	-10.714	-18.353
+4	42.057	-10.714	27.747
+4	29.289	14.743	-14.026
+4	29.289	14.743	23.426
+4	6.397	-20.060	-14.026
+4	6.397	-20.060	23.426
+3	47.947	-5.043	-17.189
+3	47.947	14.539	-17.189
+3	47.947	-5.043	17.189
+3	47.947	14.539	17.189
+3	0	-5.043	-17.189
+3	0	10.310	-17.189
+3	0	-5.043	17.189
+3	0	10.310	17.189
diff -urdN ../Tekkotsu_2.2.1/tools/test/kinematics/IPorig/210.txt ./tools/test/kinematics/IPorig/210.txt
--- ../Tekkotsu_2.2.1/tools/test/kinematics/IPorig/210.txt	Mon Oct 18 19:14:13 2004
+++ ./tools/test/kinematics/IPorig/210.txt	Fri Dec 10 15:43:34 2004
@@ -21,6 +21,18 @@
 RBkPaw	RBk	5	0	0	0
 Camera	Camera	6	0	0	0
 IR	IR	6	0	0	0
+UpperLChest	Body	0	95.979	31.609	0
+UpperRChest	Body	0	95.979	-31.609	0
+LowerLChest	Body	0	88.298	26.664	-28.809
+LowerRChest	Body	0	88.298	-26.664	-28.809
+LFrBelly	Body	0	53.402	25.995	-51.758
+RFrBelly	Body	0	53.402	-25.995	-51.758
+LBkBelly	Body	0	-60.487	15.015	-51.758
+RBkBelly	Body	0	-60.487	-15.015	-51.758
+LowerLRump	Body	0	-91.844	26.664	-32.354
+LowerRRump	Body	0	-91.844	-26.664	-32.354
+UpperLRump	Body	0	-101.324	31.609	0
+UpperRRump	Body	0	-101.324	-31.609	0
 LowerLeftLowerLip	Mouth	5	8.709	45.22	14.514
 LowerRightLowerLip	Mouth	5	8.709	45.22	-14.514
 UpperLeftLowerLip	Mouth	5	-2.229	46.63	14.187
diff -urdN ../Tekkotsu_2.2.1/tools/test/kinematics/IPorig/210scale.txt ./tools/test/kinematics/IPorig/210scale.txt
--- ../Tekkotsu_2.2.1/tools/test/kinematics/IPorig/210scale.txt	Mon Oct 11 15:45:00 2004
+++ ./tools/test/kinematics/IPorig/210scale.txt	Fri Dec 10 15:43:34 2004
@@ -1,6 +1,7 @@
 Camera 1.21985792042
 Mouth 1.21985792042
 IR 1
+Body 1
 LFr 0.707741821982
 RFr 0.707741821982
 LBk 0.707741821982
diff -urdN ../Tekkotsu_2.2.1/tools/test/kinematics/IPorig/220.txt ./tools/test/kinematics/IPorig/220.txt
--- ../Tekkotsu_2.2.1/tools/test/kinematics/IPorig/220.txt	Mon Oct 18 19:14:13 2004
+++ ./tools/test/kinematics/IPorig/220.txt	Fri Dec 10 15:43:34 2004
@@ -20,6 +20,18 @@
 RBkPaw	RBk	5	0	0	0
 Camera	Camera	6	0	0	0
 IR	IR	6	0	0	0
+UpperLChest	Body	0	100.701	26.664	-11.980
+UpperRChest	Body	0	100.701	-26.664	-11.980
+LowerLChest	Body	0	88.298	26.664	-28.809
+LowerRChest	Body	0	88.298	-26.664	-28.809
+LFrBelly	Body	0	53.402	25.995	-51.758
+RFrBelly	Body	0	53.402	-25.995	-51.758
+LBkBelly	Body	0	-60.487	15.015	-51.758
+RBkBelly	Body	0	-60.487	-15.015	-51.758
+LowerLRump	Body	0	-91.844	26.664	-32.354
+LowerRRump	Body	0	-91.844	-26.664	-32.354
+UpperLRump	Body	0	-101.324	31.609	0
+UpperRRump	Body	0	-101.324	-31.609	0
 LowerLeftSnout	Camera	4	-20.075	17.745	71.039
 LowerRightSnout	Camera	4	20.075	17.745	71.039
 UpperLeftSnout	Camera	4	-33.782	-22.574	71.039
diff -urdN ../Tekkotsu_2.2.1/tools/test/kinematics/IPorig/220scale.txt ./tools/test/kinematics/IPorig/220scale.txt
--- ../Tekkotsu_2.2.1/tools/test/kinematics/IPorig/220scale.txt	Mon Oct 11 15:45:00 2004
+++ ./tools/test/kinematics/IPorig/220scale.txt	Fri Dec 10 15:43:34 2004
@@ -1,5 +1,6 @@
 Camera 1.22638841967
 IR 1
+Body 1
 LFr 0.707741821982
 RFr 0.707741821982
 LBk 0.707741821982
diff -urdN ../Tekkotsu_2.2.1/tools/test/kinematics/IPorig/7.txt ./tools/test/kinematics/IPorig/7.txt
--- ../Tekkotsu_2.2.1/tools/test/kinematics/IPorig/7.txt	Mon Oct 18 19:14:13 2004
+++ ./tools/test/kinematics/IPorig/7.txt	Fri Dec 10 15:43:34 2004
@@ -23,6 +23,18 @@
 NearIR	NearIR	6	0	0	0
 FarIR	FarIR	6	0	0	0
 ChestIR	ChestIR	3	0	0	0
+UpperLChest	Body	0	107.56	23.448	0
+UpperRChest	Body	0	107.56	-23.448	0
+LowerLChest	Body	0	95.25	29.631	-30.07
+LowerRChest	Body	0	95.25	-29.631	-30.07
+LFrBelly	Body	0	55.29	20.238	-52.27
+RFrBelly	Body	0	55.29	-20.238	-52.27
+LBkBelly	Body	0	-60.54	25.238	-49.85
+RBkBelly	Body	0	-60.54	-25.238	-49.85
+LowerLRump	Body	0	-97.07	29.631	-31.88
+LowerRRump	Body	0	-97.07	-29.631	-31.88
+UpperLRump	Body	0	-108.97	29.631	0
+UpperRRump	Body	0	-108.97	-29.631	0
 LowerLeftLowerLip	Mouth	5	53.667	16.127	-21.188
 LowerRightLowerLip	Mouth	5	53.667	16.127	21.188
 UpperLeftLowerLip	Mouth	5	50.419	14.718	-14.973
diff -urdN ../Tekkotsu_2.2.1/tools/test/kinematics/IPorig/7scale.txt ./tools/test/kinematics/IPorig/7scale.txt
--- ../Tekkotsu_2.2.1/tools/test/kinematics/IPorig/7scale.txt	Mon Oct 11 15:32:07 2004
+++ ./tools/test/kinematics/IPorig/7scale.txt	Fri Dec 10 15:43:34 2004
@@ -3,6 +3,7 @@
 NearIR 1
 FarIR 1
 ChestIR 1
+Body 1
 LFr 0.641075763943
 RFr 0.641075763943
 LBk 0.641075763943
diff -urdN ../Tekkotsu_2.2.1/tools/test/kinematics/IPorig/ipenlist ./tools/test/kinematics/IPorig/ipenlist
--- ../Tekkotsu_2.2.1/tools/test/kinematics/IPorig/ipenlist	Mon Oct 11 15:32:07 2004
+++ ./tools/test/kinematics/IPorig/ipenlist	Fri Dec 10 15:43:34 2004
@@ -2,7 +2,7 @@
 
 if [ $# -lt 2 -o "$1" = "-h" -o "$1" = "--help" ] ; then
 	echo "Usage: $0 ip-file scale-file";
-	echo "  file format should be tab deliminated:"
+	echo "  ip-file format should be tab deliminated:"
 	echo "    first column is name,"
 	echo "    second column is the name of the chain the interest point is in,"
 	echo "    third column is the link number the interest point is relative to,"
diff -urdN ../Tekkotsu_2.2.1/tools/test/kinematics/IPorig/ipsplit ./tools/test/kinematics/IPorig/ipsplit
--- ../Tekkotsu_2.2.1/tools/test/kinematics/IPorig/ipsplit	Mon Sep 20 17:54:40 2004
+++ ./tools/test/kinematics/IPorig/ipsplit	Fri Dec 10 15:43:34 2004
@@ -1,10 +1,49 @@
 #!/bin/sh
 
-if [ $# -lt 1 -o "$1" = "-h" -o "$1" = "--help" ] ; then
-	echo "Usage: $0 ipfile [prefix]"
+#!/bin/sh
+
+if [ $# -lt 2 -o "$1" = "-h" -o "$1" = "--help" ] ; then
+	echo "Usage: $0 ip-file scale-file [filename-prefix]";
+	echo "  ip-file format should be tab deliminated:"
+	echo "    first column is name,"
+	echo "    second column is the name of the chain the interest point is in,"
+	echo "    third column is the link number the interest point is relative to,"
+	echo "    fourth column is x value,"
+	echo "    fifth column is y,"
+	echo "    sixth column is z."
 	exit 2;
-fi;
+fi
 
-for x in `cut -f 2 "$1" | sort | uniq` ; do
-	cut -f 2- "$1" | grep "$x" | cut -f 2- > "$2$x.txt"
+if [ ! -r "$1" ] ; then
+	echo "Could not read file '$1'";
+	exit 1;
+fi
+
+if [ ! -r "$2" ] ; then
+	echo "Could not read file '$2'";
+	exit 1;
+fi
+
+prefix="$3"
+
+lines=`cat "$1" | wc -l`;
+exec 6< "$1"
+line=1;
+
+rm -f `cut -f 2 "$1" | sort | uniq | sed "s/^/$prefix/" | sed "s/\$/.txt/"`;
+
+for ((line=1;lines-line+1;line++)) ; do
+	read -u 6 -d "	" name;
+	read -u 6 -d "	" chain;
+	read -u 6 -d "	" link;
+	read -u 6 -d "	" x;
+	read -u 6 -d "	" y;
+	read -u 6 z;
+	scale=`grep $chain "$2" | sed "s/^[^0-9.]*//"`
+	x=`echo "scale=3; $x / $scale" | bc`
+	y=`echo "scale=3; $y / $scale" | bc`
+	z=`echo "scale=3; $z / $scale" | bc`
+	printf "$link\t$x\t$y\t$z\n" >> "$prefix$chain.txt"
 done
+
+exec 6<&-
