,
--- 121,128 ----
static copies of the documentation, there are two formats:
If you're using the most recent
version from the
CVS repository,
Index: Tekkotsu/project/Makefile
diff -c Tekkotsu/project/Makefile:1.56 Tekkotsu/project/Makefile:1.59
*** Tekkotsu/project/Makefile:1.56 Tue Dec 23 01:33:44 2003
--- Tekkotsu/project/Makefile Mon Feb 2 17:36:51 2004
***************
*** 126,132 ****
CONVERTCASE=$(TEKKOTSU_ROOT)/tools/makelowercase
BINSUFFIX=.bin
! INSTALLDIR=ms/open-r/mw/objs
MMCOMBOBIN=mmcombo.bin
MAINFORK=mainobj.bin
MOTOFORK=motoobj.bin
--- 126,133 ----
CONVERTCASE=$(TEKKOTSU_ROOT)/tools/makelowercase
BINSUFFIX=.bin
! MSIMGDIR=ms
! INSTALLDIR=$(MSIMGDIR)/open-r/mw/objs
MMCOMBOBIN=mmcombo.bin
MAINFORK=mainobj.bin
MOTOFORK=motoobj.bin
***************
*** 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
--- 135,141 ----
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
***************
*** 143,149 ****
CONVERTCASE=$(TEKKOTSU_ROOT)/tools/makeuppercase
BINSUFFIX=.BIN
! INSTALLDIR=MS/OPEN-R/MW/OBJS
MMCOMBOBIN=MMCOMBO.BIN
MAINFORK=MAINOBJ.BIN
MOTOFORK=MOTOOBJ.BIN
--- 144,151 ----
CONVERTCASE=$(TEKKOTSU_ROOT)/tools/makeuppercase
BINSUFFIX=.BIN
! MSIMGDIR=MS
! INSTALLDIR=$(MSIMGDIR)/OPEN-R/MW/OBJS
MMCOMBOBIN=MMCOMBO.BIN
MAINFORK=MAINOBJ.BIN
MOTOFORK=MOTOOBJ.BIN
***************
*** 241,247 ****
echo "Copying system files..." ; \
cp -r $(OPENRSDK_ROOT)/OPEN_R/MS/WCONSOLE/nomemprot $$image ; \
chmod -R u+w $$image ; \
! $(CONVERTCASE) -r $$image ; \
rm -f $$image/open-r/mw/conf/connect.cfg $$image/open-r/mw/conf/object.cfg $$image/open-r/system/conf/wlandflt.txt ; \
curt=`date +%Y%m%d%H%M`; \
find $$image -exec touch -ft $$curt \{\} \; ; \
--- 243,249 ----
echo "Copying system files..." ; \
cp -r $(OPENRSDK_ROOT)/OPEN_R/MS/WCONSOLE/nomemprot $$image ; \
chmod -R u+w $$image ; \
! (cd $$image; $(CONVERTCASE) -r . ); \
rm -f $$image/open-r/mw/conf/connect.cfg $$image/open-r/mw/conf/object.cfg $$image/open-r/system/conf/wlandflt.txt ; \
curt=`date +%Y%m%d%H%M`; \
find $$image -exec touch -ft $$curt \{\} \; ; \
***************
*** 407,440 ****
#INSTALL_BINS: (compressed executables, in proper location in image directory)
$(INSTALLDIR)/%$(BINSUFFIX): $(BUILDDIR)/%$(BINSUFFIX)
@echo "Compressing $< -> $@"
@gzip -c $< > $@;
$(INSTALLDIR)/$(MMCOMBOBIN): $(INSTALLDIR)/$(MAINFORK) $(INSTALLDIR)/$(MOTOFORK)
$(INSTALLDIR)/$(MAINFORK): $(BUILDDIR)/$(MMCOMBOBIN) $(TEKKOTSU_ROOT)/tools/binstrswap/binstrswap
@echo "Compressing $< ~> $@"
@$(TEKKOTSU_ROOT)/tools/binstrswap/binstrswap $< MMCombo MainObj | gzip -c > $@
# @sed 's/MMCombo/MainObj/g;s/mmcombo/mainobj/g' $< | gzip -c > $@
$(INSTALLDIR)/$(MOTOFORK): $(BUILDDIR)/$(MMCOMBOBIN) $(TEKKOTSU_ROOT)/tools/binstrswap/binstrswap
@echo "Compressing $< ~> $@"
@$(TEKKOTSU_ROOT)/tools/binstrswap/binstrswap $< MMCombo MotoObj | gzip -c > $@
# @sed 's/MMCombo/MotoObj/g;s/mmcombo/motoobj/g' $< | gzip -c > $@
install: compile
@echo "Installing files to memory stick at $(MEMSTICK_ROOT)"
! @$(TEKKOTSU_ROOT)/tools/cpymem --all --img ms --tgt $(MEMSTICK_ROOT) --tools $(TEKKOTSU_ROOT)/tools
update: compile $(TEKKOTSU_ROOT)/tools/evenmodtime/evenmodtime
! @echo "Syncing ms and $(MEMSTICK_ROOT)"
! @$(TEKKOTSU_ROOT)/tools/evenmodtime/evenmodtime `find ms`
@$(TEKKOTSU_ROOT)/tools/mntmem $(MEMSTICK_ROOT)
@if [ $(STRICT_MEMSTICK_IMAGE) ] ; then \
echo "Strict image copy is on." ; \
! rsync -rLtWCv --delete ms/* $(BUILDDIR)/$(notdir $(MEMSTICK_ROOT))/* $(MEMSTICK_ROOT) ; \
else \
! rsync -rLtWCv ms/* $(BUILDDIR)/$(notdir $(MEMSTICK_ROOT))/* $(MEMSTICK_ROOT) ; \
fi;
@$(TEKKOTSU_ROOT)/tools/umntmem $(MEMSTICK_ROOT)
--- 409,454 ----
#INSTALL_BINS: (compressed executables, in proper location in image directory)
$(INSTALLDIR)/%$(BINSUFFIX): $(BUILDDIR)/%$(BINSUFFIX)
+ @if [ \! -d "$(INSTALLDIR)" ] ; then \
+ echo "I can't find $(INSTALLDIR). You may need to run '$(TEKKOTSU_ROOT)/tools/makeuppercase -r ms'."; \
+ exit 1; \
+ fi;
@echo "Compressing $< -> $@"
@gzip -c $< > $@;
$(INSTALLDIR)/$(MMCOMBOBIN): $(INSTALLDIR)/$(MAINFORK) $(INSTALLDIR)/$(MOTOFORK)
$(INSTALLDIR)/$(MAINFORK): $(BUILDDIR)/$(MMCOMBOBIN) $(TEKKOTSU_ROOT)/tools/binstrswap/binstrswap
+ @if [ \! -d "$(INSTALLDIR)" ] ; then \
+ echo "I can't find $(INSTALLDIR). You may need to run '$(TEKKOTSU_ROOT)/tools/makeuppercase -r ms'."; \
+ exit 1; \
+ fi;
@echo "Compressing $< ~> $@"
@$(TEKKOTSU_ROOT)/tools/binstrswap/binstrswap $< MMCombo MainObj | gzip -c > $@
# @sed 's/MMCombo/MainObj/g;s/mmcombo/mainobj/g' $< | gzip -c > $@
$(INSTALLDIR)/$(MOTOFORK): $(BUILDDIR)/$(MMCOMBOBIN) $(TEKKOTSU_ROOT)/tools/binstrswap/binstrswap
+ @if [ \! -d "$(INSTALLDIR)" ] ; then \
+ echo "I can't find $(INSTALLDIR). You may need to run '$(TEKKOTSU_ROOT)/tools/makeuppercase -r ms'."; \
+ exit 1; \
+ fi;
@echo "Compressing $< ~> $@"
@$(TEKKOTSU_ROOT)/tools/binstrswap/binstrswap $< MMCombo MotoObj | gzip -c > $@
# @sed 's/MMCombo/MotoObj/g;s/mmcombo/motoobj/g' $< | gzip -c > $@
install: compile
@echo "Installing files to memory stick at $(MEMSTICK_ROOT)"
! @$(TEKKOTSU_ROOT)/tools/cpymem --all --img $(MSIMGDIR) --tgt $(MEMSTICK_ROOT) --tools $(TEKKOTSU_ROOT)/tools
update: compile $(TEKKOTSU_ROOT)/tools/evenmodtime/evenmodtime
! @echo "Syncing $(MSIMGDIR) and $(MEMSTICK_ROOT)"
! @$(TEKKOTSU_ROOT)/tools/evenmodtime/evenmodtime `find $(MSIMGDIR)`
@$(TEKKOTSU_ROOT)/tools/mntmem $(MEMSTICK_ROOT)
@if [ $(STRICT_MEMSTICK_IMAGE) ] ; then \
echo "Strict image copy is on." ; \
! rsync -rLtWCv --delete $(MSIMGDIR)/* $(BUILDDIR)/$(notdir $(MEMSTICK_ROOT))/* $(MEMSTICK_ROOT) ; \
else \
! rsync -rLtWCv $(MSIMGDIR)/* $(BUILDDIR)/$(notdir $(MEMSTICK_ROOT))/* $(MEMSTICK_ROOT) ; \
fi;
@$(TEKKOTSU_ROOT)/tools/umntmem $(MEMSTICK_ROOT)
Index: Tekkotsu/project/StartupBehavior_SetupModeSwitch.cc
diff -c Tekkotsu/project/StartupBehavior_SetupModeSwitch.cc:1.15 Tekkotsu/project/StartupBehavior_SetupModeSwitch.cc:1.17
*** Tekkotsu/project/StartupBehavior_SetupModeSwitch.cc:1.15 Wed Jan 21 00:48:58 2004
--- Tekkotsu/project/StartupBehavior_SetupModeSwitch.cc Thu Feb 5 18:57:40 2004
***************
*** 26,32 ****
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",bg,false));
addItem(new BehaviorSwitchControl("FollowHeadBehavior",bg,false));
addItem(new BehaviorSwitchControl("SoundTestBehavior",bg,false));
--- 26,32 ----
BehaviorSwitchControlBase::BehaviorGroup * bg = new BehaviorSwitchControlBase::BehaviorGroup();
//put behaviors here:
! if(state->robotDesign&(WorldState::ERS210Mask|WorldState::ERS7Mask)) //this one only really works on the 210 or 7
addItem(new BehaviorSwitchControl("AlanBehavior",bg,false));
addItem(new BehaviorSwitchControl("FollowHeadBehavior",bg,false));
addItem(new BehaviorSwitchControl("SoundTestBehavior",bg,false));
Index: Tekkotsu/project/StartupBehavior_SetupVision.cc
diff -c Tekkotsu/project/StartupBehavior_SetupVision.cc:1.11 Tekkotsu/project/StartupBehavior_SetupVision.cc:1.12
*** Tekkotsu/project/StartupBehavior_SetupVision.cc:1.11 Tue Jan 20 22:53:28 2004
--- Tekkotsu/project/StartupBehavior_SetupVision.cc Thu Feb 5 14:35:47 2004
***************
*** 54,60 ****
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
--- 54,60 ----
defGrayscaleJPEGGenerator = new JPEGGenerator(EventBase::visRawCameraEGID,visRawCameraSID,visGrayscaleJPEGSID,JPEGGenerator::SRC_AUTO);
defGrayscaleJPEGGenerator->DoStart();
! defGrayscaleJPEGGenerator->setName("GrayscaleJPEGGenerator");
spawned.push_back(defGrayscaleJPEGGenerator);
// the hardware level CDT generator allows faster, but less flexible
Index: Tekkotsu/project/ms/config/7red.tm
Index: Tekkotsu/tools/buildRelease
diff -c Tekkotsu/tools/buildRelease:1.30 Tekkotsu/tools/buildRelease:1.34
*** Tekkotsu/tools/buildRelease:1.30 Wed Jan 21 02:42:14 2004
--- Tekkotsu/tools/buildRelease Thu Feb 5 22:33:21 2004
***************
*** 39,50 ****
cd Tekkotsu_$1;
! #if [ `grep -c default.tm project/ms/config/tekkotsu.cfg` -gt 0 ] ; then
! # echo "You forgot to switch the thresholds file to the more general ball one";
! # exit 1;
! #fi;
! if [ `grep PROJECT_NUMBER docs/doxygencfg | grep -c $1` -eq 0 ] ; then
echo "Version mismatch with docs/doxygencfg - you forgot to update PROJECT_NUMBER";
exit 1;
fi;
--- 39,50 ----
cd Tekkotsu_$1;
! if [ `grep PROJECT_NUMBER docs/doxygencfg | grep -c "$1"` -eq 0 ] ; then
! echo "Version mismatch with docs/doxygencfg - you forgot to update PROJECT_NUMBER";
! exit 1;
! fi;
! if [ `grep -c "$1" docs/html/index.html` -eq 0 ] ; then
echo "Version mismatch with docs/doxygencfg - you forgot to update PROJECT_NUMBER";
exit 1;
fi;
***************
*** 59,65 ****
echo "Checking for docs/benchmarks/profilerun_${x}_$1.txt..."
if [ ! -f "docs/benchmarks/profilerun_${x}_$1.txt" ] ; then
echo "You forgot to include updated profile runs (docs/benchmarks)"
! exit 1;
fi;
done;
--- 59,65 ----
echo "Checking for docs/benchmarks/profilerun_${x}_$1.txt..."
if [ ! -f "docs/benchmarks/profilerun_${x}_$1.txt" ] ; then
echo "You forgot to include updated profile runs (docs/benchmarks)"
! read -p "Press return to ignore... (^C to stop)"
fi;
done;
Index: Tekkotsu/tools/makelowercase
diff -c Tekkotsu/tools/makelowercase:1.2 Tekkotsu/tools/makelowercase:1.3
*** Tekkotsu/tools/makelowercase:1.2 Sun Mar 9 02:41:38 2003
--- Tekkotsu/tools/makelowercase Mon Feb 2 17:19:22 2004
***************
*** 1,6 ****
#!/bin/sh
! # will convert specified files to lowercase names
if [ "$1" = "-r" ] ; then
recurse=1; shift;
--- 1,6 ----
#!/bin/sh
! # will convert specified files to lower names
if [ "$1" = "-r" ] ; then
recurse=1; shift;
***************
*** 12,19 ****
if [ -r "$x" ] ; then
conv="`echo $x | tr '[A-Z]' '[a-z]'`";
if [ "$x" != "$conv" ] ; then
! mv $x ${x}.tmpcase;
! mv ${x}.tmpcase $conv;
fi;
if [ $recurse -gt 0 -a -d "$conv" ] ; then
$0 -r $conv/*;
--- 12,23 ----
if [ -r "$x" ] ; then
conv="`echo $x | tr '[A-Z]' '[a-z]'`";
if [ "$x" != "$conv" ] ; then
! if [ -e $conv ] ; then
! echo "ERROR: $conv already exists (from $x)";
! echo "exiting..."
! exit 1;
! fi;
! mv "$x" "$conv";
fi;
if [ $recurse -gt 0 -a -d "$conv" ] ; then
$0 -r $conv/*;
Index: Tekkotsu/tools/makeuppercase
diff -c Tekkotsu/tools/makeuppercase:1.2 Tekkotsu/tools/makeuppercase:1.3
*** Tekkotsu/tools/makeuppercase:1.2 Sun Mar 9 02:41:38 2003
--- Tekkotsu/tools/makeuppercase Mon Feb 2 17:19:22 2004
***************
*** 1,6 ****
#!/bin/sh
! # will convert specified files to lowercase names
if [ "$1" = "-r" ] ; then
recurse=1; shift;
--- 1,6 ----
#!/bin/sh
! # will convert specified files to uppercase names
if [ "$1" = "-r" ] ; then
recurse=1; shift;
***************
*** 12,19 ****
if [ -r "$x" ] ; then
conv="`echo $x | tr '[a-z]' '[A-Z]'`";
if [ "$x" != "$conv" ] ; then
! mv $x ${x}.tmpcase;
! mv ${x}.tmpcase $conv;
fi;
if [ $recurse -gt 0 -a -d "$conv" ] ; then
$0 -r $conv/*;
--- 12,23 ----
if [ -r "$x" ] ; then
conv="`echo $x | tr '[a-z]' '[A-Z]'`";
if [ "$x" != "$conv" ] ; then
! if [ -e $conv ] ; then
! echo "ERROR: $conv already exists (from $x)";
! echo "exiting..."
! exit 1;
! fi;
! mv "$x" "$conv";
fi;
if [ $recurse -gt 0 -a -d "$conv" ] ; then
$0 -r $conv/*;
Index: Tekkotsu/tools/untag.txt
diff -c Tekkotsu/tools/untag.txt:1.7 Tekkotsu/tools/untag.txt:removed
*** Tekkotsu/tools/untag.txt:1.7 Fri Oct 10 14:22:50 2003
--- Tekkotsu/tools/untag.txt Thu Feb 5 23:36:02 2004
***************
*** 1,4 ****
- project/SampleBehavior.h
- project/SampleMC.h
- Behaviors/Demos/PaceTargetsMachine.h
- Behaviors/Demos/PaceTargetsMachine.cc
--- 0 ----
Index: Tekkotsu/tools/mon/c_statejoints.m
diff -c Tekkotsu/tools/mon/c_statejoints.m:1.1 Tekkotsu/tools/mon/c_statejoints.m:1.2
*** Tekkotsu/tools/mon/c_statejoints.m:1.1 Thu Feb 20 14:51:18 2003
--- Tekkotsu/tools/mon/c_statejoints.m Wed Jan 28 15:38:50 2004
***************
*** 63,72 ****
ypos=ypos+ystep;
[pos(13),duty(13)]=addjoint(0.05,ypos,'Head','Tilt',linedata);
[pos(16),duty(16)]=addjoint(0.55,ypos,'Misc','Tail Tilt',linedata);
drawnow;
statejoints.lines_pos=pos;
statejoints.lines_duty=duty;
! statejoints.obj=WorldStateJointsListener(conf.ip,conf.port_statejoints);
function iter
global statejoints
--- 63,76 ----
ypos=ypos+ystep;
[pos(13),duty(13)]=addjoint(0.05,ypos,'Head','Tilt',linedata);
[pos(16),duty(16)]=addjoint(0.55,ypos,'Misc','Tail Tilt',linedata);
+ ypos=ypos+ystep;
+ [but(1),but(2),but(3),but(4)]=addbuttons(0.05,ypos,'Buttons','Buttons 1-4',linedata);
+ [but(5),but(6),but(7),but(8)]=addbuttons(0.55,ypos,'Buttons','Buttons 5-8',linedata);
drawnow;
statejoints.lines_pos=pos;
statejoints.lines_duty=duty;
! statejoints.lines_but=but;
! statejoints.obj=org.tekkotsu.mon.WorldStateJointsListener(conf.ip,conf.port_statejoints);
function iter
global statejoints
***************
*** 74,85 ****
--- 78,94 ----
data=statejoints.obj.getData;
positions=double(data.positions);
duties=double(data.duties);
+ buttons=double(data.buttons);
for i=1:18
ydata=get(statejoints.lines_pos(i),'YData');
set(statejoints.lines_pos(i),'YData',[ydata(2:300) positions(i)]);
ydata=get(statejoints.lines_duty(i),'YData');
set(statejoints.lines_duty(i),'YData',[ydata(2:300) duties(i)]);
end
+ for i=1:8
+ ydata=get(statejoints.lines_but(i),'YData');
+ set(statejoints.lines_but(i),'YData',[ydata(2:300) (buttons(i)/2+mod(i-1,4))]);
+ end
end
function stop
***************
*** 103,105 ****
--- 112,129 ----
hold on
pos=plot(initplot,'Color','b');
duty=plot(initplot,'Color','r');
+
+ function [but1,but2,but3,but4]=addbuttons(xpos,ypos,name1,name2,initplot)
+ p=subplot('Position',[xpos ypos 0.4 0.075]);
+ set(p,'XTick',[]);
+ set(p,'YTick',-1:2:1);
+ set(p,'YTickLabel',{'1','2','3','4'});
+ set(p,'YLim',[0 4.5]);
+ ylabel(name2);
+ title(name1);
+ hold on
+ but1=plot(initplot,'Color','r');
+ but2=plot(initplot,'Color','g');
+ but3=plot(initplot,'Color','b');
+ but4=plot(initplot,'Color','m');
+
Index: Tekkotsu/tools/mon/config.m
diff -c Tekkotsu/tools/mon/config.m:1.12 Tekkotsu/tools/mon/config.m:1.13
*** Tekkotsu/tools/mon/config.m:1.12 Sun Aug 3 17:56:06 2003
--- Tekkotsu/tools/mon/config.m Wed Jan 28 15:38:50 2004
***************
*** 3,9 ****
%eventually parse single config file
! conf.ip='192.168.0.7'; % Aibo's IP address
conf.port_stdout=10001;
conf.port_stderr=10002;
--- 3,9 ----
%eventually parse single config file
! conf.ip='172.16.1.2'; % Aibo's IP address
conf.port_stdout=10001;
conf.port_stderr=10002;
Index: Tekkotsu/tools/mon/ers220info.m
diff -c /dev/null Tekkotsu/tools/mon/ers220info.m:1.1
*** /dev/null Thu Feb 5 23:36:02 2004
--- Tekkotsu/tools/mon/ers220info.m Wed Jan 28 16:07:44 2004
***************
*** 0 ****
--- 1,28 ----
+ info.FrameTime=8;
+ info.NumFrames=4;
+ info.SlowFrameTime=128;
+ info.NumSlowFrames=1;
+ info.SoundBufferTime=32;
+ info.NumPIDJoints=15
+ info.NumBinJoints=0;
+ info.NumLEDs=20;
+ info.NumOutputs=info.NumPIDJoints + info.NumBinJoints + info.NumLEDs;
+ info.isFastOutput=zeros(info.NumOutputs)+1; %all ok!
+ info.isRealERS220=info.isFastOutput %umm they're the same
+ info.JointsPerLeg=3;
+ info.NumLegs=4;
+ info.NumLegJoints=info.JointsPerLeg*info.NumLegs;
+ info.NumTailJoints=0;
+ info.NumMouthJoints=0;
+ info.NumEarJoints=0;
+ info.NumButtons=11;
+ info.NumSensors=1+3+1+5;
+ % offset data
+ info.LogOffset.positions=2;
+ info.LogOffset.duties=info.LogOffset.positions+info.NumPIDJoints;
+ info.LogOffset.sensors=info.LogOffset.duties+info.NumPIDJoints;
+ info.LogOffset.buttons=info.LogOffset.sensors+6;
+ info.SensorOffsetOf.IRDist=0;
+ info.SensorOffsetOf.BAccelOffset=1;
+ info.SensorOffsetOf.LAccelOffset=2;
+ info.SensorOffsetOf.DAccelOffset=3;
Index: Tekkotsu/tools/mon/ers2xxinfo.m
diff -c /dev/null Tekkotsu/tools/mon/ers2xxinfo.m:1.1
*** /dev/null Thu Feb 5 23:36:02 2004
--- Tekkotsu/tools/mon/ers2xxinfo.m Wed Jan 28 16:07:44 2004
***************
*** 0 ****
--- 1,59 ----
+ info.FrameTime=8;
+ info.NumFrames=4;
+ info.SlowFrameTime=128;
+ info.NumSlowFrames=1;
+ info.SoundBufferTime=32;
+ info.NumPIDJoints=18;
+ info.NumBinJoints=2;
+ info.NumLEDs=22;
+ info.NumOutputs=info.NumPIDJoints + info.NumBinJoints + info.NumLEDs;
+ info.isFastOutput=zeros(info.NumOutputs)+1; %this is a lie. but who cares?
+ info.isRealERS220=info.isFastOutput; %also a lie
+ info.JointsPerLeg=3;
+ info.NumLegs=4;
+ info.NumLegJoints=info.JointsPerLeg*info.NumLegs;
+ info.NumHeadJoints=3;
+ info.NumTailJoints=2;
+ info.NumMouthJoints=1;
+ info.NumEarJoints=2;
+ info.NumButtons=11;
+ info.NumSensors=1+3+1+5; % 1 dist, 3 accel, 1 thermo, 5 from power, see SensorOffset_t
+ % offset data
+ info.legOrder={'lf' 'rf' 'lb' 'rb'};
+ info.legJointOrder={'Rotator' 'Elevator' 'Knee'};
+ info.headJointOrder={'Tilt' 'Pan' 'Roll'};
+ info.LogOffset.positions=2;
+ info.LogOffset.duties=info.LogOffset.positions+info.NumPIDJoints;
+ info.LogOffset.sensors=info.LogOffset.duties+info.NumPIDJoints;
+ info.LogOffset.buttons=info.LogOffset.sensors+6;
+ info.SensorOffsetOf.IRDist=0;
+ info.SensorOffsetOf.BAccelOffset=1;
+ info.SensorOffsetOf.LAccelOffset=2;
+ info.SensorOffsetOf.DAccelOffset=3;
+
+ %%%%old
+ %info.limbs.f_body_to_shoulder=[59.5 59.2 0];
+ %info.limbs.f_leg_shoulder_to_knee=[12.8 .5 -64];
+ %info.limbs.f_leg_knee_to_ball=[-18 0 -67.23];
+ %info.limbs.h_body_to_shoulder=[59.5 59.2 0];
+ %info.limbs.h_leg_shoulder_to_knee=[-12.8 .5 -64];
+ %info.limbs.h_leg_knee_to_ball=[-18 0 -74.87];
+
+
+ %note: these coordinates are off 90deg (forward left up)
+ info.limbs.f_body_to_shoulder=[59.5 59.2 0];
+ info.limbs.f_leg_shoulder_to_knee=[12.8 .5 -64];
+ info.limbs.f_leg_knee_to_ball=[-18 0 -67.23];
+ info.limbs.h_body_to_shoulder=[-59.5 59.2 0];
+ info.limbs.h_leg_shoulder_to_knee=[-12.8 .5 -64];
+ info.limbs.h_leg_knee_to_ball=[-18 0 -74.87];
+
+ %format: leg,joint,xyz (where +x=forward, +y=left, +z=up)
+ info.limblen=zeros(4,3,3);
+ info.limblen(1,:,:)=[ info.limbs.f_body_to_shoulder; info.limbs.f_leg_shoulder_to_knee; info.limbs.f_leg_knee_to_ball ] ; %lf
+ %%%right is mirror of left
+ info.limblen(2,:,:)=[info.limblen(1,:,1)' , -info.limblen(1,:,2)' , info.limblen(1,:,3)' ]; %rf
+ info.limblen(3,:,:)=[info.limbs.h_body_to_shoulder; info.limbs.h_leg_shoulder_to_knee; info.limbs.h_leg_knee_to_ball ] ; %lb
+ info.limblen(4,:,:)=[info.limblen(3,:,1)' , -info.limblen(3,:,2)' , info.limblen(3,:,3)' ]; %rf
+
+ info.walkheight=160;
Index: Tekkotsu/tools/mon/lognow
diff -c /dev/null Tekkotsu/tools/mon/lognow:1.1
*** /dev/null Thu Feb 5 23:36:02 2004
--- Tekkotsu/tools/mon/lognow Wed Jan 28 16:07:44 2004
***************
*** 0 ****
--- 1,2 ----
+ #!/bin/sh
+ java org/tekkotsu/mon/JointLogger $*
Index: Tekkotsu/tools/mon/plotlog.m
diff -c /dev/null Tekkotsu/tools/mon/plotlog.m:1.2
*** /dev/null Thu Feb 5 23:36:02 2004
--- Tekkotsu/tools/mon/plotlog.m Thu Feb 5 19:45:57 2004
***************
*** 0 ****
--- 1,319 ----
+ function plotlog(logfilein)
+ global logfile info jpl plotops legh ploth subp timeslider window aibopos jgraph pgraph posgraph bodyangle updatego legpos legspos samplecount bodypos extra plotlog_inited;
+ updatego=0;
+ ploth=[];
+ subp=[];
+ if(isempty(plotops))
+ plotops=struct('drawbuttons',1);
+ end
+ logfile=logfilein;
+ ers2xxinfo;
+ bodyangle=.20944;
+ samplecount=size(logfile,1);
+ aibopos=zeros(4,3,samplecount);
+ legpos=zeros(4,3,samplecount);
+ jpl=info.JointsPerLeg; %because it's used so much...
+ plotlog_inited=1;
+ jgraph=figure(1);
+ pgraph=figure(2);
+ posgraph=figure(3);
+ extra=figure(4);
+
+ set(jgraph,'Name','Joint positions');
+ set(pgraph,'Name','Aibo Feet Accumulator');
+ set(posgraph,'Name','Foot trajectory');
+ set(extra,'Name','Extra data');
+
+ figure(jgraph);
+
+ clf;
+
+ window=struct('size',logfile(end,1)-logfile(1,1),'start',logfile(1,1),'zoomfactor',1);
+
+ timeslider=uicontrol('style','slider','position',[100,0,100,20],'callback','setslide;');
+ zoomin=uicontrol('style','pushbutton','position',[250,0,50,20],'string','Zoom in','callback','zoomin;');
+ zoomout=uicontrol('style','pushbutton','position',[350,0,50,20],'string','Zoom out','callback','zoomout;');
+
+ for leg=1:4
+ plotleg(leg,getJointAngles(leg),getDuties(leg),getButton(leg));
+ end
+
+ legh=legend(info.legJointOrder{:},0);
+ posnow=get(legh,'position');
+ posnow(1:2)=[0 0];
+ set(legh,'position',posnow);
+
+ %%%%basic stuff done
+
+ bodypos=trackMovement;
+
+ figure(pgraph);
+ clf;
+ plotpath;
+ figure(posgraph);
+ clf;
+ plotpos;
+ drawBody(bodypos);
+
+ %extra
+ figure(extra);
+ %rot=mod(bodypos(:,4),360);
+ rot=bodypos(:,4);
+ plot(rot);
+
+ %fit graph
+
+ updatego=1;
+ updateAxes; %really just fix slider
+
+ function plotleg(leg,position,duties,button)
+ global logfile info jpl ploth subp plotops window defax hb aibopos pgraph jgraph legpos;
+ ontime=extractButtonOn(button);
+ subp(end+1)=subplot(2,4,leg);
+ hb=plot(logfile(:,1),position)';
+ title([info.legOrder{leg} ' pos']);
+ if(plotops.drawbuttons~=0)
+ hold on
+ hb=[hb plot(logfile(ontime,1),position(ontime,:),'o')'];
+ plot(logfile(:,1),button,':k');
+ end
+ ploth=[ploth hb];
+ subp(end+1)=subplot(2,4,leg+4);
+ hb=plot(logfile(:,1),duties)';
+ title([info.legOrder{leg}, ' duties']);
+ if(plotops.drawbuttons~=0)
+ hold on
+ hb=[hb plot(logfile(ontime,1),duties(ontime,:),'o')'];
+ end
+ ploth=[ploth hb];
+ defax=axis;
+
+ %forward kinematics tracking:
+ for step=1:length(button)
+ legPoint(step,leg); %precalc legpositions
+ end
+ altbutton=getButton(mod(leg+2,4)+1);
+ for step=2:(length(button))
+ % if(button(step)>0 | altbutton(step)>0) %counts feet as "down" if either front or back is on. this turns out to be bad
+ if(button(step)>0)
+ delta=legpos(leg,:,step)-legpos(leg,:,step-1);
+ else
+ delta=[0 0 0];
+ end
+ aibopos(leg,:,step)=aibopos(leg,:,step-1)-delta; %%aibo moves opposite of foot push
+ end
+
+ %aibopos=legpos; %%% testing hack!
+
+ function pos=getJointAngles(leg)
+ global logfile info jpl;
+ leg=leg-1;
+ pos=logfile(:,info.LogOffset.positions+leg*jpl:1:info.LogOffset.positions+((leg+1)*jpl-1));
+
+ function duties=getDuties(leg)
+ global logfile info jpl;
+ leg=leg-1;
+ duties=logfile(:,(leg*jpl+info.LogOffset.duties):1:((leg+1)*jpl+info.LogOffset.duties-1));
+
+ function buttons=getButton(leg)
+ global logfile info jpl;
+ leg=leg-1;
+ buttons=logfile(:,info.LogOffset.buttons+leg);
+
+ function onidx=extractButtonOn(button)
+ onidx=find(button>0);
+
+ function onidx=findButtonOn(leg)
+ global logfile info jpl;
+ button=getButton(leg);
+ onidx=find(button>0);
+
+ %%%%%%%%%%%%%
+ %% gui stuff
+ %%%%%%%%%%%%%
+
+
+
+ %%%%%%%%%
+ %% Forward kinematics stuff
+ %%%%%%%%%
+
+ function R=rotate(x,y,z,theta)
+ c=cos(theta);
+ s=sin(theta);
+ t=1-cos(theta);
+ R=[t*x^2+c, t*x*y-s*z, t*x*z+s*y, 0; ...
+ t*x*y+s*z, t*y^2+c, t*y*z-s*x, 0; ...
+ t*x*z-s*y, t*y*z+s*x, t*z^2+c, 0; ...
+ 0, 0, 0, 1 ];
+
+ function T=translate(t)
+ x=t(1);
+ y=t(2);
+ z=t(3);
+ T=[1, 0, 0, x ; ...
+ 0, 1, 0, y ; ...
+ 0, 0, 1, z ; ...
+ 0, 0, 0, 1 ];
+
+ function dpt=diffPoints(t1,t2,leg)
+ global logfile info jpl legpos;
+ pos=getJointAngles(leg);
+ buttons=getButton(leg);
+
+ limblen=info.limblen(leg,:,:);
+ pos1=pos(t1,:);
+ pos2=pos(t2,:);
+ pt=[0 0 0 1]; %homogenous point baby
+ M=eye(4);
+ % my coordinate system: y+ = forward, x+ = right, z+ = up
+ M=M*translate( -limblen(:,:,1) ); %initial position separated from body
+ M=M*rotate(1,0,0,pos1(1)); %rotator - around x
+ M=M*rotate(0,1,0,pos1(2)); %elevator - around y
+ M=M*translate( -limblen(:,:,2) );
+ M=M*rotate(1,0,0,pos1(3)); %knee - around x
+ M=M*translate( -limblen(:,:,3) );
+ groundpt1=M*pt';
+
+ % legpos(leg,:,t1)=groundpt1(1:3);
+
+ M=eye(4);
+ M=M*translate( -limblen(:,:,1) ); %initial position separated from body
+ M=M*rotate(1,0,0,pos1(1)); %rotator - around x
+ M=M*rotate(0,1,0,pos1(2)); %elevator - around y
+ M=M*translate( -limblen(:,:,2) );
+ M=M*rotate(1,0,0,pos1(3)); %knee - around x
+ M=M*translate( -limblen(:,:,3) );
+ groundpt2=M*pt';
+
+ % legpos(leg,:,t1)=groundpt2(1:3);
+
+ % if(buttons(t1)<1) % foot starting in air
+ % dpt=[0,0,0]; %no movement
+ % return;
+ %else
+ dpt=groundpt1-groundpt2;
+ %end
+
+ ; toerotateX=(pos1(3)-pos1(1))-(pos2(3)-pos2(1));
+ ; toerotateY=(pos1(2)-pos2(2));
+ ; M=M*rotate(1,0,0,toerotateX); %assuming shoulder stays even height, and flat ground, parallel lines are your friend. this is basically change in toe-tilt
+ ;% M=M*rotate(0,1,0,toerotateY);
+ ; M=M*translate( limblen(:,:,3) );
+ ; M=M*rotate(1,0,0,pos2(3)); %knee - around x
+ ; M=M*translate( limblen(:,:,2) );
+ ; M=M*rotate(0,1,0,pos2(2)); %elevator - around y
+ ; M=M*rotate(1,0,0,pos2(1)); %rotator - around x
+ ; M=M*translate( limblen(:,:,1) );
+ ; bodypt2=M*pt';
+ ; dpt=bodypt2(1:3)';
+
+
+ function footpoint=legPoint(t1,leg)
+ global logfile info jpl legpos;
+ pos=getJointAngles(leg);
+ buttons=getButton(leg);
+
+ limblen=info.limblen(leg,:,:);
+ pos1=pos(t1,:);
+ pt=[0 0 0 1]; %homogenous point baby
+ M=eye(4);
+ if(leg>2) %if it's a back foot
+ pos1(1)=-pos1(1); %flip it's y rotation
+ pos1(3)=-pos1(3); %flip it's y rotation
+ end
+ % my coordinate system: x+ = forward, y+ = right, z+ = up
+ M=M*translate( limblen(:,1,:) ); %initial position separated from body
+ M=M*rotate(0,1,0,-pos1(1)); %rotator - around y (but +pos(1) means back on dog)
+ if(mod(leg,2)==0) %if it's a right foot...
+ pos1(2)=-pos1(2); %flip it's x rotation
+ end
+ M=M*rotate(1,0,0,pos1(2)); %elevator - around x
+ M=M*translate( limblen(:,2,:) );
+ M=M*rotate(0,1,0,-pos1(3)); %knee - around y
+ M=M*translate( limblen(:,3,:) );
+ footpoint=M*pt';
+ footpoint(2)=-footpoint(2); %flip the y data for our sanity...
+ legpos(leg,:,t1)=footpoint(1:3);
+ return;
+
+
+ function bodypos=trackMovement()
+ global logfile info jpl legpos aibopos samplecount;
+
+ centroid=orbitCenter;
+ ydiff=mean(centroid(1:2,3))-mean(centroid(3:4,3));
+ xdiff=mean(centroid(1:2,1))-mean(centroid(3:4,1));
+ downrot=-atan(ydiff/xdiff)/pi*180;
+
+ buttons=zeros(4,samplecount);
+ for leg=1:4
+ buttons(leg,:)=getButton(leg)';
+ end
+
+ bodypos=zeros(samplecount,6); % time, xyz pos | xyz rot
+ %pt=[0 0 0 1];
+ %M=eye(4);
+ %M=M*rotate(0,1,0,downrot); %standard 'cause our aibo points down usually and walks on flat ground
+ %for step=2:samplecount
+ % delta=aibopos(:,:,step)-aibopos(:,:,step-1);
+ % posdelta=legpos(:,:,step-1)-legpos(:,:,step);
+ % posdelta=adjustDelta(M,posdelta);
+ % buttonsOn=buttons(3,step) + buttons(4,step); % count of rear buttons on
+ % if(buttonsOn~=1) %if it only has 1 foot on the ground, it probably won't spin
+ %xdiff=delta([2 4],2)-delta([1 3],2);
+ %ydiff=delta([2 4],1)-delta([1 3],1);
+ % end
+ %%%%%%arrrr lost
+ %end
+
+ %%alternate sum method (straight forward distance traveled: GO!)
+ for step=2:samplecount
+ delta=aibopos(:,:,step)-aibopos(:,:,step-1);
+ dl=norm(delta(3,:));
+ dr=norm(delta(4,:));
+ rot=0;
+ if(buttons(3,step))
+ pairmag=dot(norm(delta(1,:)),norm(delta(3,:)));
+ twist=[delta(1,1)-delta(3,1), delta(1,2)-delta(3,2), delta(1,3)-delta(3,3)];
+ if(twist(1)==0)
+ degtwist=0;
+ else
+ degtwist=atan(twist(2)/twist(1))/pi*180;
+ end
+ rot=rot+degtwist;
+ end
+ if(buttons(4,step))
+ pairmag=dot(norm(delta(2,:)),norm(delta(4,:)));
+ twist=[delta(2,1)-delta(4,1), delta(2,2)-delta(4,2), delta(2,3)-delta(4,3)];
+ if(twist(1)==0)
+ degtwist=0;
+ else
+ degtwist=atan(twist(2)/twist(1))/pi*180;
+ end
+ rot=rot-degtwist;
+ end
+ bodypos(step,1)=dl+dr+bodypos(step-1,1);
+ bodypos(step,4)=rot+bodypos(step-1,4);
+ end
+
+
+ function centers=orbitCenter()
+ global logfile info jpl legpos aibopos samplecount;
+ pos=zeros(3);
+ centers=permute(mean(permute(legpos,[3 1 2])),[2 3 1]) %yes it's a bitch, but it works
+ return;
+
+ function outpos=adjustDelta(M,inpos)
+ zeros(4,3);
+ for i=1:4
+ pt=[inpos(i,:) 1];
+ outpos(i,:)=pt*M;
+ end;
+
+ function drawBody(bodypos)
+ global logfile info jpl legpos aibopos samplecount pgraph;
+
+ figure(pgraph);
+
+ plot3(bodypos(:,1),bodypos(:,2),bodypos(:,3));
Index: Tekkotsu/tools/mon/plotpath.m
diff -c /dev/null Tekkotsu/tools/mon/plotpath.m:1.1
*** /dev/null Thu Feb 5 23:36:02 2004
--- Tekkotsu/tools/mon/plotpath.m Wed Jan 28 16:07:44 2004
***************
*** 0 ****
--- 1,27 ----
+ global aibopos timetags window;
+ clf;
+ grid on;
+ hold on;
+ %T=viewmtx(-20,56);
+ T=viewmtx(0,0);
+ %wtf doesn't this work?
+ view(T);
+ specs=['m' 'g' 'r' 'b'];
+ timetags=zeros(4,2);
+ for leg=1:4
+ %%hack to plot leg position instead
+ bob=permute(aibopos(leg,:,:),[3 2 1]);%
+ %bob=permute(legpos(leg,:,:),[3 2 1]);
+ plot3(bob(:,1),bob(:,2),bob(:,3),specs(leg));
+ end
+ legend('lf','rf','lb','rb');
+ ylabel('left-right');
+ xlabel('back-forward');
+ zlabel('down-up');
+
+ for leg=1:4
+ bob=permute(aibopos(leg,:,:),[3 2 1]);
+ %bob=permute(legpos(leg,:,:),[3 2 1]);
+ timetags(leg,:)=plot3(bob(1,1),bob(1,2),bob(1,3), [specs(leg) 'x'], ...
+ bob(end,1),bob(end,2),bob(end,3), [specs(leg) 'x'], 'MarkerSize',12)';
+ end
Index: Tekkotsu/tools/mon/plotpos.m
diff -c /dev/null Tekkotsu/tools/mon/plotpos.m:1.2
*** /dev/null Thu Feb 5 23:36:02 2004
--- Tekkotsu/tools/mon/plotpos.m Thu Feb 5 19:45:57 2004
***************
*** 0 ****
--- 1,51 ----
+ function plotpos
+ global aibopos trtimetags window plotops legpos bodypos;
+ clf;
+ grid on;
+ hold on;
+ T=viewmtx(0,0);
+ %wtf doesn't this work?
+ view(T);
+ specs=['m' 'g' 'r' 'b'];
+ timetags=zeros(4,2);
+ for leg=1:4
+ %%draw leg trajectory
+ bob=permute(legpos(leg,:,:),[3 2 1]);
+ plot3(bob(:,1),bob(:,2),bob(:,3),specs(leg));
+ end
+ if(plotops.drawbuttons~=0)
+ for leg=1:4
+ %%plot button-on
+ bob=permute(legpos(leg,:,:),[3 2 1]);
+ button=getButton(leg);
+ ontime=extractButtonOn(button);
+ hold on;
+ plot3(bob(ontime,1),bob(ontime,2),bob(ontime,3),[specs(leg) 'o']);
+ end
+ end
+ legend('lf','rf','lb','rb');
+ ylabel('left-right');
+ xlabel('back-forward');
+ zlabel('down-up');
+
+ %add time ticks
+ for leg=1:4
+ bob=permute(legpos(leg,:,:),[3 2 1]);
+ trtimetags(leg,:)=plot3(bob(1,1),bob(1,2),bob(1,3), [specs(leg) 'x'], ...
+ bob(end,1),bob(end,2),bob(end,3), [specs(leg) 'x'], 'MarkerSize',32)';
+ end
+
+ %plot heading
+
+ function buttons=getButton(leg)
+ global logfile info jpl;
+ leg=leg-1;
+ buttons=logfile(:,info.LogOffset.buttons+leg);
+
+ function onidx=extractButtonOn(button)
+ onidx=find(button>0);
+
+ function onidx=findButtonOn(leg)
+ global logfile info jpl;
+ button=getButton(leg);
+ onidx=find(button>0);
Index: Tekkotsu/tools/mon/setslide.m
diff -c /dev/null Tekkotsu/tools/mon/setslide.m:1.1
*** /dev/null Thu Feb 5 23:36:02 2004
--- Tekkotsu/tools/mon/setslide.m Wed Jan 28 16:07:44 2004
***************
*** 0 ****
--- 1,3 ----
+ function setslide()
+ global logfile window subp;
+ updateAxes;
Index: Tekkotsu/tools/mon/updateAxes.m
diff -c /dev/null Tekkotsu/tools/mon/updateAxes.m:1.1
*** /dev/null Thu Feb 5 23:36:02 2004
--- Tekkotsu/tools/mon/updateAxes.m Wed Jan 28 16:07:44 2004
***************
*** 0 ****
--- 1,43 ----
+ global timeslider pgraph jgraph trtimetags legpos;
+ mint=logfile(1,1);
+ maxt=logfile(end,1);
+ p=get(timeslider,'value');
+ view=window.size/window.zoomfactor;
+ window.start=p*(maxt-mint-view)+mint;
+ view=window.size/window.zoomfactor;
+ window.stop=window.start+view;
+ set(timeslider,'sliderstep',[view/5/window.size,view/window.size]);
+ for i=1:length(subp)
+ ax=axis(subp(i));
+ axis(subp(i),[window.start,window.stop, ax(3),ax(4)]);
+ end
+
+ global aibopos timetags updatego;
+ %if(updatego>0)
+ posstart=min(find(logfile(:,1) >= window.start));
+ posend=max(find(logfile(:,1) <= window.stop));
+ startframe=aibopos(:,:,posstart);
+ stopframe=aibopos(:,:,posend);
+ trstartframe=legpos(:,:,posstart);
+ trstopframe=legpos(:,:,posend);
+ if(ishandle(timetags(1,1))>0)
+ for leg=1:4
+ set(timetags(leg,1),'XData',startframe(leg,1));
+ set(timetags(leg,1),'YData',startframe(leg,2));
+ set(timetags(leg,1),'ZData',startframe(leg,3));
+ set(timetags(leg,2),'XData',stopframe(leg,1));
+ set(timetags(leg,2),'YData',stopframe(leg,2));
+ set(timetags(leg,2),'ZData',stopframe(leg,3));
+
+ %%trajectory
+
+ set(trtimetags(leg,1),'XData',trstartframe(leg,1));
+ set(trtimetags(leg,1),'YData',trstartframe(leg,2));
+ set(trtimetags(leg,1),'ZData',trstartframe(leg,3));
+ set(trtimetags(leg,2),'XData',trstopframe(leg,1));
+ set(trtimetags(leg,2),'YData',trstopframe(leg,2));
+ set(trtimetags(leg,2),'ZData',trstopframe(leg,3));
+
+ end
+ end
+ %end
Index: Tekkotsu/tools/mon/zoomin.m
diff -c /dev/null Tekkotsu/tools/mon/zoomin.m:1.1
*** /dev/null Thu Feb 5 23:36:02 2004
--- Tekkotsu/tools/mon/zoomin.m Wed Jan 28 16:07:44 2004
***************
*** 0 ****
--- 1,4 ----
+ function zoomin()
+ global logfile window subp;
+ window.zoomfactor=window.zoomfactor*1.1;
+ updateAxes;
Index: Tekkotsu/tools/mon/zoomout.m
diff -c /dev/null Tekkotsu/tools/mon/zoomout.m:1.1
*** /dev/null Thu Feb 5 23:36:02 2004
--- Tekkotsu/tools/mon/zoomout.m Wed Jan 28 16:07:44 2004
***************
*** 0 ****
--- 1,4 ----
+ function zoomout()
+ global window subp logfile;
+ window.zoomfactor=window.zoomfactor*.9;
+ updateAxes;
Index: Tekkotsu/tools/mon/org/tekkotsu/mon/ControllerGUI.java
diff -c Tekkotsu/tools/mon/org/tekkotsu/mon/ControllerGUI.java:1.11 Tekkotsu/tools/mon/org/tekkotsu/mon/ControllerGUI.java:1.13
*** Tekkotsu/tools/mon/org/tekkotsu/mon/ControllerGUI.java:1.11 Sat Jan 10 15:11:22 2004
--- Tekkotsu/tools/mon/org/tekkotsu/mon/ControllerGUI.java Wed Feb 4 20:52:06 2004
***************
*** 158,176 ****
}
}
- public class ReenableOnClose extends WindowAdapter {
- JButton but;
- public ReenableOnClose(JButton b) { but=b; }
- public void windowClosing(WindowEvent e) {
- if(but.getActionCommand().equals("raw"))
- comm.sendInput("!root \"TekkotsuMon\" \"RawCamServer\"");
- else
- comm.sendInput("!root \"TekkotsuMon\" \"SegCamServer\"");
- e.getWindow().dispose();
- but.setEnabled(true);
- }
- }
-
void lostConnection() {
updated();
}
--- 158,163 ----
***************
*** 190,199 ****
status.setText("Reconnecting...");
} else {
if(comm._connectCount>0) {
! if(comm._connectCount==1)
for(int i=0; i0) {
! if(comm._connectCount==1) {
for(int i=0; i0){ //keyhit
+ int b=System.in.read();
+ System.out.print("read "+b+": ");
+ if(b=='q'){
+ System.out.println("User aborted.\n");
+ synchronized(outlog){
+ outlog.close();
+ joints.close();
+ System.out.println("Finished writing to: "+outfile);
+ System.exit(0);
+ }
+ break;
+ }
+ }
+ }
+ }
+ catch(IOException e){
+ System.err.println(e);
+ }
+ }
+ public String catArray(float []array){
+ String ret="";
+ for(int i=0;i1)
+ port=Integer.parseInt(args[1]);
+
+ SketchGUI gui = new SketchGUI(args[0],port);
+ gui.addWindowListener(new WindowAdapter() {
+ public void windowClosing(WindowEvent e) {}});
+ gui.show();
+ }
+
+ public static void usage() {
+ System.out.println("Usage: java SketchGUI host [port]");
+ System.out.println(" if port is not specified, it defaults to: [12345]"); // Default port
+ System.exit(2);
+ }
+
+ public void actionPerformed(ActionEvent e) {
+ if(e.getActionCommand().compareTo("spawn")==0) {
+ SketchGUI gui = new SketchGUI(host,port);
+ gui.addWindowListener(new WindowAdapter() {
+ public void windowClosing(WindowEvent e) {
+ // System.exit(0);
+ }});
+ gui.show();
+ } else if(e.getActionCommand().compareTo("refresh")==0) {
+ // Refresh the sketch tree list:
+
+ // Refresh the sketch based on which are checked:
+ // Vector sketches = new Vector();
+ // sketch.update(sketches);
+ } else if(e.getActionCommand().compareTo("saveimg")==0) {
+ File cursavepath = new File(prefs.get("cursavepath",""));
+ JFileChooser dia=new JFileChooser(cursavepath);
+ dia.setDialogTitle("Save Image...");
+ Component cur=this;
+ while(cur.getParent()!=null)
+ cur=cur.getParent();
+ if(dia.showSaveDialog(cur)==JFileChooser.APPROVE_OPTION) {
+ prefs.put("cursavepath",dia.getCurrentDirectory().getPath());
+ String base=dia.getSelectedFile().getName();
+ String format;
+ if(base.lastIndexOf('.')==-1) {
+ format="png";
+ } else {
+ int i=base.lastIndexOf(".");
+ format=base.substring(i+1);
+ base=base.substring(0,i);
+ }
+ try {
+ FileOutputStream fileout=new FileOutputStream(dia.getSelectedFile().getParent()+File.separator+base+"."+format);
+ ImageIO.write(sketch.getListener().getImage(),format,fileout);
+ } catch(Exception ex) {}
+ }
+ } else if(e.getActionCommand().compareTo("refreshlist")==0) {
+ // send command to refresh the sketch tree list
+ netout.println("list");
+ // DefaultMutableTreeNode root = new DefaultMutableTreeNode("camspace");
+ root.removeAllChildren();
+ // read in new sketch listing
+ try {
+ String inputLine;
+ System.out.println(inputLine = netin.readLine());
+ while((inputLine=netin.readLine()).compareTo("list end") != 0) {
+ // parse name
+ StringTokenizer st = new StringTokenizer(inputLine,": ");
+ st.nextToken();
+ String name = st.nextToken();
+
+ // parse id
+ inputLine = netin.readLine();
+ st = new StringTokenizer(inputLine,": ");
+ st.nextToken();
+ int id = Integer.parseInt(st.nextToken());
+
+ //parse parentId
+ inputLine = netin.readLine();
+ st = new StringTokenizer(inputLine,": ");
+ st.nextToken();
+ int parentId = Integer.parseInt(st.nextToken());
+
+ // add node
+ System.out.println("id:"+id+"parentId:"+parentId+"name:"+name);
+ DefaultMutableTreeNode newnode = new DefaultMutableTreeNode(new SketchInfo(id, parentId, name));
+ root.add(newnode);
+ }
+ System.out.println(inputLine);
+ //sketchTree = new JTree(root); // is this right?
+ //JScrollPane treeView = new JScrollPane(sketchTree);
+ // sketchTree.removeAll();
+ // sketchTree.add(root);
+ sketchTree.updateUI();
+ } catch(IOException ioe) {
+ System.err.println("Transfer error");
+ }
+ }
+ }
+
+ public SketchGUI(String host, int port) {
+ super();
+ this.host = host;
+ this.port = port;
+
+ // network setup
+ try {
+ System.out.println("Trying to open socket...");
+ listingSocket = new Socket(host,port);
+ 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() {
+ int strutsize=10;
+ int sepsize=5;
+ getContentPane().setLayout(new BorderLayout());
+ getContentPane().add(Box.createVerticalStrut(strutsize),BorderLayout.NORTH);
+ getContentPane().add(Box.createHorizontalStrut(strutsize),BorderLayout.WEST);
+ getContentPane().add(Box.createHorizontalStrut(strutsize),BorderLayout.EAST);
+
+ setTitle("TekkotsuMon: Sketch");
+ sketch=new VisionPanel(new VisionListener(host, defSketchPort));
+
+ sketch.setMinimumSize(new Dimension(VisionListener.DEFAULT_WIDTH/2, VisionListener.DEFAULT_HEIGHT/2));
+ sketch.setPreferredSize(new Dimension(VisionListener.DEFAULT_WIDTH*2, VisionListener.DEFAULT_HEIGHT*2));
+ sketch.setLockAspectRatio(true);
+ getContentPane().add(sketch,BorderLayout.CENTER);
+
+ {
+ Box tmp1 = Box.createHorizontalBox();
+ tmp1.add(Box.createHorizontalStrut(strutsize));
+ {
+ Box tmp2 = Box.createVerticalBox();
+
+ tmp2.add(Box.createVerticalStrut(strutsize));
+
+ {
+ Box tmp3 = Box.createHorizontalBox();
+ tmp3.add(status=new JLabel(state));
+ tmp3.add(Box.createHorizontalGlue());
+
+ spawnBut = new JButton("Spawn New");
+ spawnBut.setAlignmentX(0.5f);
+ spawnBut.addActionListener(this);
+ spawnBut.setActionCommand("spawn");
+ spawnBut.setEnabled(true);
+ spawnBut.setToolTipText("Spawns a new sketch monitor;");
+ tmp3.add(spawnBut);
+
+ tmp3.add(Box.createHorizontalStrut(strutsize));
+
+ refreshBut = new JButton("Refresh Image");
+ refreshBut.setAlignmentX(0.5f);
+ refreshBut.addActionListener(this);
+ refreshBut.setActionCommand("refresh");
+ refreshBut.setEnabled(true);
+ refreshBut.setToolTipText("Refreshes the displayed sketch;");
+ tmp3.add(refreshBut);
+
+ tmp3.add(Box.createHorizontalStrut(strutsize));
+
+ saveImageBut = new JButton("Save Image");
+ saveImageBut.setAlignmentX(0.5f);
+ saveImageBut.addActionListener(this);
+ saveImageBut.setActionCommand("saveimg");
+ saveImageBut.setEnabled(true);
+ saveImageBut.setToolTipText("Saves sketch to a file - use .jpg or .png extension to choose format;");
+ tmp3.add(saveImageBut);
+ tmp3.add(Box.createHorizontalStrut(strutsize));
+
+
+ refreshListBut = new JButton("Refresh Listing");
+ refreshListBut.setAlignmentX(0.5f);
+ refreshListBut.addActionListener(this);
+ refreshListBut.setActionCommand("refreshlist");
+ refreshListBut.setEnabled(true);
+ refreshListBut.setToolTipText("Refreshes the sketch listing;");
+ tmp3.add(refreshListBut);
+ tmp2.add(tmp3, BorderLayout.CENTER);
+ }
+
+ tmp2.add(Box.createVerticalStrut(strutsize));
+ // Sketch Tree:
+ sketchTree = new JTree(new DefaultTreeModel(initSketchTree(host, port)));
+ tmp2.add(new JScrollPane(sketchTree));
+ // set up sketch node selection
+ sketchTree.getSelectionModel().setSelectionMode
+ (TreeSelectionModel.SINGLE_TREE_SELECTION);
+ //Listen for when the selection changes.
+ sketchTree.addTreeSelectionListener(this);
+
+ // JFrame sketchFrame = new JFrame("Sketches");
+ // sketchFrame.setSize(200,400);
+ // sketchFrame.getContentPane().add(new JScrollPane(sketchTree));
+ // JScrollPane sketchPane = new JScrollPane(sketchTree);
+ // sketchPane.setSize(200,100);
+ // tmp2.add(sketchPane);
+ tmp2.add(Box.createVerticalStrut(strutsize));
+ tmp2.add(new JSeparator());
+ tmp2.add(Box.createVerticalStrut(strutsize-sepsize));
+ {
+ Box tmp4 = Box.createHorizontalBox();
+ tmp4.add(status=new JLabel(state));
+ tmp4.add(Box.createHorizontalGlue());
+ tmp2.add(tmp4);
+ }
+ tmp2.add(Box.createVerticalStrut(strutsize));
+ tmp1.add(tmp2);
+ }
+ tmp1.add(Box.createHorizontalStrut(strutsize));
+ getContentPane().add(tmp1,BorderLayout.SOUTH);
+ }
+ pack();
+
+ String name="SketchGUI"+".location";
+ setLocation(prefs.getInt(name+".x",50),prefs.getInt(name+".y",50));
+ }
+
+ public TreeNode initSketchTree(String host, int port) {
+ // MutableTreeNode root = new DefaultMutableTreeNode("camspace");
+
+ // Just for demonstration:
+ DefaultMutableTreeNode cam = new DefaultMutableTreeNode("cam");
+ DefaultMutableTreeNode pmask = new DefaultMutableTreeNode("pmask");
+ DefaultMutableTreeNode filled = new DefaultMutableTreeNode("filled");
+ DefaultMutableTreeNode skel = new DefaultMutableTreeNode("skel");
+ DefaultMutableTreeNode all_lines = new DefaultMutableTreeNode("all_lines");
+ DefaultMutableTreeNode b_ellipse_render = new DefaultMutableTreeNode("b_ellipse_render");
+ root.insert(cam,0);
+ cam.insert(pmask,0);
+ pmask.insert(filled,0);
+ filled.insert(skel,0);
+ skel.insert(all_lines,0);
+ cam.insert(b_ellipse_render,1);
+ // for(int i = 0; i < 5; i++)
+ // root.insert(new DefaultMutableTreeNode("Sketch("+i+")"), i);
+
+ return root;
+ }
+
+ // gets called when a Sketch selection is clicked
+ public void valueChanged(TreeSelectionEvent e) {
+ DefaultMutableTreeNode node = (DefaultMutableTreeNode)
+ sketchTree.getLastSelectedPathComponent();
+
+ if (node == null) return;
+
+ Object nodeInfo = node.getUserObject();
+ if (node.isLeaf()) {
+ SketchInfo sinfo = (SketchInfo)nodeInfo;
+ System.out.println("id clicked:"+sinfo.id);
+ netout.println("get "+sinfo.id);
+ try {
+ String inputLine;
+ while((inputLine=netin.readLine()).compareTo("get end") != 0) {
+ System.out.println(inputLine);
+ }
+ } catch (IOException ioe) {
+ System.err.println("Transfer error");
+ }
+ } else {
+ //displayURL(helpURL);
+ }
+ }
+ }
Index: Tekkotsu/tools/mon/org/tekkotsu/mon/SketchInfo.java
diff -c /dev/null Tekkotsu/tools/mon/org/tekkotsu/mon/SketchInfo.java:1.1
*** /dev/null Thu Feb 5 23:36:03 2004
--- Tekkotsu/tools/mon/org/tekkotsu/mon/SketchInfo.java Thu Jan 29 21:13:10 2004
***************
*** 0 ****
--- 1,24 ----
+ package org.tekkotsu.mon;
+
+
+ // stores info for a Sketch, to use as UserObject for DefaultMutableTreeNode
+ public class SketchInfo {
+ int id;
+ int parentId;
+ String name;
+
+ public SketchInfo(int _id, int _parentId, String _name) {
+ id = _id;
+ parentId = _parentId;
+ name = _name;
+ }
+
+ public int getId() { return id; }
+ public int getParentId() { return parentId; }
+ public String getName() { return name; }
+
+ public String toString() {
+ return (name + "(id " + id + ", parentId " + parentId + ")");
+ }
+ }
+
Index: Tekkotsu/tools/mon/org/tekkotsu/mon/SketchPanel.java
diff -c /dev/null Tekkotsu/tools/mon/org/tekkotsu/mon/SketchPanel.java:1.1
*** /dev/null Thu Feb 5 23:36:03 2004
--- Tekkotsu/tools/mon/org/tekkotsu/mon/SketchPanel.java Thu Jan 29 21:13:10 2004
***************
*** 0 ****
--- 1,79 ----
+ package org.tekkotsu.mon;
+
+ import java.util.Vector;
+ import javax.swing.JPanel;
+ import java.awt.image.BufferedImage;
+ import java.awt.Graphics;
+ import java.awt.Color;
+ import java.awt.Dimension;
+ import java.awt.FontMetrics;
+
+ public class SketchPanel extends JPanel {
+ String host;
+ int port;
+ BufferedImage _image;
+ boolean lockAspect=true;
+ Vector sketches;
+ static int width = 176;
+ static int height = 144;
+ float tgtAspect = 176/(float)144;
+
+ protected SketchPanel(String host, int port) {
+ this.host = host;
+ this.port = port;
+ setBackground(Color.BLACK);
+ setForeground(Color.WHITE);
+ setOpaque(!lockAspect);
+ _image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
+
+ // Create a blank frame:
+ update(new Vector());
+ }
+
+ public BufferedImage getImage() {
+ return _image;
+ }
+
+ // Takes in a Vector of int arrays of pixels to composite:
+ public void update(Vector sketches) {
+ int [] data = new int[width*height];
+
+ // Get new Sketchs and compose them:
+ this.sketches = sketches;
+ for(int i = 0; i < sketches.size(); i++) {
+
+ }
+ _image.setRGB(0,0,width,height,data,0,width);
+ }
+
+ public void paint(Graphics graphics) {
+ super.paint(graphics);
+ Dimension sz=getSize();
+
+ float curasp=sz.width/(float)sz.height;
+ if(curasp>tgtAspect) {
+ int width=(int)(sz.height*tgtAspect);
+ drawImage(graphics,_image, (sz.width-width)/2, 0, width, sz.height);
+ } else if(curasp2) {
--- 90,95 ----
***************
*** 100,106 ****
else if(s[2].toUpperCase().compareTo("RAW")==0)
port=VisionListener.defRawPort;
}
! VisionGUI gui=new VisionGUI(s[0],port,args);
gui.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) { System.exit(0); } });
}
--- 99,109 ----
else if(s[2].toUpperCase().compareTo("RAW")==0)
port=VisionListener.defRawPort;
}
! VisionGUI gui;
! if(args[0].length()==0)
! gui=new VisionGUI(s[0],port,new String[0]);
! else
! gui=new VisionGUI(s[0],port,args);
gui.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) { System.exit(0); } });
}
***************
*** 212,219 ****
public void close() {
String name="VisionGUI"+(isRaw?".raw":"")+(isRLE?".rle":"")+".location";
! prefs.putInt(name+".x",getLocation().x+getInsets().left);
! prefs.putInt(name+".y",getLocation().y+getInsets().top);
this.vision.close();
if(this.imgWrite!=null && this.imgWrite.isAlive()) {
if(!this.imgWrite.isInterrupted() && !this.imgWrite.stopping)
--- 215,225 ----
public void close() {
String name="VisionGUI"+(isRaw?".raw":"")+(isRLE?".rle":"")+".location";
! prefs.putInt(name+".x",getLocation().x);
! prefs.putInt(name+".y",getLocation().y);
! //I think I had needed to add getInsets() to keep the window from moving when reopening it, but now it *causes* it to move... weird. what changed?
! //prefs.putInt(name+".x",getLocation().x+getInsets().left);
! //prefs.putInt(name+".y",getLocation().y+getInsets().top);
this.vision.close();
if(this.imgWrite!=null && this.imgWrite.isAlive()) {
if(!this.imgWrite.isInterrupted() && !this.imgWrite.stopping)
***************
*** 313,334 ****
vision=new VisionPanel(new VisionListener(host,port));
isRLE=true;
isRaw=false;
} else if(args[i].toUpperCase().compareTo("RAW")==0) {
setTitle("TekkotsuMon: Vision Raw");
vision=new VisionPanel(new VisionListener(host,port));
isRaw=true;
isRLE=false;
} else
System.err.println("VisionGUI: Unrecognized argument: "+args[i]);
}
if(vision==null) {
! System.err.println("VisionGUI: Error: Vision mode not specified");
! } else {
! vision.setMinimumSize(new Dimension(VisionListener.DEFAULT_WIDTH/2, VisionListener.DEFAULT_HEIGHT/2));
! vision.setPreferredSize(new Dimension(VisionListener.DEFAULT_WIDTH*2, VisionListener.DEFAULT_HEIGHT*2));
! vision.setLockAspectRatio(true);
! getContentPane().add(vision,BorderLayout.CENTER);
}
{
Box tmp2=Box.createHorizontalBox();
tmp2.add(Box.createHorizontalStrut(strutsize));
--- 319,350 ----
vision=new VisionPanel(new VisionListener(host,port));
isRLE=true;
isRaw=false;
+ break;
} else if(args[i].toUpperCase().compareTo("RAW")==0) {
setTitle("TekkotsuMon: Vision Raw");
vision=new VisionPanel(new VisionListener(host,port));
isRaw=true;
isRLE=false;
+ break;
} else
System.err.println("VisionGUI: Unrecognized argument: "+args[i]);
}
if(vision==null) {
! vision=new VisionPanel(new VisionListener(host,port));
! if(port==VisionListener.defRLEPort) {
! setTitle("TekkotsuMon: Vision RLE");
! isRLE=true;
! isRaw=false;
! } else {
! setTitle("TekkotsuMon: Vision Raw");
! isRLE=false;
! isRaw=true;
! }
}
+ vision.setMinimumSize(new Dimension(VisionListener.DEFAULT_WIDTH/2, VisionListener.DEFAULT_HEIGHT/2));
+ vision.setPreferredSize(new Dimension(VisionListener.DEFAULT_WIDTH*2, VisionListener.DEFAULT_HEIGHT*2));
+ vision.setLockAspectRatio(true);
+ getContentPane().add(vision,BorderLayout.CENTER);
{
Box tmp2=Box.createHorizontalBox();
tmp2.add(Box.createHorizontalStrut(strutsize));
Index: Tekkotsu/tools/mon/org/tekkotsu/mon/VisionPanel.java
diff -c Tekkotsu/tools/mon/org/tekkotsu/mon/VisionPanel.java:1.3 Tekkotsu/tools/mon/org/tekkotsu/mon/VisionPanel.java:1.4
*** Tekkotsu/tools/mon/org/tekkotsu/mon/VisionPanel.java:1.3 Tue Jan 20 15:05:31 2004
--- Tekkotsu/tools/mon/org/tekkotsu/mon/VisionPanel.java Wed Feb 4 21:00:56 2004
***************
*** 106,112 ****
float curasp=sz.width/(float)sz.height;
float tgtasp=getAspectRatio();
if(tgtasp<0)
! tgtasp=curasp;
if(curasp>tgtasp) {
int width=(int)(sz.height*tgtasp);
drawImage(graphics,_image, (sz.width-width)/2, 0, width, sz.height);
--- 106,112 ----
float curasp=sz.width/(float)sz.height;
float tgtasp=getAspectRatio();
if(tgtasp<0)
! tgtasp=_image.getWidth()/(float)_image.getHeight();
if(curasp>tgtasp) {
int width=(int)(sz.height*tgtasp);
drawImage(graphics,_image, (sz.width-width)/2, 0, width, sz.height);
Index: Tekkotsu/tools/mon/org/tekkotsu/mon/WalkGUI.java
diff -c Tekkotsu/tools/mon/org/tekkotsu/mon/WalkGUI.java:1.2 Tekkotsu/tools/mon/org/tekkotsu/mon/WalkGUI.java:1.3
*** Tekkotsu/tools/mon/org/tekkotsu/mon/WalkGUI.java:1.2 Mon Jan 19 14:44:43 2004
--- Tekkotsu/tools/mon/org/tekkotsu/mon/WalkGUI.java Wed Feb 4 18:28:42 2004
***************
*** 56,63 ****
}
public void close() {
! prefs.putInt("WalkGUI.location.x",getLocation().x+getInsets().left);
! prefs.putInt("WalkGUI.location.y",getLocation().y+getInsets().top);
comm.kill();
dispose();
}
--- 56,66 ----
}
public void close() {
! prefs.putInt("WalkGUI.location.x",getLocation().x);
! prefs.putInt("WalkGUI.location.y",getLocation().y);
! //I think I had needed to add getInsets() to keep the window from moving when reopening it, but now it *causes* it to move... weird. what changed?
! //prefs.putInt("WalkGUI.location.x",getLocation().x+getInsets().left);
! //prefs.putInt("WalkGUI.location.y",getLocation().y+getInsets().top);
comm.kill();
dispose();
}
Index: Tekkotsu/tools/mon/org/tekkotsu/mon/WatchableMemory.java
diff -c Tekkotsu/tools/mon/org/tekkotsu/mon/WatchableMemory.java:1.4 Tekkotsu/tools/mon/org/tekkotsu/mon/WatchableMemory.java:1.5
*** Tekkotsu/tools/mon/org/tekkotsu/mon/WatchableMemory.java:1.4 Thu Oct 9 20:46:58 2003
--- Tekkotsu/tools/mon/org/tekkotsu/mon/WatchableMemory.java Wed Feb 4 18:28:42 2004
***************
*** 278,285 ****
WMregistry gui;
CloseAdapter(WMregistry gui) {this.gui=gui;}
public void windowClosing(WindowEvent e) {
! gui.prefs.putInt("WatchableMemory."+gui.name+".location.x",gui.getLocation().x+gui.getInsets().left);
! gui.prefs.putInt("WatchableMemory."+gui.name+".location.y",gui.getLocation().y+gui.getInsets().top);
}
}
--- 278,288 ----
WMregistry gui;
CloseAdapter(WMregistry gui) {this.gui=gui;}
public void windowClosing(WindowEvent e) {
! gui.prefs.putInt("WatchableMemory."+gui.name+".location.x",gui.getLocation().x);
! gui.prefs.putInt("WatchableMemory."+gui.name+".location.y",gui.getLocation().y);
! //I think I had needed to add getInsets() to keep the window from moving when reopening it, but now it *causes* it to move... weird. what changed?
! //gui.prefs.putInt("WatchableMemory."+gui.name+".location.x",gui.getLocation().x+gui.getInsets().left);
! //gui.prefs.putInt("WatchableMemory."+gui.name+".location.y",gui.getLocation().y+gui.getInsets().top);
}
}
Index: Tekkotsu/tools/seg/VisionTrain.java
diff -c Tekkotsu/tools/seg/VisionTrain.java:1.4 Tekkotsu/tools/seg/VisionTrain.java:1.6
*** Tekkotsu/tools/seg/VisionTrain.java:1.4 Tue Jan 20 22:32:26 2004
--- Tekkotsu/tools/seg/VisionTrain.java Mon Feb 2 13:31:25 2004
***************
*** 72,82 ****
ImageData imageData=new ImageData();
if(isRGB)
! imageData.loadFullRGBFiles(files);
else
! imageData.loadFullYUVFiles(files);
! trainCanvas.plotImage(imageData.getHS(), imageData.getRGB());
}
}
--- 72,83 ----
ImageData imageData=new ImageData();
+ //Thanks to martin.mueller at mni.fh-giessen.de for the bug fix:
if(isRGB)
! imageData.loadFullRGBFilesAsRGB(files);
else
! imageData.loadFullYUVFilesAsRGB(files);
! trainCanvas.plotImage(imageData.getHS(), imageData.getPixels());
}
}