Index: Tekkotsu/project/Makefile
diff -c Tekkotsu/project/Makefile:1.46 Tekkotsu/project/Makefile:1.56
*** Tekkotsu/project/Makefile:1.46	Thu Oct  9 20:45:32 2003
--- Tekkotsu/project/Makefile	Tue Dec 23 01:33:44 2003
***************
*** 53,68 ****
  # need to have optimizations turned off, and several TinyFTPD sources
  # have -Weffc++ and -DOPENR_DEBUG turned off.  If you want to modify
  # these exceptions, look in the middle of the 'Makefile Machinery'
! # section.
  CXXFLAGS= \
! 	-g -O2 \
  	-Wall -W -Wshadow -Wlarger-than-8192 -Wpointer-arith -Wcast-qual \
  	-Woverloaded-virtual -Weffc++ -Winline -Wdeprecated -Wnon-virtual-dtor \
  	-I"`pwd`" -I$(TEKKOTSU_ROOT) \
  	-isystem $(OPENRSDK_ROOT)/OPEN_R/include/MCOOP \
! 	-isystem $(OPENRSDK_ROOT)/OPEN_R/include/R4000 -isystem $(OPENRSDK_ROOT)/OPEN_R/include \
  	-DPLATFORM_APERIOS -DDEBUG -DOPENR_DEBUG -D$(TEKKOTSU_TARGET_MODEL) $(GLOBAL_MAP) \
  
  
  ###################################################
  ##              SOURCE CODE LIST                 ##
--- 53,73 ----
  # need to have optimizations turned off, and several TinyFTPD sources
  # have -Weffc++ and -DOPENR_DEBUG turned off.  If you want to modify
  # these exceptions, look in the middle of the 'Makefile Machinery'
! # section. (grep/search for the file name)
  CXXFLAGS= \
! 	-g -pipe -O2 -frename-registers -fomit-frame-pointer -ffast-math -fno-common \
  	-Wall -W -Wshadow -Wlarger-than-8192 -Wpointer-arith -Wcast-qual \
  	-Woverloaded-virtual -Weffc++ -Winline -Wdeprecated -Wnon-virtual-dtor \
  	-I"`pwd`" -I$(TEKKOTSU_ROOT) \
+ 	-isystem $(TEKKOTSU_ROOT)/Shared/jpeg-6b \
  	-isystem $(OPENRSDK_ROOT)/OPEN_R/include/MCOOP \
! 	-isystem $(OPENRSDK_ROOT)/OPEN_R/include/R4000 \
! 	-isystem $(OPENRSDK_ROOT)/OPEN_R/include \
  	-DPLATFORM_APERIOS -DDEBUG -DOPENR_DEBUG -D$(TEKKOTSU_TARGET_MODEL) $(GLOBAL_MAP) \
  
+ #Suggested additional flags
+ # -ffast-math
+ 
  
  ###################################################
  ##              SOURCE CODE LIST                 ##
***************
*** 80,85 ****
--- 85,92 ----
  # into MMCombo.
  MAIN_SRCS:=$(PROJ_SRCS)
  
+ USERLIBS:=$(TEKKOTSU_ROOT)/Shared/jpeg-6b/libjpeg.a
+ 
  
  ###################################################
  ##               PROCESS SETUP                   ##
***************
*** 94,102 ****
  
  # These all are relative to TEKKOTSU_ROOT
  PROCESS_OBJS=MMCombo TinyFTPD SoundPlay
! MMCombo_COMP=MMCombo MMCombo/MMComboStub.o Behaviors Events Motion Shared SoundPlay/SoundManager.o SoundPlay/WAV.o Vision Wireless WorldModel2
  TinyFTPD_COMP=TinyFTPD TinyFTPD/TinyFTPDStub.o
! SoundPlay_COMP=SoundPlay SoundPlay/SoundPlayStub.o Shared/Config.o Shared/ProcessID.o Events/EventRouter.o Events/EventTranslator.o Events/EventBase.o Shared/LoadSave.o Shared/get_time.o
  STUB_FILES:=$(addprefix $(TEKKOTSU_ROOT)/,$(addsuffix /stub.cfg,$(PROCESS_OBJS)))
  STUB_CHECK_FILES:=$(addprefix $(TEKKOTSU_ROOT)/$(BUILDDIR)/,$(subst /,-,$(STUB_FILES)))
  
--- 101,109 ----
  
  # These all are relative to TEKKOTSU_ROOT
  PROCESS_OBJS=MMCombo TinyFTPD SoundPlay
! MMCombo_COMP=MMCombo MMCombo/MMComboStub.o Behaviors Events Motion Shared SoundPlay/SoundManager.o SoundPlay/WAV.o Vision Wireless
  TinyFTPD_COMP=TinyFTPD TinyFTPD/TinyFTPDStub.o
! SoundPlay_COMP=SoundPlay SoundPlay/SoundPlayStub.o Shared/Config.o Shared/ProcessID.o Events/EventRouter.o Events/EventTranslator.o Events/EventBase.o Events/VisionObjectEvent.o Shared/LoadSave.o Shared/get_time.o
  STUB_FILES:=$(addprefix $(TEKKOTSU_ROOT)/,$(addsuffix /stub.cfg,$(PROCESS_OBJS)))
  STUB_CHECK_FILES:=$(addprefix $(TEKKOTSU_ROOT)/$(BUILDDIR)/,$(subst /,-,$(STUB_FILES)))
  
***************
*** 127,133 ****
  else
  
  PROCESSES=MMCOMBO TINYFTPD SNDPLAY
! MMCOMBO_OBJS:=$(MAIN_SRCS:$(SRCSUFFIX)=.o) $(TEKKOTSU_ROOT)/$(BUILDDIR)/MMCombo.o
  MMCOMBO_OCF:=$(TEKKOTSU_ROOT)/MMCombo/MMCombo.ocf
  TINYFTPD_OBJS:=$(TEKKOTSU_ROOT)/$(BUILDDIR)/TinyFTPD.o
  TINYFTPD_OCF:=$(TEKKOTSU_ROOT)/TinyFTPD/TinyFTPD.ocf
--- 134,140 ----
  else
  
  PROCESSES=MMCOMBO TINYFTPD SNDPLAY
! MMCOMBO_OBJS:=$(MAIN_SRCS:$(SRCSUFFIX)=.o) $(MAIN_SRCS:$(SRCSUFFIX)=.a) $(TEKKOTSU_ROOT)/$(BUILDDIR)/MMCombo.o
  MMCOMBO_OCF:=$(TEKKOTSU_ROOT)/MMCombo/MMCombo.ocf
  TINYFTPD_OBJS:=$(TEKKOTSU_ROOT)/$(BUILDDIR)/TinyFTPD.o
  TINYFTPD_OCF:=$(TEKKOTSU_ROOT)/TinyFTPD/TinyFTPD.ocf
***************
*** 189,195 ****
  # list of all source files of all components, sorted to remove
  # duplicates.  This gives us all the source files which we care about,
  # all in one place.
! SRCS:=$(sort $(foreach comp,$(COMPONENTS), $(if $(suffix $(comp)),$(TEKKOTSU_ROOT)/$(basename $(comp)).cc,$(shell find $(TEKKOTSU_ROOT)/$(comp) -name "*.cc") ))) $(MAIN_SRCS)
  OBJS:=$(SRCS:$(SRCSUFFIX)=.o)
  DEPENDS:=$(SRCS:$(SRCSUFFIX)=.d)
  
--- 196,202 ----
  # list of all source files of all components, sorted to remove
  # duplicates.  This gives us all the source files which we care about,
  # all in one place.
! SRCS:=$(sort $(foreach comp,$(COMPONENTS), $(if $(suffix $(filter-out %.a,$(comp))),$(TEKKOTSU_ROOT)/$(basename $(comp)).cc,$(shell find $(TEKKOTSU_ROOT)/$(comp) -name "*.cc") ))) $(MAIN_SRCS)
  OBJS:=$(SRCS:$(SRCSUFFIX)=.o)
  DEPENDS:=$(SRCS:$(SRCSUFFIX)=.d)
  
***************
*** 220,227 ****
  updateTools:
  	cd $(TEKKOTSU_ROOT)/tools && $(MAKE);
  
! compile: reportTarget cleanTemps updateTools $(INSTALL_BINS)
  	@image="$(BUILDDIR)/$(notdir $(MEMSTICK_ROOT))" ; \
  	if [ \! -d $$image ] ; then \
  		if [ \! -d $(OPENRSDK_ROOT)/OPEN_R/MS/WCONSOLE/nomemprot ] ; then \
  			echo "Could not find OPEN-R system binaries" ; \
--- 227,238 ----
  updateTools:
  	cd $(TEKKOTSU_ROOT)/tools && $(MAKE);
  
! compile: reportTarget cleanTemps updateTools $(USERLIBS) $(INSTALL_BINS)
  	@image="$(BUILDDIR)/$(notdir $(MEMSTICK_ROOT))" ; \
+ 	if [ $(TEKKOTSU_ROOT)/TARGET_MODEL -nt $$image ] ; then \
+ 		echo "Deleting old cached OPEN-R binaries"; \
+ 		rm -rf $$image ; \
+ 	fi; \
  	if [ \! -d $$image ] ; then \
  		if [ \! -d $(OPENRSDK_ROOT)/OPEN_R/MS/WCONSOLE/nomemprot ] ; then \
  			echo "Could not find OPEN-R system binaries" ; \
***************
*** 254,260 ****
  	touch $@ ;
  
  %.d : $(STUB_CHECK_FILES) %$(SRCSUFFIX)
! 	@echo Building $@ for $*$(SRCSUFFIX)
  	@$(CXX) $(CXXFLAGS) -MP -MG -MT $@ -MT $*.o -MM $*$(SRCSUFFIX) > $@
  
  %/def.h %/entry.h: %/stub.cfg
--- 265,271 ----
  	touch $@ ;
  
  %.d : $(STUB_CHECK_FILES) %$(SRCSUFFIX)
! 	@echo Building $@...
  	@$(CXX) $(CXXFLAGS) -MP -MG -MT $@ -MT $*.o -MM $*$(SRCSUFFIX) > $@
  
  %/def.h %/entry.h: %/stub.cfg
***************
*** 290,351 ****
  	@exit 1
  
  #The "fork" we do of MMCombo into MainObj and MotoObj crashes with optimization... not a big loss, just turn it off for these files
! $(TEKKOTSU_ROOT)/MMCombo/MMCombo.o $(TEKKOTSU_ROOT)/MMCombo/MMComboStub.o: %.o: %$(SRCSUFFIX) %.d $(FILTERSYSWARN)  $(TEKKOTSU_ROOT)/TARGET_MODEL
  	@if [ -r dist_hosts.txt ] ; then \
  		echo "Adding $@ to job list"; \
  		echo "$(CXX) $(filter-out -O2,$(CXXFLAGS)) -o $@ -c $< > $*.log 2>&1; retval=\$$?; cat $*.log | $(FILTERSYSWARN) | $(COLORFILT); test \$$retval -eq 0;" >> $(BUILDDIR)/joblist.txt ; \
  		touch $@; \
  		echo "$@" >> $(BUILDDIR)/touched.txt ; \
  	else \
! 		echo "Compiling $< into $@... (no -O2)"; \
  		$(CXX) $(filter-out -O2,$(CXXFLAGS)) -o $@ -c $< > $*.log 2>&1; \
  		retval=$$?; \
  		cat $*.log | $(FILTERSYSWARN) | $(COLORFILT); \
  		test $$retval -eq 0; \
  	fi;
  
! $(TEKKOTSU_ROOT)/TinyFTPD/TinyFTPD.o $(TEKKOTSU_ROOT)/TinyFTPD/FtpMethod.o $(TEKKOTSU_ROOT)/TinyFTPD/FtpRequest.o $(TEKKOTSU_ROOT)/TinyFTPD/FtpDTP.o $(TEKKOTSU_ROOT)/TinyFTPD/FtpPI.o: %.o: %$(SRCSUFFIX) %.d $(FILTERSYSWARN) $(TEKKOTSU_ROOT)/TARGET_MODEL
  	@if [ -r dist_hosts.txt ] ; then \
  		echo "Adding $@ to job list"; \
  		echo "$(CXX) $(filter-out -DOPENR_DEBUG,$(filter-out -Weffc++,$(CXXFLAGS))) -o $@ -c $< > $*.log 2>&1; retval=\$$?; cat $*.log | $(FILTERSYSWARN) | $(COLORFILT); test \$$retval -eq 0;" >> $(BUILDDIR)/joblist.txt ; \
  		touch $@; \
  		echo "$@" >> $(BUILDDIR)/touched.txt ; \
  	else \
! 		echo "Compiling $< into $@... (reduced warnings, no OPENR_DEBUG)"; \
  		$(CXX) $(filter-out -DOPENR_DEBUG,$(filter-out -Weffc++,$(CXXFLAGS))) -o $@ -c $< > $*.log 2>&1; \
  		retval=$$?; \
  		cat $*.log | $(FILTERSYSWARN) | $(COLORFILT); \
  		test $$retval -eq 0; \
  	fi;
  
! $(TEKKOTSU_ROOT)/SoundPlay/WAV.o $(TEKKOTSU_ROOT)/Vision/Vision.o: %.o: %$(SRCSUFFIX) %.d $(FILTERSYSWARN) $(TEKKOTSU_ROOT)/TARGET_MODEL
  	@if [ -r dist_hosts.txt ] ; then \
  		echo "Adding $@ to job list"; \
  		echo "$(CXX) $(filter-out -Weffc++,$(CXXFLAGS)) -o $@ -c $< > $*.log 2>&1; retval=\$$?; cat $*.log | $(FILTERSYSWARN) | $(COLORFILT); test \$$retval -eq 0;" >> $(BUILDDIR)/joblist.txt ; \
  		touch $@; \
  		echo "$@" >> $(BUILDDIR)/touched.txt ; \
  	else \
! 		echo "Compiling $< into $@... (reduced warnings)"; \
  		$(CXX) $(filter-out -Weffc++,$(CXXFLAGS)) -o $@ -c $< > $*.log 2>&1; \
  		retval=$$?; \
  		cat $*.log | $(FILTERSYSWARN) | $(COLORFILT); \
  		test $$retval -eq 0; \
  	fi;
  
! %.o: %$(SRCSUFFIX) %.d $(FILTERSYSWARN) $(TEKKOTSU_ROOT)/TARGET_MODEL
  	@if [ -r dist_hosts.txt ] ; then \
  		echo "Adding $@ to job list"; \
  		echo "$(CXX) $(CXXFLAGS) -o $@ -c $< > $*.log 2>&1; retval=\$$?; cat $*.log | $(FILTERSYSWARN) | $(COLORFILT); test \$$retval -eq 0;" >> $(BUILDDIR)/joblist.txt ; \
  		touch $@; \
  		echo "$@" >> $(BUILDDIR)/touched.txt ; \
  	else \
! 		echo "Compiling $< into $@..."; \
  		$(CXX) $(CXXFLAGS) -o $@ -c $< > $*.log 2>&1; \
  		retval=$$?; \
  		cat $*.log | $(FILTERSYSWARN) | $(COLORFILT); \
  		test $$retval -eq 0; \
  	fi;
  
  $(TEKKOTSU_ROOT)/TARGET_MODEL:
  	$(error Could not find $(TEKKOTSU_ROOT)/TARGET_MODEL)
  
--- 301,366 ----
  	@exit 1
  
  #The "fork" we do of MMCombo into MainObj and MotoObj crashes with optimization... not a big loss, just turn it off for these files
! $(TEKKOTSU_ROOT)/MMCombo/MMCombo.o $(TEKKOTSU_ROOT)/MMCombo/MMComboStub.o: %.o: %$(SRCSUFFIX) $(FILTERSYSWARN)  $(TEKKOTSU_ROOT)/TARGET_MODEL
  	@if [ -r dist_hosts.txt ] ; then \
  		echo "Adding $@ to job list"; \
  		echo "$(CXX) $(filter-out -O2,$(CXXFLAGS)) -o $@ -c $< > $*.log 2>&1; retval=\$$?; cat $*.log | $(FILTERSYSWARN) | $(COLORFILT); test \$$retval -eq 0;" >> $(BUILDDIR)/joblist.txt ; \
  		touch $@; \
  		echo "$@" >> $(BUILDDIR)/touched.txt ; \
  	else \
! 		echo "Compiling $<... (no -O2)"; \
  		$(CXX) $(filter-out -O2,$(CXXFLAGS)) -o $@ -c $< > $*.log 2>&1; \
  		retval=$$?; \
  		cat $*.log | $(FILTERSYSWARN) | $(COLORFILT); \
  		test $$retval -eq 0; \
  	fi;
  
! $(TEKKOTSU_ROOT)/TinyFTPD/TinyFTPD.o $(TEKKOTSU_ROOT)/TinyFTPD/FtpMethod.o $(TEKKOTSU_ROOT)/TinyFTPD/FtpRequest.o $(TEKKOTSU_ROOT)/TinyFTPD/FtpDTP.o $(TEKKOTSU_ROOT)/TinyFTPD/FtpPI.o: %.o: %$(SRCSUFFIX) $(FILTERSYSWARN) $(TEKKOTSU_ROOT)/TARGET_MODEL
  	@if [ -r dist_hosts.txt ] ; then \
  		echo "Adding $@ to job list"; \
  		echo "$(CXX) $(filter-out -DOPENR_DEBUG,$(filter-out -Weffc++,$(CXXFLAGS))) -o $@ -c $< > $*.log 2>&1; retval=\$$?; cat $*.log | $(FILTERSYSWARN) | $(COLORFILT); test \$$retval -eq 0;" >> $(BUILDDIR)/joblist.txt ; \
  		touch $@; \
  		echo "$@" >> $(BUILDDIR)/touched.txt ; \
  	else \
! 		echo "Compiling $<... (reduced warnings, no OPENR_DEBUG)"; \
  		$(CXX) $(filter-out -DOPENR_DEBUG,$(filter-out -Weffc++,$(CXXFLAGS))) -o $@ -c $< > $*.log 2>&1; \
  		retval=$$?; \
  		cat $*.log | $(FILTERSYSWARN) | $(COLORFILT); \
  		test $$retval -eq 0; \
  	fi;
  
! $(TEKKOTSU_ROOT)/SoundPlay/WAV.o $(TEKKOTSU_ROOT)/Vision/Vision.o: %.o: %$(SRCSUFFIX) $(FILTERSYSWARN) $(TEKKOTSU_ROOT)/TARGET_MODEL
  	@if [ -r dist_hosts.txt ] ; then \
  		echo "Adding $@ to job list"; \
  		echo "$(CXX) $(filter-out -Weffc++,$(CXXFLAGS)) -o $@ -c $< > $*.log 2>&1; retval=\$$?; cat $*.log | $(FILTERSYSWARN) | $(COLORFILT); test \$$retval -eq 0;" >> $(BUILDDIR)/joblist.txt ; \
  		touch $@; \
  		echo "$@" >> $(BUILDDIR)/touched.txt ; \
  	else \
! 		echo "Compiling $<... (reduced warnings)"; \
  		$(CXX) $(filter-out -Weffc++,$(CXXFLAGS)) -o $@ -c $< > $*.log 2>&1; \
  		retval=$$?; \
  		cat $*.log | $(FILTERSYSWARN) | $(COLORFILT); \
  		test $$retval -eq 0; \
  	fi;
  
! %.o: %$(SRCSUFFIX) $(FILTERSYSWARN) $(TEKKOTSU_ROOT)/TARGET_MODEL
  	@if [ -r dist_hosts.txt ] ; then \
  		echo "Adding $@ to job list"; \
  		echo "$(CXX) $(CXXFLAGS) -o $@ -c $< > $*.log 2>&1; retval=\$$?; cat $*.log | $(FILTERSYSWARN) | $(COLORFILT); test \$$retval -eq 0;" >> $(BUILDDIR)/joblist.txt ; \
  		touch $@; \
  		echo "$@" >> $(BUILDDIR)/touched.txt ; \
  	else \
! 		echo "Compiling $<..."; \
  		$(CXX) $(CXXFLAGS) -o $@ -c $< > $*.log 2>&1; \
  		retval=$$?; \
  		cat $*.log | $(FILTERSYSWARN) | $(COLORFILT); \
  		test $$retval -eq 0; \
  	fi;
  
+ #This is for external libraries which we are including, such as libjpeg
+ %.a:
+ 	$(MAKE) -C $(dir $@) $(notdir $@)
+ 
  $(TEKKOTSU_ROOT)/TARGET_MODEL:
  	$(error Could not find $(TEKKOTSU_ROOT)/TARGET_MODEL)
  
***************
*** 360,386 ****
  	@if [ $(words $(sort $(foreach comp,$(addprefix $(TEKKOTSU_ROOT)/,$($(basename $(notdir $@))_COMP)), $(if $(suffix $(comp)),$(comp),$(patsubst %.cc,%.o,$(shell find $(comp) -name "*.cc")))))) -gt 20 ] ; then \
  		echo "$@ <- [...]"; \
  	else \
! 		echo "$@ <- $(sort $(foreach comp,$(addprefix $(TEKKOTSU_ROOT)/,$($(basename $(notdir $@))_COMP)), $(if $(suffix $(comp)),$(comp),$(patsubst %.cc,%.o,$(shell find $(comp) -name "*.cc") ))))"; \
  	fi;
! 	@$(LD) -i $(sort $(foreach comp,$(addprefix $(TEKKOTSU_ROOT)/,$($(basename $(notdir $@))_COMP)), $(if $(suffix $(comp)),$(comp),$(patsubst %.cc,%.o,$(shell find $(comp) -name "*.cc") )))) -o $@ ; \
  		if [ $$? -ne 0 ] ; then exit 1; fi;
  
  
  #PROC_BINS:    (executable binaries, uncompressed)
! #we have to do a couple extra steps to cd into the builddir because mkbin doesn't support
! # -o target in a different directory... drops an intermediate file in . and then complains
! $(BUILDDIR)/%$(BINSUFFIX):
  	@if [ -r dist_hosts.txt -a -r $(BUILDDIR)/joblist.txt ] ; then \
  		echo "Distributing compiles..."; \
  		../tools/pm.pl dist_hosts.txt $(BUILDDIR)/joblist.txt ; \
  	fi
  	@rm -f $(BUILDDIR)/joblist.txt; #this is so we don't rebuild multiple times
  	@echo "Creating executable binary..."
! 	@echo "$@ <- $($(basename $(notdir $@))_OBJS), $($(basename $(notdir $@))_OCF)"
  	@$(LD) -i $($(basename $(notdir $@))_OBJS) -o $(BUILDDIR)/tmp.o
  	@cp $($(basename $(notdir $@))_OCF) $(BUILDDIR)/tmp.ocf
  	@cd $(BUILDDIR) ; \
! 	$(MKBIN) $(MKBINFLAGS) -o $(notdir $@) tmp.o tmp.ocf $(LIBS) ; \
  	if [ $$? -gt 0 ] ; then \
  		echo "Build failed."; \
  		exit 1; \
--- 375,402 ----
  	@if [ $(words $(sort $(foreach comp,$(addprefix $(TEKKOTSU_ROOT)/,$($(basename $(notdir $@))_COMP)), $(if $(suffix $(comp)),$(comp),$(patsubst %.cc,%.o,$(shell find $(comp) -name "*.cc")))))) -gt 20 ] ; then \
  		echo "$@ <- [...]"; \
  	else \
! 		echo "$@ <- $(sort $(foreach comp,$(addprefix $(TEKKOTSU_ROOT)/,$(filter-out %.a,$($(basename $(notdir $@))_COMP))), $(if $(suffix $(comp)),$(comp),$(patsubst %.cc,%.o,$(shell find $(comp) -name "*.cc") ))))"; \
  	fi;
! 	@$(LD) -i $(sort $(foreach comp,$(addprefix $(TEKKOTSU_ROOT)/,$(filter-out %.a,$($(basename $(notdir $@))_COMP))), $(if $(suffix $(comp)),$(comp),$(patsubst %.cc,%.o,$(shell find $(comp) -name "*.cc") )))) -o $@ ; \
  		if [ $$? -ne 0 ] ; then exit 1; fi;
  
  
  #PROC_BINS:    (executable binaries, uncompressed)
! # we have to do a couple extra steps to cd into the builddir because
! # mkbin doesn't support -o target in a different directory... drops an
! # intermediate file in . and then complains (as of 1.1.3 anyway)
! $(BUILDDIR)/%$(BINSUFFIX): $(USERLIBS)
  	@if [ -r dist_hosts.txt -a -r $(BUILDDIR)/joblist.txt ] ; then \
  		echo "Distributing compiles..."; \
  		../tools/pm.pl dist_hosts.txt $(BUILDDIR)/joblist.txt ; \
  	fi
  	@rm -f $(BUILDDIR)/joblist.txt; #this is so we don't rebuild multiple times
  	@echo "Creating executable binary..."
! 	@echo "$@ <- $($(basename $(notdir $@))_OBJS), $($(basename $(notdir $@))_OCF), $(LIBS) $(USERLIBS)"; #we'll need to do some filtering on USERLIBS below because now we're in builddir
  	@$(LD) -i $($(basename $(notdir $@))_OBJS) -o $(BUILDDIR)/tmp.o
  	@cp $($(basename $(notdir $@))_OCF) $(BUILDDIR)/tmp.ocf
  	@cd $(BUILDDIR) ; \
! 	$(MKBIN) $(MKBINFLAGS) -o $(notdir $@) tmp.o -m tmp.ocf $(LIBS) $(filter /%,$(USERLIBS)) $(addprefix ../,$(filter-out /%,$(USERLIBS))) ; \
  	if [ $$? -gt 0 ] ; then \
  		echo "Build failed."; \
  		exit 1; \
***************
*** 441,446 ****
--- 457,463 ----
  	rm -f $(foreach proc,$(PROCESS_OBJS),$(TEKKOTSU_ROOT)/$(proc)/$(proc)Stub.cc $(TEKKOTSU_ROOT)/$(proc)/$(proc)Stub.h $(TEKKOTSU_ROOT)/$(proc)/def.h $(TEKKOTSU_ROOT)/$(proc)/entry.h)
  	rm -rf $(TEKKOTSU_ROOT)/$(BUILDDIR)
  	cd $(TEKKOTSU_ROOT)/tools ; $(MAKE) clean
+ 	$(foreach lib,$(USERLIBS),$(MAKE) -C $(dir $(lib)) clean)
  
  cleanDeps:
  	@printf "Cleaning all .d files corresponding to .cc files..."
Index: Tekkotsu/project/StartupBehavior.cc
diff -c Tekkotsu/project/StartupBehavior.cc:1.43 Tekkotsu/project/StartupBehavior.cc:1.55
*** Tekkotsu/project/StartupBehavior.cc:1.43	Tue Sep  2 17:10:53 2003
--- Tekkotsu/project/StartupBehavior.cc	Mon Jan 19 17:04:02 2004
***************
*** 3,8 ****
--- 3,9 ----
  #include "Behaviors/Controller.h"
  #include "Behaviors/Controls/BatteryCheckControl.h"
  #include "Behaviors/Controls/ControlBase.h"
+ #include "Behaviors/Controls/PostureEditor.h"
  #include "Behaviors/Controls/HelpControl.h"
  #include "Behaviors/Controls/RebootControl.h"
  #include "Behaviors/Controls/ShutdownControl.h"
***************
*** 14,27 ****
  #include "Motion/MotionSequenceMC.h"
  #include "Motion/MMAccessor.h"
  
- #include "Vision/Vision.h"
- 
  #include "SoundPlay/SoundManager.h"
  
  #include "Shared/ERS210Info.h"
  
  StartupBehavior theStartup; //!< used to initialize the global ::startupBehavior, used by MMCombo
! BehaviorBase& startupBehavior=theStartup; //!< used by MMCombo as the init behavior
  
  StartupBehavior::StartupBehavior()
  	: BehaviorBase(), spawned(),setup(),
--- 15,29 ----
  #include "Motion/MotionSequenceMC.h"
  #include "Motion/MMAccessor.h"
  
  #include "SoundPlay/SoundManager.h"
  
  #include "Shared/ERS210Info.h"
+ #include "Shared/ERS7Info.h"
+ 
+ #include "Shared/ProjectInterface.h"
  
  StartupBehavior theStartup; //!< used to initialize the global ::startupBehavior, used by MMCombo
! BehaviorBase& ProjectInterface::startupBehavior=theStartup; //!< used by MMCombo as the init behavior
  
  StartupBehavior::StartupBehavior()
  	: BehaviorBase(), spawned(),setup(),
***************
*** 35,41 ****
  
  void StartupBehavior::DoStart() {
  	BehaviorBase::DoStart();
! 	
  	//This will "fade" in the PIDs so the joints don't jerk to full power, also looks cooler
  	pid_id=motman->addMotion(SharedObject<PIDMC>(0),MotionManager::kEmergencyPriority+1,false);
  	//also, pause before we start fading in, PIDs take effect right away, before the emergencystop is picked up
--- 37,46 ----
  
  void StartupBehavior::DoStart() {
  	BehaviorBase::DoStart();
! 	//Initialize the Vision pipeline (it's probably a good idea to do this
! 	//first in case later stuff wants to reference the vision stages)
! 	initVision();
! 
  	//This will "fade" in the PIDs so the joints don't jerk to full power, also looks cooler
  	pid_id=motman->addMotion(SharedObject<PIDMC>(0),MotionManager::kEmergencyPriority+1,false);
  	//also, pause before we start fading in, PIDs take effect right away, before the emergencystop is picked up
***************
*** 71,76 ****
--- 76,84 ----
  			closemouth->setJointCmd(MouthOffset,outputRanges[MouthOffset][MaxRange],1);
  			motman->addMotion(closemouth,MotionCommand::kEmergencyPriority+2,true);
  	*/
+ 
+ 	//if you didn't want to start off paused, you should throw an un-estop event:
+ 	//erouter->postEvent(EventBase(EventBase::estopEGID,MotionManager::invalid_MC_ID,EventBase::deactivateETID,0));
  }
  
  void StartupBehavior::DoStop() {
***************
*** 83,89 ****
  /*!Uses a few timer events at the beginning to fade in the PID values, and closes the mouth too*/
  void StartupBehavior::processEvent(const EventBase&) {
  	static unsigned int start_time=-1U;
! 	const unsigned int tot_time=2047; //if this is set to 2048, i sometimes get funny errors: [oid:80000034,prio:1] AGRMSDriver::SetGain() : 0x0A IS USED FOR GAIN SHIFT VALUE.
  	if(start_time==-1U) { //first time
  		start_time=get_time();
  		MMAccessor<EmergencyStopMC>(stop_id)->takeSnapshot(); //take new snapshot with hopefully valid data
--- 91,97 ----
  /*!Uses a few timer events at the beginning to fade in the PID values, and closes the mouth too*/
  void StartupBehavior::processEvent(const EventBase&) {
  	static unsigned int start_time=-1U;
! 	const unsigned int tot_time=2000; 
  	if(start_time==-1U) { //first time
  		start_time=get_time();
  		MMAccessor<EmergencyStopMC>(stop_id)->takeSnapshot(); //take new snapshot with hopefully valid data
***************
*** 94,99 ****
--- 102,109 ----
  		{ MMAccessor<PIDMC>(pid_id)->setAllPowerLevel(power); }
  		if(state->robotDesign & WorldState::ERS210Mask)
  			{ MMAccessor<EmergencyStopMC>(stop_id)->setOutputCmd(ERS210Info::MouthOffset,outputRanges[ERS210Info::MouthOffset][MaxRange]); }
+ 		if(state->robotDesign & WorldState::ERS7Mask)
+ 			{ MMAccessor<EmergencyStopMC>(stop_id)->setOutputCmd(ERS7Info::MouthOffset,outputRanges[ERS7Info::MouthOffset][MaxRange]); }
  	}
  	if((get_time()-start_time)>=tot_time) {
  		erouter->removeTimer(this);
***************
*** 102,113 ****
  	}
  }
  
- /*class WalkToPinkBallFactory : public Factory<WalkToTargetMachine> {
- 	public:
- 	static WalkToTargetMachine* construct() { return new WalkToTargetMachine(VisionEventNS::PinkBallSID); }
- 	};
- */
- 
  ControlBase*
  StartupBehavior::SetupMenus() {
  	std::cout << "CONTROLLER-INIT..." << std::flush;
--- 112,117 ----
***************
*** 122,135 ****
  		SetupStatusReports();
  		SetupFileAccess();
  		SetupWalkEdit();
! 		addItem(new ControlBase("Shutdown?"));
  		startSubMenu();
  		{ 
  			addItem(new ShutdownControl());
  			addItem(new RebootControl());
  		}
  		endSubMenu();
! 		addItem(new HelpControl(root));
  	}
  	
  	if(endSubMenu()!=root)
--- 126,141 ----
  		SetupStatusReports();
  		SetupFileAccess();
  		SetupWalkEdit();
! 		addItem(new PostureEditor());
! 		SetupVision();
! 		addItem(new ControlBase("Shutdown?","Confirms decision to reboot or shut down"));
  		startSubMenu();
  		{ 
  			addItem(new ShutdownControl());
  			addItem(new RebootControl());
  		}
  		endSubMenu();
! 		addItem(new HelpControl(root,2));
  	}
  	
  	if(endSubMenu()!=root)
Index: Tekkotsu/project/StartupBehavior.h
diff -c Tekkotsu/project/StartupBehavior.h:1.8 Tekkotsu/project/StartupBehavior.h:1.10
*** Tekkotsu/project/StartupBehavior.h:1.8	Tue Sep  2 23:23:39 2003
--- Tekkotsu/project/StartupBehavior.h	Tue Dec  9 18:56:58 2003
***************
*** 46,51 ****
--- 46,54 ----
  	virtual ControlBase* SetupStatusReports();       //!< sets up Status Reports menu
  	virtual ControlBase* SetupFileAccess();          //!< sets up File Access menu
  	virtual ControlBase* SetupWalkEdit();            //!< sets up Walk Editing menus (contributed by PGSS 2003 team project - see StartupBehavior_SetupWalkEdit.cc )
+ 	virtual ControlBase* SetupVision();              //!< sets up the Vision menu
+ 
+ 	virtual void initVision(); //!< Sets up the vision pipelines (held in StartupBehavior_SetupVision.cc)
  
  	virtual void startSubMenu(); //!< future calls to addItem() will be placed under the most recently added item
  	virtual void addItem(ControlBase * control); //!< inserts a control at the end of the menu
Index: Tekkotsu/project/StartupBehavior_SetupBackgroundBehaviors.cc
diff -c Tekkotsu/project/StartupBehavior_SetupBackgroundBehaviors.cc:1.3 Tekkotsu/project/StartupBehavior_SetupBackgroundBehaviors.cc:1.8
*** Tekkotsu/project/StartupBehavior_SetupBackgroundBehaviors.cc:1.3	Thu Oct  2 23:41:27 2003
--- Tekkotsu/project/StartupBehavior_SetupBackgroundBehaviors.cc	Mon Jan 19 03:03:22 2004
***************
*** 6,16 ****
  #include "Behaviors/Demos/AutoGetupBehavior.h"
  #include "Behaviors/Demos/BatteryMonitorBehavior.h"
  #include "Behaviors/Demos/HeadLevelBehavior.h"
- #include "Behaviors/Demos/EvtRptBehavior.h"
- #include "Behaviors/Demos/DumbWM2Behavior.h"
  #include "Behaviors/Demos/ToggleHeadLightBehavior.h"
  #include "Behaviors/Demos/HelloWorldBehavior.h"
  #include "Behaviors/Demos/CrashTestBehavior.h"
  
  #include "Shared/WorldState.h"
  #include "Shared/ERS210Info.h"
--- 6,17 ----
  #include "Behaviors/Demos/AutoGetupBehavior.h"
  #include "Behaviors/Demos/BatteryMonitorBehavior.h"
  #include "Behaviors/Demos/HeadLevelBehavior.h"
  #include "Behaviors/Demos/ToggleHeadLightBehavior.h"
  #include "Behaviors/Demos/HelloWorldBehavior.h"
  #include "Behaviors/Demos/CrashTestBehavior.h"
+ #include "Behaviors/Demos/RelaxBehavior.h"
+ #include "Behaviors/Demos/WorldStateVelDaemon.h"
+ #include "Behaviors/Demos/CameraBehavior.h"
  
  #include "Shared/WorldState.h"
  #include "Shared/ERS210Info.h"
***************
*** 22,34 ****
  	{ 
  		addItem((new BehaviorSwitchControl<AutoGetupBehavior>("AutoGetupBehavior",false))->start());
  		addItem((new BehaviorSwitchControl<BatteryMonitorBehavior>("BatteryMonitorBehavior",false))->start());
- 		addItem(new BehaviorSwitchControl<EvtRptBehavior>("EvtRptBehavior",false));
- 		addItem(new BehaviorSwitchControl<DumbWM2Behavior>("DumbWM2Behavior",false));
  		addItem(new BehaviorSwitchControl<HeadLevelBehavior>("HeadLevelBehavior",false));
  		if(state->robotDesign & WorldState::ERS220Mask)
  			addItem(new BehaviorSwitchControl<ToggleHeadLightBehavior>("ToggleHeadLightBehavior",false));
  		addItem(new BehaviorSwitchControl<HelloWorldBehavior>("HelloWorldBehavior",false));
  		addItem(new BehaviorSwitchControl<CrashTestBehavior>("CrashTestBehavior",false));
  	}
  	return endSubMenu();
  }
--- 23,36 ----
  	{ 
  		addItem((new BehaviorSwitchControl<AutoGetupBehavior>("AutoGetupBehavior",false))->start());
  		addItem((new BehaviorSwitchControl<BatteryMonitorBehavior>("BatteryMonitorBehavior",false))->start());
  		addItem(new BehaviorSwitchControl<HeadLevelBehavior>("HeadLevelBehavior",false));
  		if(state->robotDesign & WorldState::ERS220Mask)
  			addItem(new BehaviorSwitchControl<ToggleHeadLightBehavior>("ToggleHeadLightBehavior",false));
  		addItem(new BehaviorSwitchControl<HelloWorldBehavior>("HelloWorldBehavior",false));
  		addItem(new BehaviorSwitchControl<CrashTestBehavior>("CrashTestBehavior",false));
+ 		addItem(new BehaviorSwitchControl<RelaxBehavior>("RelaxBehavior",false));
+ 		addItem(new BehaviorSwitchControl<CameraBehavior>("CameraBehavior",false));
+ 		addItem((new BehaviorSwitchControl<WorldStateVelDaemon>("WorldStateVelDaemon",false))->start());
  	}
  	return endSubMenu();
  }
Index: Tekkotsu/project/StartupBehavior_SetupModeSwitch.cc
diff -c Tekkotsu/project/StartupBehavior_SetupModeSwitch.cc:1.7 Tekkotsu/project/StartupBehavior_SetupModeSwitch.cc:1.15
*** Tekkotsu/project/StartupBehavior_SetupModeSwitch.cc:1.7	Fri Oct 10 01:57:47 2003
--- Tekkotsu/project/StartupBehavior_SetupModeSwitch.cc	Wed Jan 21 00:48:58 2004
***************
*** 10,18 ****
  #include "Behaviors/Demos/FollowHeadBehavior.h"
  #include "Behaviors/Demos/WalkToTargetMachine.h"
  #include "Behaviors/Demos/BanditMachine.h"
- #include "Behaviors/Demos/WorldModel2Behavior.h"
  #include "Behaviors/Demos/SoundTestBehavior.h"
  #include "Behaviors/Demos/ExploreMachine.h"
  
  ControlBase*
  StartupBehavior::SetupModeSwitch() {
--- 10,20 ----
  #include "Behaviors/Demos/FollowHeadBehavior.h"
  #include "Behaviors/Demos/WalkToTargetMachine.h"
  #include "Behaviors/Demos/BanditMachine.h"
  #include "Behaviors/Demos/SoundTestBehavior.h"
  #include "Behaviors/Demos/ExploreMachine.h"
+ #include "Behaviors/Demos/PaceTargetsMachine.h"
+ 
+ #include "Shared/ProjectInterface.h"
  
  ControlBase*
  StartupBehavior::SetupModeSwitch() {
***************
*** 24,39 ****
  		BehaviorSwitchControlBase::BehaviorGroup * bg = new BehaviorSwitchControlBase::BehaviorGroup();
  
  		//put behaviors here:
! 		addItem(new BehaviorSwitchControl<AlanBehavior>("AlanBehavior",bg,false));
  		addItem(new BehaviorSwitchControl<FollowHeadBehavior>("FollowHeadBehavior",bg,false));
  		addItem(new BehaviorSwitchControl<SoundTestBehavior>("SoundTestBehavior",bg,false));
  		addItem(new BehaviorSwitchControl<ChaseBallBehavior>("ChaseBallBehavior",bg,false));
  		addItem(new BehaviorSwitchControl<SimpleChaseBallBehavior>("SimpleChaseBallBehavior",bg,false));
  		addItem(new BehaviorSwitchControl<StareAtBallBehavior>("StareAtBallBehavior",bg,false));
! 		addItem(new BehaviorSwitchControl<WalkToTargetMachine,Factory1Arg<WalkToTargetMachine,VisionEventNS::VisionSourceID_t,VisionEventNS::PinkBallSID> >("WalkToPinkBall",bg,false));
  		addItem(new BehaviorSwitchControl<BanditMachine>("BanditMachine",bg,false));
- 		addItem(new BehaviorSwitchControl<WorldModel2Behavior>("WorldModel2Behavior",bg,false));
  		addItem(new BehaviorSwitchControl<ExploreMachine>("ExploreMachine",bg,false));
  	}
  	return endSubMenu();
  }
--- 26,42 ----
  		BehaviorSwitchControlBase::BehaviorGroup * bg = new BehaviorSwitchControlBase::BehaviorGroup();
  
  		//put behaviors here:
! 		if(state->robotDesign&WorldState::ERS210Mask) //this one only really works on the 210
! 			addItem(new BehaviorSwitchControl<AlanBehavior>("AlanBehavior",bg,false));
  		addItem(new BehaviorSwitchControl<FollowHeadBehavior>("FollowHeadBehavior",bg,false));
  		addItem(new BehaviorSwitchControl<SoundTestBehavior>("SoundTestBehavior",bg,false));
  		addItem(new BehaviorSwitchControl<ChaseBallBehavior>("ChaseBallBehavior",bg,false));
  		addItem(new BehaviorSwitchControl<SimpleChaseBallBehavior>("SimpleChaseBallBehavior",bg,false));
  		addItem(new BehaviorSwitchControl<StareAtBallBehavior>("StareAtBallBehavior",bg,false));
! 		addItem(new BehaviorSwitchControlBase(new WalkToTargetMachine(ProjectInterface::visPinkBallSID),bg));
  		addItem(new BehaviorSwitchControl<BanditMachine>("BanditMachine",bg,false));
  		addItem(new BehaviorSwitchControl<ExploreMachine>("ExploreMachine",bg,false));
+ 		addItem(new BehaviorSwitchControl<PaceTargetsMachine>("PaceTargetsMachine",bg,false));
  	}
  	return endSubMenu();
  }
Index: Tekkotsu/project/StartupBehavior_SetupStatusReports.cc
diff -c Tekkotsu/project/StartupBehavior_SetupStatusReports.cc:1.1 Tekkotsu/project/StartupBehavior_SetupStatusReports.cc:1.2
*** Tekkotsu/project/StartupBehavior_SetupStatusReports.cc:1.1	Fri Jul 25 21:48:59 2003
--- Tekkotsu/project/StartupBehavior_SetupStatusReports.cc	Tue Dec 23 01:33:44 2003
***************
*** 6,11 ****
--- 6,12 ----
  #include "Behaviors/Controls/FreeMemReportControl.h"
  #include "Behaviors/Controls/ProfilerCheckControl.h"
  #include "Behaviors/Controls/EventLogger.h"
+ #include "Behaviors/Controls/SensorObserverControl.h"
  
  ControlBase*
  StartupBehavior::SetupStatusReports() {
***************
*** 15,20 ****
--- 16,22 ----
  		addItem(new BatteryCheckControl());
  		addItem(new ProfilerCheckControl());
  		addItem(new EventLogger());
+ 		addItem(new SensorObserverControl());
  		FreeMemReportControl * tmp=new FreeMemReportControl();
  		tmp->DoStart();
  		addItem(tmp);
Index: Tekkotsu/project/StartupBehavior_SetupTekkotsuMon.cc
diff -c Tekkotsu/project/StartupBehavior_SetupTekkotsuMon.cc:1.7 Tekkotsu/project/StartupBehavior_SetupTekkotsuMon.cc:1.12
*** Tekkotsu/project/StartupBehavior_SetupTekkotsuMon.cc:1.7	Thu Oct  9 20:47:55 2003
--- Tekkotsu/project/StartupBehavior_SetupTekkotsuMon.cc	Mon Jan 19 15:36:56 2004
***************
*** 9,28 ****
  #include "Behaviors/Mon/Aibo3DControllerBehavior.h"
  #include "Behaviors/Mon/EStopControllerBehavior.h"
  #include "Behaviors/Mon/WMMonitorBehavior.h"
  
  ControlBase*
  StartupBehavior::SetupTekkotsuMon() {
  	addItem(new ControlBase("TekkotsuMon","Servers for GUIs"));
  	startSubMenu();
  	{ 
  		addItem((new BehaviorSwitchControl<HeadPointControllerBehavior>("Head Remote Control",false)));
  		addItem((new BehaviorSwitchControl<WalkControllerBehavior>("Walk Remote Control",false)));
  		addItem((new BehaviorSwitchControl<ViewWMVarsBehavior>("View WMVars",false)));
  		addItem((new BehaviorSwitchControl<WMMonitorBehavior>("Watchable Memory Monitor",false))->start());
! 		BehaviorSwitchControlBase::BehaviorGroup * aibo3D_bg = new BehaviorSwitchControlBase::BehaviorGroup();
! 		addItem((new BehaviorSwitchControl<Aibo3DControllerBehavior>("Aibo 3D",aibo3D_bg,false)));
! 		EStopControllerBehavior * ESCB=new EStopControllerBehavior(stop_id);
! 		addItem((new BehaviorSwitchControl<EStopControllerBehavior,Factory1Arg<EStopControllerBehavior,MotionManager::MC_ID,MotionManager::invalid_MC_ID> >("EStop Remote Control",ESCB))->start());
  	}
  	return endSubMenu();
  }
--- 9,32 ----
  #include "Behaviors/Mon/Aibo3DControllerBehavior.h"
  #include "Behaviors/Mon/EStopControllerBehavior.h"
  #include "Behaviors/Mon/WMMonitorBehavior.h"
+ #include "Behaviors/Mon/RawCamBehavior.h"
+ #include "Behaviors/Mon/SegCamBehavior.h"
+ #include "Behaviors/Mon/WorldStateSerializerBehavior.h"
  
  ControlBase*
  StartupBehavior::SetupTekkotsuMon() {
  	addItem(new ControlBase("TekkotsuMon","Servers for GUIs"));
  	startSubMenu();
  	{ 
+ 		addItem((new BehaviorSwitchControl<RawCamBehavior>("RawCamServer",false)));
+ 		addItem((new BehaviorSwitchControl<SegCamBehavior>("SegCamServer",false)));
  		addItem((new BehaviorSwitchControl<HeadPointControllerBehavior>("Head Remote Control",false)));
  		addItem((new BehaviorSwitchControl<WalkControllerBehavior>("Walk Remote Control",false)));
  		addItem((new BehaviorSwitchControl<ViewWMVarsBehavior>("View WMVars",false)));
  		addItem((new BehaviorSwitchControl<WMMonitorBehavior>("Watchable Memory Monitor",false))->start());
! 		addItem((new BehaviorSwitchControl<Aibo3DControllerBehavior>("Aibo 3D",false)));
! 		addItem((new BehaviorSwitchControl<WorldStateSerializerBehavior>("World State Serializer",false)));
! 		addItem((new BehaviorSwitchControlBase(new EStopControllerBehavior(stop_id)))->start());
  	}
  	return endSubMenu();
  }
Index: Tekkotsu/project/StartupBehavior_SetupVision.cc
diff -c /dev/null Tekkotsu/project/StartupBehavior_SetupVision.cc:1.11
*** /dev/null	Wed Jan 21 03:06:46 2004
--- Tekkotsu/project/StartupBehavior_SetupVision.cc	Tue Jan 20 22:53:28 2004
***************
*** 0 ****
--- 1,139 ----
+ #include "StartupBehavior.h"
+ 
+ #include "Shared/ProjectInterface.h"
+ #include "Shared/Config.h"
+ 
+ #include "Behaviors/Controls/BehaviorSwitchControl.h"
+ 
+ #include "Vision/RawCameraGenerator.h"
+ #include "Vision/InterleavedYUVGenerator.h"
+ #include "Vision/JPEGGenerator.h"
+ #include "Vision/SegmentedColorGenerator.h"
+ #include "Vision/RLEGenerator.h"
+ #include "Vision/RegionGenerator.h"
+ #include "Vision/BallDetectionGenerator.h"
+ #include "Vision/CDTGenerator.h"
+ 
+ using namespace ProjectInterface;
+ 
+ BallDetectionGenerator * pball=NULL;
+ BallDetectionGenerator * bball=NULL;
+ BallDetectionGenerator * handball=NULL;
+ 
+ /*! We set the default vision generators and source IDs here.
+  *
+  * The vis*SID and def*Generator variables are defined in
+  * ProjectInterface.  You can reassign their values as you see fit,
+  * which allows you to reorganize and adapt the vision pipeline, but
+  * still retain the ability of the included demo behaviors to access
+  * vision information.
+  */
+ void
+ StartupBehavior::initVision() {
+ 	//The value you set here will define the number of resolution layers available throughout the vision pipeline
+ 	//If you change this value, you should modify the *Layer variables in ProjectInterface (if you want to use them)
+ 	unsigned int numLayers=6;
+ 
+ 	//The top level layer will be double resolution
+ 	//This will set how many real layers are provided by the system (3 in Aperios)
+ 	//Any other layers will be subsamples of the lowest resolution system resolution
+ 	unsigned int numSystemLayers=3;
+ 
+ 	defRawCameraGenerator = new RawCameraGenerator(numSystemLayers,numLayers,EventBase::visOFbkEGID,0,visRawCameraSID);
+ 	defRawCameraGenerator->DoStart();
+ 	spawned.push_back(defRawCameraGenerator);
+ 
+ 	defInterleavedYUVGenerator = new InterleavedYUVGenerator(EventBase::visRawCameraEGID,visRawCameraSID,visInterleaveSID,RawCameraGenerator::CHAN_Y,RawCameraGenerator::CHAN_U,RawCameraGenerator::CHAN_V);
+ 	defInterleavedYUVGenerator->DoStart();
+ 	spawned.push_back(defInterleavedYUVGenerator);
+ 
+ 	defColorJPEGGenerator = new JPEGGenerator(EventBase::visInterleaveEGID,visInterleaveSID,visColorJPEGSID,JPEGGenerator::SRC_AUTO);
+ 	defColorJPEGGenerator->DoStart();
+ 	defColorJPEGGenerator->setName("ColorJPEGGenerator");
+ 	spawned.push_back(defColorJPEGGenerator);
+ 
+ 	defGrayscaleJPEGGenerator = new JPEGGenerator(EventBase::visRawCameraEGID,visRawCameraSID,visGrayscaleJPEGSID,JPEGGenerator::SRC_AUTO);
+ 	defGrayscaleJPEGGenerator->DoStart();
+ 	defGrayscaleJPEGGenerator->setName("ColorGrayscaleGenerator");
+ 	spawned.push_back(defGrayscaleJPEGGenerator);
+ 
+ 	// the hardware level CDT generator allows faster, but less flexible
+ 	// segmenting it still needs a little work though before it can be
+ 	// hooked up to the CMVision RLE generator.  See CDTGenerator class notes.
+ 	// defSegmentedColorGenerator = new CDTGenerator(numSystemLayers,numLayers,EventBase::visOFbkEGID,0,visSegmentSID);
+ 	SegmentedColorGenerator * segcol = new SegmentedColorGenerator(EventBase::visRawCameraEGID,visRawCameraSID,visSegmentSID);
+ 	defSegmentedColorGenerator = segcol;
+ 	segcol->loadColorInfo(config->vision.colors);
+ 	for(unsigned int i=0; i<config->vision.thresh.size(); i++)
+ 		segcol->loadThresholdMap(config->vision.thresh[i]);
+ 	if(config->vision.colors!="" && config->vision.thresh.size()>0) {
+ 		defSegmentedColorGenerator->DoStart();
+ 		spawned.push_back(defSegmentedColorGenerator);
+ 	}
+ 
+ 	defRLEGenerator = new RLEGenerator(EventBase::visSegmentEGID,visSegmentSID,visRLESID);
+ 	defRLEGenerator->DoStart();
+ 	spawned.push_back(defRLEGenerator);
+ 	
+ 	defRegionGenerator = new RegionGenerator(EventBase::visRLEEGID,visRLESID,visRegionSID);
+ 	defRegionGenerator->DoStart();
+ 	spawned.push_back(defRegionGenerator);
+ 	
+ 	// for lack of a better idea, the object recognizers below will all
+ 	// use the config->vision.rlecam_channel for picking the threshold
+ 	// file to use
+ 	// note that this is done here just once with the initial value, but
+ 	// the detectors won't get reloaded if you change the rlecam_channel
+ 	// later on
+ 
+ 	// these names match up with /ms/config/default.col - the default
+ 	// color information... if that changes, these should change too
+ 	unsigned int threshChan=config->vision.rlecam_channel;
+ 
+ 	// higher value reduce false events, but increase reaction time [0-inf]
+ 	unsigned int noiseFiltering=1;
+ 
+ 	// lower values increase sensitivity (and noise) [0-1]
+ 	float confidenceThreshold=.8;
+ 
+ 	unsigned int pinkIdx=segcol->getColorIndex("red");
+ 	if(pinkIdx!=-1U) {
+ 		pball = new BallDetectionGenerator(EventBase::visRegionEGID,visRegionSID,visPinkBallSID,pinkIdx,threshChan,noiseFiltering,confidenceThreshold);
+ 		pball->setName("PinkBallDetectionGenerator");
+ 		pball->DoStart();
+ 		spawned.push_back(pball);
+ 	}
+ 	unsigned int blueIdx=segcol->getColorIndex("blue");
+ 	if(blueIdx!=-1U) {
+ 		bball = new BallDetectionGenerator(EventBase::visRegionEGID,visRegionSID,visBlueBallSID,blueIdx,threshChan,noiseFiltering,confidenceThreshold);
+ 		pball->setName("BlueBallDetectionGenerator");
+ 		bball->DoStart();
+ 		spawned.push_back(bball);
+ 	}
+ 	unsigned int skinIdx=segcol->getColorIndex("brown");
+ 	if(skinIdx!=-1U) {
+ 		handball = new BallDetectionGenerator(EventBase::visRegionEGID,visRegionSID,visHandSID,skinIdx,threshChan,noiseFiltering,confidenceThreshold);
+ 		pball->setName("HandBallDetectionGenerator");
+ 		handball->DoStart();
+ 		spawned.push_back(handball);
+ 	}
+ }
+ 
+ ControlBase*
+ StartupBehavior::SetupVision() {
+ 	addItem(new ControlBase("Vision Pipeline","Start/Stop stages of the vision pipeline"));
+ 	startSubMenu();
+ 	{ 
+ 		addItem(new BehaviorSwitchControlBase(defRawCameraGenerator));
+ 		addItem(new BehaviorSwitchControlBase(defInterleavedYUVGenerator));
+ 		addItem(new BehaviorSwitchControlBase(defColorJPEGGenerator));
+ 		addItem(new BehaviorSwitchControlBase(defGrayscaleJPEGGenerator));
+ 		addItem(new BehaviorSwitchControlBase(defSegmentedColorGenerator));
+ 		addItem(new BehaviorSwitchControlBase(defRLEGenerator));
+ 		addItem(new BehaviorSwitchControlBase(defRegionGenerator));
+ 		addItem(new BehaviorSwitchControlBase(pball));
+ 		addItem(new BehaviorSwitchControlBase(bball));
+ 		addItem(new BehaviorSwitchControlBase(handball));
+ 	}
+ 	return endSubMenu();
+ }
Index: Tekkotsu/project/StartupBehavior_SetupWalkEdit.cc
diff -c Tekkotsu/project/StartupBehavior_SetupWalkEdit.cc:1.2 Tekkotsu/project/StartupBehavior_SetupWalkEdit.cc:1.6
*** Tekkotsu/project/StartupBehavior_SetupWalkEdit.cc:1.2	Thu Oct  9 20:45:32 2003
--- Tekkotsu/project/StartupBehavior_SetupWalkEdit.cc	Fri Jan 16 00:14:39 2004
***************
*** 9,18 ****
   * @author PA Gov. School for the Sciences 2003 Team Project - Motion group: Haoqian Chen, Yantian Martin, Jon Stahlman (creators)
   * 
   * $Author: ejt $
!  * $Name: HEAD $
!  * $Revision: 1.1 $
!  * $State: Exp $
!  * $Date: 2004/01/21 08:30:08 $
   */
  
  #include "StartupBehavior.h"
--- 9,18 ----
   * @author PA Gov. School for the Sciences 2003 Team Project - Motion group: Haoqian Chen, Yantian Martin, Jon Stahlman (creators)
   * 
   * $Author: ejt $
!  * $Name: HEAD $
!  * $Revision: 1.1 $
!  * $State: Exp $
!  * $Date: 2004/01/21 08:30:08 $
   */
  
  #include "StartupBehavior.h"
***************
*** 24,37 ****
  #include "Behaviors/Controls/LoadWalkControl.h"
  #include "Behaviors/Controls/SaveWalkControl.h"
  #include "Behaviors/Controls/ValueEditControl.h"
  
  ControlBase*
  StartupBehavior::SetupWalkEdit() {
  	addItem(new ControlBase("Walk Edit","Edit the walk parameters"));
  	startSubMenu();
  	{ 
! 		WalkControllerBehavior * walker = new WalkControllerBehavior ;
! 		addItem((new BehaviorSwitchControl<WalkControllerBehavior>("Walk Remote Control",walker)));
  
  		addItem(new ValueEditControl<float>("Slow Motion",walker->getWalkMC()->getSlowMo()));
  
--- 24,39 ----
  #include "Behaviors/Controls/LoadWalkControl.h"
  #include "Behaviors/Controls/SaveWalkControl.h"
  #include "Behaviors/Controls/ValueEditControl.h"
+ #include "Behaviors/Controls/WalkCalibration.h"
+ #include "Behaviors/Controls/LoadCalibration.h"
  
  ControlBase*
  StartupBehavior::SetupWalkEdit() {
  	addItem(new ControlBase("Walk Edit","Edit the walk parameters"));
  	startSubMenu();
  	{ 
! 		WalkControllerBehavior * walker = new WalkControllerBehavior();
! 		addItem((new BehaviorSwitchControlBase(walker)));
  
  		addItem(new ValueEditControl<float>("Slow Motion",walker->getWalkMC()->getSlowMo()));
  
***************
*** 117,122 ****
--- 119,140 ----
  			addItem(new ValueEditControl<double>("downimeLeg[FR]",&walker->getWalkMC()->getWP().leg[1].down_time));
  			addItem(new ValueEditControl<double>("downimeLeg[BL]",&walker->getWalkMC()->getWP().leg[2].down_time));
  			addItem(new ValueEditControl<double>("downimeLeg[BR]",&walker->getWalkMC()->getWP().leg[3].down_time));
+ 		}
+ 		endSubMenu();
+ 
+ 		addItem(new ControlBase("calibration","Edit the walk parameters"));
+ 		startSubMenu();
+ 		{ 
+ 			addItem(new WalkCalibration());
+ 			addItem(new LoadCalibration<3,11>(walker->getWalkMC()->getCP().f_calibration,walker->getWalkMC()->getCP().b_calibration));
+ 			addItem(new ValueEditControl<float>("forward max_accel",&walker->getWalkMC()->getCP().max_accel[WalkMC::CalibrationParam::forward]));
+ 			addItem(new ValueEditControl<float>("reverse max_accel",&walker->getWalkMC()->getCP().max_accel[WalkMC::CalibrationParam::reverse]));
+ 			addItem(new ValueEditControl<float>("strafe max_accel",&walker->getWalkMC()->getCP().max_accel[WalkMC::CalibrationParam::strafe]));
+ 			addItem(new ValueEditControl<float>("rotate max_accel",&walker->getWalkMC()->getCP().max_accel[WalkMC::CalibrationParam::rotate]));
+ 			addItem(new ValueEditControl<float>("forward max_vel",&walker->getWalkMC()->getCP().max_vel[WalkMC::CalibrationParam::forward]));
+ 			addItem(new ValueEditControl<float>("reverse max_vel",&walker->getWalkMC()->getCP().max_vel[WalkMC::CalibrationParam::reverse]));
+ 			addItem(new ValueEditControl<float>("strafe max_vel",&walker->getWalkMC()->getCP().max_vel[WalkMC::CalibrationParam::strafe]));
+ 			addItem(new ValueEditControl<float>("rotate max_vel",&walker->getWalkMC()->getCP().max_vel[WalkMC::CalibrationParam::rotate]));
  		}
  		endSubMenu();
  
Index: Tekkotsu/project/ms/config/tekkotsu.cfg
diff -c Tekkotsu/project/ms/config/tekkotsu.cfg:1.21 Tekkotsu/project/ms/config/tekkotsu.cfg:1.39
*** Tekkotsu/project/ms/config/tekkotsu.cfg:1.21	Thu Oct  9 02:25:30 2003
--- Tekkotsu/project/ms/config/tekkotsu.cfg	Wed Jan 21 02:02:44 2004
***************
*** 1,32 ****
! # Tekkotsu config
  
  [Wireless]
! # id             unique id for Aibo
  id=1
  
  [Vision]
! # white_balance  indoor|flourescent|outdoor
  white_balance=flourescent
! # gain           low|mid|high
  gain=high
! # shutter_speed  slow|mid|fast
  shutter_speed=mid
! # resolution     quarter|half|full
  resolution=full
  
! thresh=/ms/config/phb.tm
! # other included options for thresh:
  # general.tm - general colors, previously 'default'
  # ball.tm - standard Sony pink ball definition
  # pb.tm - pink and blue
! # phb.tm - pink, skin, and blue
! #   note: "skin" is that of people who work in our lab - not a general sampling... :(
  colors=/ms/config/default.col
! raw_port=10011
! rle_port=10012
! obj_port=10013
! # raw_encoding   half|yfull_uvhalf|full
! raw_encoding=yfull_uvhalf
  
  [Main]
  console_port=10001
--- 1,142 ----
! ################################################################
! ###################   Tekkotsu config   ########################
! ################################################################
! #
! # Format:
! #
! # * Comments are any line beginning with '#'
! #
! # * Model specific regions can be denoted with <MODELNAME>...</MODELNAME>
! #   - Wildcards can also be used: <ERS-2*>...</ERS-2*>
! #   - Anything not within a model region is read by all models (i.e. <*>..</*>)
! #   - Don't get fancy with the "tags" - one per line, the parser's not that smart
! #     (feel free to hack it if you want - it's in Config.cc)
! #
! # * Sections are demarcated with [SECTIONNAME]
! #   - A section is only ended by another section beginning
! #   - Section transitions within a model region will only be read by that model
! #   - Section names are case insensitive
! #
! # * Otherwise, each line is interpreted as: variable=value
! #   - this should correspond to Config::curSectionName_config::variable
! #   - interpretation is up to the code in Config.cc
! #   - some variables are lists (additional assignments push on the list),
! #     others are simply overwritten if a new value is assigned.
! #   - variable names are case insensitive
! #
! # * You can override these at run time from the Controller using the command:
! #   !set section_name.variable=value
! #   - Of course, whether or not the new value will be picked up depends on
! #     how it is being used...
! #
! ##################################################################
  
  [Wireless]
! # unique id for Aibo (not used by Tekkotsu, but you might want it...)
  id=1
  
+ 
  [Vision]
! raw_port=10011
! rle_port=10012
! 
! # white_balance  indoor | flourescent | outdoor
! <ERS-2*>
  white_balance=flourescent
! </ERS-2*>
! <ERS-7>
! white_balance=indoor
! </ERS-7>
! 
! # gain           low | mid | high
! # higher gain will brighten the image, but increases noise
  gain=high
! 
! # shutter_speed  slow | mid | fast
! # slower shutter will brighten image, but increases motion blur
  shutter_speed=mid
! 
! # resolution     quarter | half | full
! # this is the resolution vision's object recognition system will run at
  resolution=full
  
! 
! ### Color Segmentation Threshold files: ###
! # Threshold (.tm) files define the mapping from full color to indexed color
! # You can uncomment more than one of these - they will be loaded into
! # separate channels of the segmenter.  The only cost of loading more
! # threshold files is memory - the CPU cost of actual segmenting is
! # only done when the channel is accessed.
! 
! # Included options for color threshold file:
! <ERS-2*>
! # phb.tm - pink, skin (hand), and blue
! #   note: "skin" is just of people who work in our lab - not a general sampling... :(
  # general.tm - general colors, previously 'default'
  # ball.tm - standard Sony pink ball definition
  # pb.tm - pink and blue
! thresh=/ms/config/phb.tm
! #thresh=/ms/config/general.tm
! thresh=/ms/config/ball.tm
! #thresh=/ms/config/pb.tm
! #thresh=/ms/config/ttt.tm
! </ERS-2*>
! <ERS-7>
! # 7red.tm - just your usual pink/red/purple color detection, nothing too fancy
! # ball.tm - standard Sony pink ball definition
! thresh=/ms/config/7red.tm
! thresh=/ms/config/ball.tm
! </ERS-7>
! 
! # the .col file gives names and a "typical" color for display
! # the indexes numbers it contains correspond to indexes in the .tm file
  colors=/ms/config/default.col
! 
! 
! ### Image Streaming Format ###
! 
! # rawcam_encoding   color | y_only | uv_only | u_only | v_only | y_dx_only | y_dy_only | y_dxdy_only
! rawcam_encoding=color
! 
! # compression       none | jpeg
! rawcam_compression=jpeg
! 
! # quality of jpeg compression 0-100
! rawcam_compress_quality=85
! 
! # apparently someone at sony thinks it's a good idea to replace some
! # pixels in each camera image with information like the frame number
! # and CDT count.  if non-zero, will replace those pixels with the
! # actual image pixel value in RawCamGenerator
! restore_image=1
! 
! # jpeg algorithm: 'islow' (integer, slow, but quality), 'ifast' (integer, fast, but rough), 'float' (floating point)
! jpeg_dct_method=ifast
! 
! # log_2 of number of pixels to skip, 0 sends reconstructed double
! #   resolution (mainly useful for Y channel, others are just resampled)
! #   our eyes are more sensitive to intensity (y channel) so you might
! #   want to send the UV channels at a lower resolution (higher skip) as
! #   a form of compression
! # rawcam_y_skip is used when in sending single channel, regardless of
! #   which channel
! # valid values are 0-5
! rawcam_y_skip=2
! rawcam_uv_skip=3
! 
! # you can send the original segmented image
! # or an RLE compressed version (which includes some noise removal)
! #rlecam_compression   none | rle
! rlecam_compression=rle
! 
! # this is the channel of the seg cam which should be sent.
! # corresponds to the index of the .tm file you want in thresh
! rlecam_channel=0
! 
! # this is the log_2 of pixels to skip when sending RLE encoded
! # segmented camera images, same idea as rawcam_*_skip
! rlecam_skip=1
! 
  
  [Main]
  console_port=10001
***************
*** 43,49 ****
--- 153,162 ----
  wmmonitor_port=10061
  use_VT100=true
  
+ 
  [Behaviors]
+ # your-stuff-here?
+ 
  
  [Controller]
  gui_port=10020
***************
*** 52,74 ****
--- 165,198 ----
  prev_snd=tick.wav
  read_snd=ping.wav
  cancel_snd=whoop.wav
+ error_snd=fart.wav
+ 
  
  [Motion]
  root=/ms/data/motion
+ walk=/ms/data/motion/walk.prm
  estop_on_snd=skid.wav
  estop_off_snd=yap.wav
  max_head_tilt_speed=2.1
  max_head_pan_speed=3.0
  max_head_roll_speed=3.0
  
+ 
  [Sound]
  root=/ms/data/sound
+ # volume = mute | level_1 | level_2 | level_3 | <direct dB setting: 0x8000 - 0xFFFF>
+ # if you directly set the decibel level, be warned sony recommends against going above 0xF600
+ # However, I believe the commercial software on the ERS-7 runs at 0xFF00
+ # going above 0xF800 on a ERS-210 causes distortion (clipping) - full volume on a ERS-7 sounds fine though.
+ volume=level_3
+ 
  sample_rate=16000
  sample_bits=16
  # Preload is a list of sounds to cache at boot
  # can be either root relative or full path
  preload=skid.wav
  preload=yap.wav
+ 
  
  [WorldModel2]
  dm_port=10041
Index: Tekkotsu/project/ms/data/motion/clearcal.txt
diff -c /dev/null Tekkotsu/project/ms/data/motion/clearcal.txt:1.1
*** /dev/null	Wed Jan 21 03:06:46 2004
--- Tekkotsu/project/ms/data/motion/clearcal.txt	Fri Jan 16 00:14:52 2004
***************
*** 0 ****
--- 1,6 ----
+ 1 0 0 0 0 0 0 0 0 0 0
+ 0 1 0 0 0 0 0 0 0 0 0
+ 0 0 1 0 0 0 0 0 0 0 0
+ 1 0 0 0 0 0 0 0 0 0 0
+ 0 1 0 0 0 0 0 0 0 0 0
+ 0 0 1 0 0 0 0 0 0 0 0
Index: Tekkotsu/project/ms/data/motion/pan_head.mot
diff -c /dev/null Tekkotsu/project/ms/data/motion/pan_head.mot:1.1
*** /dev/null	Wed Jan 21 03:06:47 2004
--- Tekkotsu/project/ms/data/motion/pan_head.mot	Sat Nov 22 15:34:39 2003
***************
*** 0 ****
--- 1,12 ----
+ #MSq
+ degrees
+ delay 50
+ NECK:tilt	15
+ NECK:roll	0
+ delay	850
+ NECK:pan~	-45
+ delay	900
+ NECK:pan~	45
+ NECK:tilt	15
+ NECK:roll	0
+ #END
Index: Tekkotsu/project/ms/data/motion/walk.prm
Index: Tekkotsu/project/ms/data/motion/walkcal.txt
diff -c /dev/null Tekkotsu/project/ms/data/motion/walkcal.txt:1.1
*** /dev/null	Wed Jan 21 03:06:47 2004
--- Tekkotsu/project/ms/data/motion/walkcal.txt	Fri Jan 16 00:14:53 2004
***************
*** 0 ****
--- 1,6 ----
+    1.1114950e+00   4.3793349e-02   3.6191516e+00  -2.8528403e-02  -1.0704690e+01  -1.6630287e+00  -1.0161892e-03  -1.9307957e-01  -1.0145463e-03   1.4387497e-01   2.5358894e+01
+   -1.5982849e-01   1.0121667e+00   8.4120978e+00  -1.3995280e-01  -5.7703782e+00   1.3642099e+01   1.1882969e-03  -1.1940036e-01   1.6860327e-03   2.2186785e-01   8.3247298e-01
+   -4.4086430e-04   3.6943915e-04   8.7219349e-01  -2.5621177e-04  -3.3549634e-02  -1.9053515e-03   2.5930239e-06  -7.8055622e-04   5.3484361e-06  -5.1855276e-05  -5.6217769e-03
+    1.4482688e+00  -2.8729604e-02   4.5315047e+00  -8.5684548e-02  -5.6070133e+00   1.6249840e+00   1.0114119e-03   2.0565857e-02   1.0163411e-03   2.9049390e-02   1.5138783e+01
+    1.8276090e-01   9.3280284e-01   8.4702686e+00  -2.6450978e-01  -8.3210648e+00   1.8642117e+01   1.8136075e-03  -1.1893791e-01  -6.1321027e-03   2.3487379e-01   6.6955859e+00
+   -3.4424686e-04   8.9065162e-04   8.7164554e-01   6.7355169e-04  -2.3861994e-02  -3.3616614e-02  -6.0636630e-06   3.8511214e-05   2.4927650e-05   9.4197067e-05  -2.2472680e-02
Index: Tekkotsu/project/ms/open-r/system/conf/wlandflt.txt
diff -c Tekkotsu/project/ms/open-r/system/conf/wlandflt.txt:1.17 Tekkotsu/project/ms/open-r/system/conf/wlandflt.txt:1.18
*** Tekkotsu/project/ms/open-r/system/conf/wlandflt.txt:1.17	Fri Oct 10 13:02:38 2003
--- Tekkotsu/project/ms/open-r/system/conf/wlandflt.txt	Tue Dec 23 01:33:44 2003
***************
*** 25,31 ****
  USE_DHCP=1
  
  # If you don't have DHCP, you'll need to set these manually
! #ETHER_IP=192.168.0.5
! #ETHER_NETMASK=255.255.255.0
! #IP_GATEWAY=192.168.0.1
  
--- 25,31 ----
  USE_DHCP=1
  
  # If you don't have DHCP, you'll need to set these manually
! #ETHER_IP=172.16.1.3
! #ETHER_NETMASK=255.255.0.0
! #IP_GATEWAY=172.16.0.1
  
