Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

matlab/lineplot.m File Reference

Go to the source code of this file.

Functions

Plot C estimator and matlab (x, y) data figure(1)
 plot (xpos, ypos,'ok', xpos, ypos,'-b')
 plot (mX, mY,'-r')
 title ('Estimator postion output')
 legend ('C estimator', 'matlab estimator')
 quiver (xpos, ypos, cos(angle), sin(angle),'r')
Plot C estimator and matlab
angle and steering angle 
figure (2)
 subplot (3, 1, 1)
 title ('Truck angle')
 plot (time, angle,'r')
 plot (time, mAngle,'b')
 subplot (3, 1, 2)
 title ('Differential truck angle')
 plot (time, mAngleD,'b')
 legend ('matlab estimator')
 subplot (3, 1, 3)
 title ('Steering angle')
 plot (time, mSteeringAngle,'b')
plot differential encoder
forward movement and differential
encoder turning 
figure (3)
 plot (time2, encFR_D,'-r')
 plot (time2, encFL_D,'-g')
 plot (time2, encBR_D,'-b')
 plot (time2, encBL_D,'-c')
 title ('Differential encoder data')
 legend ('front right','front left','back right', 'back left')
 plot (time2, encFR_D+encBR_D-encFL_D-encBL_D,'.b')

Variables

Will load and plot test line
cpp data file get input data
from tab deliminated file 
data = dlmread('line.dat','\t')
 xpos = data(:,1)
 ypos = data(:,2)
 angle = data(:,3)
 encFR = data(:,4)
 encFL = data(:,5)
 encBR = data(:,6)
 encBL = data(:,7)
 irFR = data(:,8)
 irFL = data(:,9)
 len = length(xpos)
 time = [0:len-1]
Use matlab estimator to calculate
truck 
states [mX, mY, mAngle, mAngleD, mSteeringAngle] = encEstimator(encFR,encFL,encBR,encBL)
hold off
hold on
Calculate differential encoder
values 
encFR_D = encFR(2:len) - encFR(1:len-1)
 encFL_D = encFL(2:len) - encFL(1:len-1)
 encBR_D = encBR(2:len) - encBR(1:len-1)
 encBL_D = encBL(2:len) - encBL(1:len-1)
 time2 = [0:len-2]


Function Documentation

plot differential encoder forward movement and differential encoder turning figure  ) 
 

Plot C estimator and matlab angle and steering angle figure  ) 
 

legend 'front right'  ,
'front left'  ,
'back right'  ,
'back left' 
 

legend 'matlab estimator'   ) 
 

legend 'C estimator'  ,
'matlab estimator' 
 

Plot C estimator and matlab ,
 

plot time2  ,
encFR_D+encBR_D-encFL_D encBL_D,
'.b' 
 

plot time2  ,
encBL_D  ,
'-c' 
 

plot time2  ,
encBR_D  ,
'-b' 
 

plot time2  ,
encFL_D  ,
'-g' 
 

plot time2  ,
encFR_D  ,
'-r' 
 

plot time  ,
mSteeringAngle  ,
'b' 
 

plot time  ,
mAngleD  ,
'b' 
 

plot time  ,
mAngle  ,
'b' 
 

plot time  ,
angle  ,
'r' 
 

plot mX  ,
mY  ,
'-r' 
 

plot xpos  ,
ypos  ,
'ok'  ,
xpos  ,
ypos  ,
'-b' 
 

quiver xpos  ,
ypos  ,
cos(angle ,
sin(angle ,
'r' 
 

subplot ,
,
 

subplot ,
,
 

subplot ,
,
 

title 'Differential encoder data  ) 
 

title 'Steering angle  ) 
 

title 'Differential truck angle  ) 
 

title 'Truck angle  ) 
 

title 'Estimator postion output'   ) 
 


Variable Documentation

angle = data(:,3)
 

Definition at line 7 of file lineplot.m.

Will load and plot test line cpp data file get input data from tab deliminated file data = dlmread('line.dat','\t')
 

Definition at line 4 of file lineplot.m.

encBL = data(:,7)
 

Definition at line 11 of file lineplot.m.

encBL_D = encBL(2:len) - encBL(1:len-1)
 

Definition at line 62 of file lineplot.m.

encBR = data(:,6)
 

Definition at line 10 of file lineplot.m.

encBR_D = encBR(2:len) - encBR(1:len-1)
 

Definition at line 61 of file lineplot.m.

encFL = data(:,5)
 

Definition at line 9 of file lineplot.m.

encFL_D = encFL(2:len) - encFL(1:len-1)
 

Definition at line 60 of file lineplot.m.

encFR = data(:,4)
 

Definition at line 8 of file lineplot.m.

Calculate differential encoder values encFR_D = encFR(2:len) - encFR(1:len-1)
 

Definition at line 59 of file lineplot.m.

irFL = data(:,9)
 

Definition at line 13 of file lineplot.m.

irFR = data(:,8)
 

Definition at line 12 of file lineplot.m.

len = length(xpos)
 

Definition at line 15 of file lineplot.m.

hold off
 

Definition at line 24 of file lineplot.m.

hold on
 

Definition at line 26 of file lineplot.m.

Use matlab estimator to calculate truck states[mX, mY, mAngle, mAngleD, mSteeringAngle] = encEstimator(encFR,encFL,encBR,encBL)
 

Definition at line 19 of file lineplot.m.

time = [0:len-1]
 

Definition at line 16 of file lineplot.m.

time2 = [0:len-2]
 

Definition at line 63 of file lineplot.m.

xpos = data(:,1)
 

Definition at line 5 of file lineplot.m.

ypos = data(:,2)
 

Definition at line 6 of file lineplot.m.


Generated on Fri Sep 1 14:25:55 2006 for Raptor by  doxygen 1.4.4