Professional Documents
Culture Documents
Imu PDF
Imu PDF
Imu PDF
Gordon Wetzstein!
Stanford University!
!
oculus.com!
from lecture 2:!
vertex in clip space! vertex!
oculus.com!
from lecture 2:!
vertex in clip space! vertex!
rotation! translation!
T ( "eye )
M view = R !T
oculus.com!
from lecture 2:!
vertex in clip space! vertex!
rotation! translation!
T ( "eye )
M view = R !T
view matrix for stereo camera:!
! ipd $
stereo
M view =T #± ,0,0 & ' R 'T ( (eye )
oculus.com! " 2 %
from lecture 2:!
vertex in clip space! vertex!
rotation! translation!
T ( "eye )
M view = R !T
sensor/body world/inertial
oculus.com!
frame! frame!
!y
rotation! translation!
!x T ( "eye )
M view = R !T
!z
( )
R = Rz ( !" z ) # Rx ( !" x ) # Ry !" y
roll! pitch! yaw!
!x
!z
( )
R = Rz ( !" z ) # Rx ( !" x ) # Ry !" y
roll! pitch! yaw!
!x
!z
( )
R = Rz ( !" z ) # Rx ( !" x ) # Ry !" y
roll! pitch! yaw!
quora.com!
wikipedia!
Gyroscopes!
bias!
Gyroscopes!
bias!
$
! ( t + "t ) # ! ( t ) + ! ( t ) "t + % , % ! O ( "t 2 )
! $t
Gyroscopes!
$
! ( t + "t ) # ! ( t ) + ! ( t ) "t + % , % ! O ( "t 2 )
! $t
want:: angle at
at! =! approximation error!!
current time step!
have: gyro measurement!
(angular velocity)!
Gyro Integration: linear motion, no noise, no bias!
Gyro Integration: linear motion, noise, no bias!
Gyro Integration: linear motion, no noise, bias!
Gyro Integration: nonlinear motion, no noise, no bias!
Gyro Integration: nonlinear motion, noise, bias!
Gyro Integration aka Dead Reckoning!
•! accurate in short term, but not reliable in long term due to drift!
Dead Reckoning for Ship Navigation!
•! can measure north with compass, ship’s speed, and time!
•! initial position known!
Always be aware of what units you are working with, degrees per
second v radians per second!!
Accelerometers!
( g)
•! without motion: read noisy gravity vector a + ! pointing UP!
with magnitude 9.81 m/s2 = 1g!
(l )
•! with motion: combined gravity vector and external forces! a
chipworks!
https://stevecurd.wordpress.com/2015/08/25/mems-and-me-how-does-my-fitbit-know-im-walking/!
capacitive!
plates!
Accelerometers!
•! advantages: !
•! points up on average with magnitude of 1g !
•! accurate in long term because no drift and the earth’s
center of gravity (usually) doesn’t move !
•! problem:!
•! noisy measurements!
•! unreliable in short run due to motion (and noise)!
!
•! complementary to gyro measurements!!
Accelerometers!
•! can correct tilt (i.e., pitch & roll) only – no information about
yaw!
Orientation Tracking in Flatland!
()*
(t ) (t"1)
! gyro = ! gyro + #! $t !"#$%&'
()*
# a! x &
! acc "1
$ a! y '
(
= tan % ( = atan2 a! x , a! y ) a!
y
!"#$%&'
(body )
()*
x ( world )
x (body)
Orientation Tracking in Flatland!
y( world )
•! angle from accelerometer!
# a! x &
! acc "1
$ a! y '
(
= tan % ( = atan2 a! x , a! y ) a!
y
!"#$%&'
(body )
()*
x ( world )
x (body)
handles division by 0 and
proper signs, provided by most
programming languages!
Orientation Tracking in Flatland!
y( world )
•! angle from accelerometer!
# a! x &
! acc "1
$ a! y '
(
= tan % ( = atan2 a! x , a! y ) a!
y
!"#$%&'
(body )
()*
x ( world )
x (body)
!"#$%&'
•! intuition: ! ()*
( ) (
! (t ) = " ! (t#1) + $! %t + (1# " ) atan2 a! x , a! y ) !"#$%&'
()*
•! no drift, no noise!!
Orientation Tracking in Flatland!
Pitch and Roll from 3-axis Accelerometer!
•! use only accelerometer data – can estimate pitch & roll, not yaw!
•! assume no external forces (only gravity) – acc is pointing UP!!
normalize gravity vector in
inertial coordinates!
! 0 $ ! 0 $
a!
â =
a! # &
( )
= R # 1 & = Rz ( '( z ) ) Rx ( '( x ) ) Ry '( y # 1 &
# &
" 0 % " 0 %
•! use only accelerometer data – can estimate pitch & roll, not yaw!
•! assume no external forces (only gravity) – acc is pointing UP!!
! 0 $ ! 0 $
a!
â =
a! # &
( )
= R # 1 & = Rz ( '( z ) ) Rx ( '( x ) ) Ry '( y # 1 &
# &
" 0 % " 0 %
# cos ( !" ) ! sin ( !" ) 0 & # 1
%
z z
(%
0 0
(%
( )
& # cos !" y 0 ( )
sin !" y &
(# 0 &
= % sin ( !" ) cos ( !" ) 0 ( % 0 cos ( !" x ) ! sin ( !" x ) (% 0 1 0 (% 1 (
% ( %$ 0 ('
( ) ( )
z z
% (%
1 ' $ 0 sin ( !" x ) cos ( !" x )
( % ! sin !" 0 cos !" y ('
$ 0 0 '$ y
Pitch and Roll from 3-axis Accelerometer!
•! use only accelerometer data – can estimate pitch & roll, not yaw!
•! assume no external forces (only gravity) – acc is pointing UP!!
•! use only accelerometer data – can estimate pitch & roll, not yaw!
•! assume no external forces (only gravity) – acc is pointing UP!!
roll!
# ! cos ( !" ) sin ( !" ) &
âx ! sin ( !" z )
!a % ( = ! tan ( !" z )
x z
( )
! z = "atan2 " âx , ây in rad !["# , # ]
Pitch and Roll from 3-axis Accelerometer!
•! use only accelerometer data – can estimate pitch & roll, not yaw!
•! assume no external forces (only gravity) – acc is pointing UP!!
pitch!
# ! cos ( !" ) sin ( !" ) &
sin ( !" x )
!a % (
x z âz
=
â = = % cos ( !" x ) cos ( !" z ) ( âx2 + ây2 (
cos 2 ( !" x ) sin 2 ( !" z ) + cos 2 ( !" z ) )
a! % (
%$ sin ( !" x ) (' =1
sin ( !" x )
= = tan ( !" x )
cos ( !" x )
Pitch and Roll from 3-axis Accelerometer!
•! use only accelerometer data – can estimate pitch & roll, not yaw!
•! assume no external forces (only gravity) – acc is pointing UP!!
pitch!
# ! cos ( !" ) sin ( !" ) &
sin ( !" x )
!a % (
x z âz
=
â = = % cos ( !" x ) cos ( !" z ) ( âx2 + ây2 (
cos 2 ( !" x ) sin 2 ( !" z ) + cos 2 ( !" z ) )
a! % (
%$ sin ( !" x ) (' =1
( $
% ) '
! x = "atan2 âz , âx2 + ây2 in rad ! & " 2 , 2 )
(
# #
Pitch and Roll from 3-axis Accelerometer!
•! use only accelerometer data – can estimate pitch & roll, not yaw!
•! assume no external forces (only gravity) – acc is pointing UP!!
pitch!
( ( ) )
! x = "atan2 âz ,sign ây # âx2 + ây2 in rad ![ "# , # ]
wikipedia!
Magnetometers!
lifescience.com!
Magnetometers!
LaValle et al.!
Magnetometers!
•! advantages: !
•! complementary to accelerometer – gives yaw (heading)!
!
•! problems: !
•! affected by metal, distortions of magnetic field!
•! need to know location, even when calibrated (e.g. GPS)!
to host:!
serial via USB!
I2C!
GND!
How to read data from IMU!
3.3V!
•! connect power & ground!
GND!
How to read data from IMU!
3.3V!
•! connect power & ground!
variable definition!
setup function = initialization!
•! http://www.chrobotics.com/library!
Positional Tracking with Accelerometers!
! ! !2
x ( t + 1) " x ( t ) + 2 x ( t ) #t
!t !t !t
!
x ( t + #t ) " x ( t ) + x ( t ) #t
!t
Positional Tracking with Accelerometers!