Académique Documents
Professionnel Documents
Culture Documents
Abstract: This paper presents an extended Kalman Mechanical trackers can be placed in two separate
filter for real-time estimation of rigid body orientation categories. Body-based systems utilize an exoskeleton
using the newly developed MARG (Magnetic, Angular that is attached to the articulated structure to be tracked.
Rate, and Gravity) sensors. Each MARG sensor Goniometers within the skeletal linkages measure joint
contains a three-axis magnetometer, a three-axis angles. Ground-based systems attach one end of a
angular rate sensor, and a three-axis accelerometer. The boom or shaft to an object to be tracked and typically
filter represents rotations using quaternions rather than have six degrees of freedom [1].
Euler angles, which eliminates the long-standing Active magnetic tracking systems determine both
problem of singularities associated with attitude position and orientation by using small sensors
estimation. A process model for rigid body angular mounted on a rigid body to sense a set of generated
motions and angular rate measurements is defined. The magnetic fields. The sensors contain three mutually
process model converts angular rates into quaternion perpendicular coils. Changes in strength across the coils
rates, which are integrated to obtain quaternions. The are proportional to the distance of each coil from the
Gauss-Newton iteration algorithm is utilized to find the field emitter assembly. Three sequentially emitted
best quaternion that relates the measured accelerations fields create one induced current in each of the three
and earth magnetic field in the body coordinate frame sensor coils, allowing measurement of orientation [2].
to calculated values in the earth coordinate frame. The Practical optical tracking systems may be
best quaternion is used as part of the measurements for separated into two basic categories. Pattern recognition
the Kalman filter. As a result of this approach, the systems sense an artificial pattern of lights and use this
measurement equations of the Kalman filter become information to determine position and/or orientation.
linear, and the computational requirements are [3] Image-based systems determine position by using
significantly reduced, making it possible to estimate multiple cameras to track predesignated points on
orientation in real time. Extensive testing of the filter moving objects within a working volume. The tracked
with synthetic data and actual sensor data proved it to points may be marked actively or passively [4].
be satisfactory. Test cases included the presence of Ultrasonic tracking systems can determine
large initial errors as well as high noise levels. In all position through either time-of-flight and triangulation
cases the filter was able to converge and accurately or phase-coherence. Phase-coherence trackers
track rotational motions. determine distance by measuring the difference in
phase of a reference signal and an emitted signal
1. Introduction detected by sensors.
Fuchs (Foxlin) presented an inertial system for
Accurate real-time tracking of orientation or
head tracking applications [5]. This system utilized a
attitude of rigid bodies has wide applications in
fluid pendulum and three solid-state piezoelectric
robotics, aerospace, underwater vehicles, automotive
angular rate sensors. More recent publications describe
industry, virtual reality, and others. A number of
the use of three orthogonal solid-state rate gyros, a two-
motion tracking technologies have been developed for
axis fluid inclinometer and a two-axis fluxgate compass
virtual reality applications, including mechanical
[6]. Sensor data is processed by a complementary
trackers, active magnetic trackers, optical tracking
separate-bias Kalman filter.
systems, acoustic tracking systems, and inertial tracking
systems.
1
Current Address: Brazilian Navy Research Institute, Rua Ipiru 2, Jardim Guanabara, Rio de Janeiro, RJ, Brazil, 21.931-090,
Email: jlmarins@hotmail.com.
2
Correspondence Address: Department of Electrical and Computer Engineering, Code EC/Yx, Naval Postgraduate School,
Monterey, CA 93943, USA, Email: yun@nps.navy.mil.
2004
+ ω n& n
∫ ∫
wr 1 1 n n̂
ω n̂
τr 2 |n|
-
orientation, in this case, quaternion n. For human body proposed. This approach uses the Gauss-Newton
motions, it is shown in [10] that a simple first order iteration algorithm to find the best matched quaternion
model for the angular rate as shown in Figure 1 is for each measurement from the accelerometers and
sufficient. In the diagram magnetometers. The computed quaternion from the
- wr is a 3-dimensional vector representing white Gauss-Newton iteration algorithm is taken as part of
noise sequences with known covariance that generate p, measurements for the Kalman filter, in addition to the
q, and r, measurements provided by the angular rate sensor. As
a result, the outputs of the Kalman filter are reduced
- τr is the time constant for p, q, and r, and
from nine to seven. More importantly, the output
- ω represents the angular rates p, q, and r. equations become linear, which greatly simplifies the
The variances of the white sequences and the time design of the filter. The feasibility of this approach
constants are to adjusted so that the spectral heavily relies on fast convergence of the Gauss-Newton
characteristics of the signal generated by the model iteration algorithm. Extensive simulations show that
match those of the angular rates under normal the iteration algorithm converges in just 3 to 4 steps,
operational conditions. which ensures the success of this alternative approach.
Quaternion rates are related to angular rates
through the following simple quaternion product [12]: 4.1 The First Approach
1
n& = n ω (7) As was discussed earlier, the states of the process
2 model are:
In the equation above, ω is treated as a quaternion with x1 : angular rate p
zero scalar part.
Combining Equation (7) with the angular rate x2 : angular rate q
model depicted in Figure 1, we obtain a complete x3 : angular rate r
model of a rigid body for the purpose of estimating its x4 : quaternion component a
rotational motions. The complete model is shown in
Figure 2. It is noted that the quaternion resulted from x5 : quaternion component b
the integration is normalized by x6 : quaternion component c
n
nˆ = (8) x7 : quaternion component d (scalar
|n| component)
This is because unit quaternions are needed justify the Based on the model from Figure 2, the state
use of Equation (6) to perform vector rotations as equations can be written as
discussed above. 1 1
x&1 = − x1 + wrx (9)
τ rx τ rx
4. Kalman Filter Design
1 1
In this section, two approaches to the Kalman x&2 = − x2 + wry (10)
τ ry τ ry
filter design are described. The first approach is a
1 1
standard one, which has seven states (3-dimensional x&3 = − x3 + wrz (11)
angular rates, and 4-dimensional quaternion), and nine τ rz τ rz
outputs (nine measurements directly from the MARG 1
sensor). It turns out that the output equations are highly x& 4 = ( x3 x5 − x2 x6 + x1 x7 )
2 x4 + x5 + x6 + x7
2 2 2 2
nonlinear, and the resultant extended Kalman filter
becomes very complicated, making it difficult to (12)
implement in real time. A second approach is thus
2005
B
g
1 Accelerometers Gauss- E
x&5 = (− x3 x4 + x1 x6 + x2 x7 ) g
B Newton
2 x4 + x5 + x6 + x7 h
2 2 2 2 E
Magnetometers Algorithm h
(13)
1
x&6 = ( x2 x4 − x1 x5 + x3 x7 ) computed
a, b, c, d
2 x4 + x5 + x6 + x7
2 2 2 2
measurements
(14)
1
x&7 = (− x1 x4 − x2 x5 − x3 x6 ) Angular rate p, q, r Kalman pˆ , qˆ , rˆ ,
2 x4 + x5 + x6 + x7
2 2 2 2
sensors Filter aˆ , bˆ , cˆ , dˆ
(15)
It is noted that the product terms in the parentheses
are introduced by quaternion product between the Figure 3. Diagram of the Kalman filter Using the
angular rate and the quaternion, and the square-root Second Approach.
terms appeared in the denominator are due to the
quaternion normalization.
Since measurement data to the filter are provided where h1 , h2 , and h3 are values of the earth magnetic
by the MARG sensor, it is natural to choose the field measured in earth coordinates, which are constant
following as the outputs of the Kalman filter: for a given location. It is not difficult to design an
z1 : angular rate p extended Kalman filter based on the state equations (9)
to (15), and the nine output equations, which we did.
z 2 : angular rate q The problem is that computational requirements for
z 3 : angular rate r implementing such a filter is extremely high, making it
z 4 : component of gravity on the x-axis of the unfeasible for real-time motion tracking since a
minimum of fifteen MARG sensors are needed to fully
body frame
track one avatar, not to mention simultaneous tracking
z 5 : component of gravity on the y-axis of the of multiple avatars in a virtual environment. An
body frame alternative approach to the Kalman filter design is thus
z 6 : component of gravity on the z-axis of the presented in the next two subsections.
body frame
z 7 : component of the local magnetic field on the
4.2. Algorithms For Quaternion Convergence
x-axis of the body frame
We first describe two convergence algorithms.
z 8 : component of the local magnetic field on the
Consider a rigid body on which a tri-orthogonal
y-axis of the body frame coordinate frame is attached to its center of gravity. If
z 9 : component of the local magnetic field on the three accelerometers and three magnetometers are fixed
z-axis of the body frame to the origin of the frame, they measure components of
Since angular rates are part of the state, the first the gravity and of the earth magnetic field in the axis of
three output equations are linear and fairly simple: the frame as the body rotates. Because these values are
z1 = x1 (16) known and constant for a given geographic area, one
can expect that there exists a quaternion relating the
z 2 = x2 (17) measurements (values in body frame) to the real
z 3 = x3 (18) magnetic and gravity fields (values in earth frame).
As for the remaining six output equations, they Obviously there are several sources of errors,
turn out to be quite complicated. As an example, the including:
fourth output equation is given by: − misalignments between pairs of axes in each
z 4 = (( x 42 + x72 − x52 − x62 )h1 + 2( x 4 x5 − x6 x7 )h2 sensor;
(19) − linear acceleration misinterpreted as gravity;
+ 2( x 4 x6 + x5 x7 )h3 ) /( x 42 + x52 + x 62 + x72 ) − variation of both gravity and magnetic field; and
− errors inherent to the sensors.
2006
Quaternions Convergence
0.9
a, b, c, d
0.6
gravity and magnetic field in the body frame, calculated in the earth coordinates with respect to each
and of the four quaternion components. The gradient is
R 0 calculated using the formula [15]:
M = (21)
0 R ∂M B T
y0
The matrix R in Eqation (21) is defined by Equation ∂a
(6). ∂M B T
y0
Because y 0 is measured and y1 is known, the
∇ n EQ = −2
∂b ( E y − M By ) (25)
∂M B T 1 0
error between them is a function of the matrix M ,
which in turn depends on the four components of the y0
quaternion. The objective is to find iteratively the ∂c
∂M B
T
2007
Quaternions Convergence Quaternions Convergence - Gauss-Newton - Measurement Noise
0.9 0.8
0.8 a
0.7 a
b b
c c
0.7 d d
0.6
0.6
d, d,
c, c, 0.5
b, 0.5 b,
a a
0.4
0.4
0.3 0.3
0.2
1 2 3 4 0.2
1 2 3 4 5
iteration number iteration number
2008
Covergence of Angular Rates C overgence of Quaternion C omponents - ai + bj + ck + d
1 1
roll (rad/sec)
0.5
a
0
0
0 0.5 1 1.5 2 2.5 3
-1 1
0 0.5 1 1.5 2 2.5 3
1 0.5
pitch (rad/sec)
b
0
0 0 0.5 1 1.5 2 2.5 3
1
-1 0.5
c
0 0.5 1 1.5 2 2.5 3
1 0
yaw (rad/sec)
d
-1 0
0 0.5 1 1.5 2 2.5 3 0 0.5 1 1.5 2 2.5 3
time (sec) tim e (sec)
Figure 7. Convergence of Angular Rates Using Ideal Figure 8. Convergence of Quaternion Components
Data. Using Ideal Data.
r
degrees about the axis m = [ 1 1 1 ] . The initial above or below each trajectory segment. It is seen that
values utilized for the states and the expected steady- the filter is able to successfully track orientations.
state values are listed below: It should be pointed out that testing results
presented here are qualitative in nature. More precise
and quantitative testing will be conducted using a high-
p q r a b c d
precision turntable in the near future.
Initial
1.0 1.0 1.0 1.0 1.0 1.0 1.0 7. Conclusions
Values
This paper presented a complete design of an
Steady
0 0 0 0.5 0.5 0.5 0.5 extended Kalman filter for real-time estimation of rigid
State
body motion attitude. The use of quaternions to
represent rotations, instead of Euler angles, eliminates
The filter results are depicted in Figures 7 and 8. the long-standing problem of singularities called
It is seen that both the angular rates and quaternion “gimbal lock.”
components converge to the steady state in less than a Two approaches to the Kalman filter design were
half of seconds. investigated. The first approach used nine output
The Kalman filter was tested with actual equations: three angular rates, three components of
measurement data collected from a MARG sensor as linear acceleration, and three components of the earth
well. During the period when data were collected, the magnetic field. Since these output equations were
MARG sensor was first rotated 90 degrees about the x highly nonlinear functions of the process state
axis, followed by a 90 degree rotation about the y axis, variables, the partial derivatives needed for the Kalman
and finally rotated 90 degrees about the z axis. Angular filter design were very complicated. As a result, a filter
rates should be zero except the three brief moments formulated with these equations would not be useful for
when the sensor was rotated. The tracking results real-time applications.
produced by the Kalman filter are presented in Figure 9 The second approach utilized Gauss-Newton
and 10. Figure 9 shows the filter tracking result of iteration algorithm to find the optimal quaternion that
angular rates. It is seen that each component of angular related the measurements of linear accelerations and
rates is mostly zero except the brief moment when the earth magnetic field in the body coordinate frame to the
sensor was rotated about that axis, as expected. Minor values in the earth coordinate frame. The optimal
coupling between axes was noticeable. This is because quaternion was used as part of the measurement for the
the MARG sensor was rotated by hand against a Kalman filter, which had seven outputs: three angular
tabletop. It is difficult to keep other two axes rates and four components of a quaternion. As a result,
absolutely fixed while rotating about one axis. Figure the output equations were linear. The partial derivatives
10 shows the tracking results of quaternion were total derivatives and had constant values. The
components. The expected values are marked right convergence algorithm replaced the computation of the
2009
Convergence of Angular Rates - Real Data
4
c
)
2
iterations. The filter implementation used the Gauss-
e
s/
d
ar 0
Newton algorithm because it does not involve second
(
o
ll
-2 order derivatives.
r 0 5 10 15 20
) 4 The filter achieved excellent results for all tests
c
e
s/ 2 using ideal synthetic data and actual sensor data. The
d
ar
( 0 convergence to the steady-state values took only three
h
ct
pi
-2
0 5 10 15 20 or four iteration steps. The filter is able to track
c
)
2
rotational motion of the body on which the MARG
e
s/
d 1
sensor is attached. No singularities were observed,
ar
(
w 0
even when two consecutive 90-degree rotations were
a
y 0 5 10
time (sec)
15 20
applied. Currently, fifteen MARG sensors are
integrated to build a body suit that will be able to track
Figure 9. Tracking Results of Angular Rates posture of a person in virtual reality applications.
Using Actual Data from the MARG Sensor. Although the authors’s interest in quaternion based
filter has thus far been restricted to human body motion
0
zero -0.5
0 5 10 15 20 0 5 10 15 20
time (sec) time (sec)
Figure 10. Tracking Results of Quaternion Components Using the Actual Data from the MARG Sensor.
partial derivatives of the nine nonlinear measurement tracking, the approaches described above are also
equations. The computational requirements for the applicable to any highly maneuverable vehicle or robot.
Kalman filter developed using this approach were In particular, a similar problem without rate sensors has
significantly reduced, making it possible to estimate been investigated for application to manned or
attitude in real time. unmanned aircraft orientation estimation [17].
Extensive tests were conducted to verify the
convergence of Gauss-Newton and Newton algorithms, Acknowledgment
and the performance of the Kalman filter. In almost all
This work was in part supported by the Army
cases and for both Gauss-Newton and Newton
Research Office (ARO) and the U.S. Navy Modeling
algorithms, the convergence occurred in three or four
and Simulation Office (N6).
2010
10. Bachmann, E. R., Duman, I., Usta, U. Y.,
References McGhee, R.B., Yun, X. P., Zyda, M. J.,
“Orientation Tracking for Humans and Robots
1. Fakespace Labs, Inc., Mountain View, California,
Using Inertial Sensors," Proc. of 1999 Symposium
http://www.fakespace.com/products/boom3c.html.
on Computational Intelligence in Robotics &
2. Raab, F., Blood, E., Steiner, O., and Jones, H., Automation, Monterey, CA, November 1999.
“Magnetic Position and Orientation Tracking
11. Savage, P. G., Strapdown Inertial Navigation
System,” IEEE Transactions on Aerospace and
Lecture Notes, Strapdown Associates, Inc.,
Electronics Systems, AES-15, No. 5, 1979, pp.
Minnetonka, Minnesota 1985.
709-717.
12. Kuipers, J.B., Quaternions and Rotation
3. Welch, G., Bishop, G., Vicci, L., Brumback, S.,
Sequences, Princeton University Press, Princeton,
Keller, L., Colucci, D., “The HiBall Tracker:
New Jersey 1999.
High-Performance Wide-Area Tracking for
Virtual and Augmented Environments,” 13. Brown, R.G. and Hwang, P.Y.C., Introduction to
Proceedings of the ACM Symposium on Virtual Random Signals and Applied Kalman Filtering, 3rd
Reality Software and Technology 1999 (VRST 99), Edition, John Wiley and Sons, New York 1997.
University College London, 1999. 14. Hagan, Martin T., Demuth, Howard B., Beale,
4. Vicon Motion Systems, http://www.metrics.co.uk/, Mark, Neural Network Design, PWS Publishing
Oxford Metric Ltd., Oxford, England. Company, Boston 1995.
5. Fuchs, E., Inertial Head-Tracking, Master’s 15. Marins, J. L., An Extended Kalman Filter for
Thesis, Massachusetts Institute of Technology, Quaternion-Based Attitude Estimation, Engineer
Cambridge MA, 1993. Degree’s Thesis, Naval Postgraduate School,
Monterey, California, September 2000.
6. Foxlin, E., “Inertial Head-Tracker Sensor Fusion
by a Complementary Separate-Bias Kalman 16. McGhee, R.B., Bachmann, E.R., Yun, X., and
Filter,” Proceedings of VRAIS `96, IEEE, 1996, Zyda, M.J., “Real-Time Tracking and Display of
pp. 185-194. Human Limb Segment Motions Using Sourceless
Sensors and a Quaternion-Based Filtering
7. Hayward, Roger C., Gebre-Egziabher, Demoz,
Algorithm --- Part I: Theory,” MOVES Academic
Powell, J. David. GPS-Based Attitude for Aircraft.
Group Technical Report NPS-MV-01-001, Naval
http://einstein.stanford.edu/gps/ABS/att_for_aircra
Postgraduate School, Monterey, CA, November
ft_rch1998.html (15 April 2000).
2000.
8. Quine, Ben. Attitude Determination Subsystem.
17. Gebre-Egziabher, Demoz, Elkaim, Gabriel,
http://www.atmosp.physics.utoronto.ca/people/ben
Powell, J.D., and Parkinson, Bradford, “A Gyro-
/pages/spacecraft/Attitude.html (03 June 2000).
Free Quaternion-Based Attitude Determination
9. Leader, D.E., Kalman Filter Estimation of System Suitable for Implementation Using Low
Underwater Vehicle Position and Attitude Using a Cost Sensors,” Proceedings of IEEE 2000 Position
Doppler Velocity Aided Inertial Motion Unit, Location and Navigation Symposium, March 13-
Engineer Degree Thesis, Massachusetts Institute 16, 2000, pp. 185-192.
of Technology and Woods Hole Oceanographic
Institution, Massachusetts, September 1994.
2011