Home > src > demos > bot_tt_demo > az_h.m

az_h

PURPOSE ^

AZ_H Azimuth measurement function for EKF.

SYNOPSIS ^

function Y = az_h(x,s)

DESCRIPTION ^

AZ_H Azimuth measurement function for EKF.

  h = atan((y-sy) / (x-sx))

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %AZ_H Azimuth measurement function for EKF.
0002 %
0003 %  h = atan((y-sy) / (x-sx))
0004 %
0005 
0006 % Copyright (C) 2003 Simo Särkkä
0007 %
0008 % $Id: az_h.m,v 1.1.1.1 2003/09/15 10:54:33 ssarkka Exp $
0009 %
0010 % This software is distributed under the GNU General Public
0011 % Licence (version 2 or later); please refer to the file
0012 % Licence.txt, included with the software, for details.
0013 
0014 function Y = az_h(x,s)
0015   Y = zeros(size(s,2),size(x,2));
0016 
0017   for i=1:size(s,2)
0018     h = atan2(x(2,:)-s(2,i),x(1,:)-s(1,i));
0019     np = find(h>0.5*pi);
0020     nn = find(h<-0.5*pi);
0021     if length(nn)>length(np)
0022       h(np) = h(np)-2*pi;
0023     else
0024       h(nn) = h(nn)+2*pi;
0025     end
0026     Y(i,:) = h;
0027   end
0028

Generated on Tue 19-Feb-2008 16:59:37 by m2html © 2003