53
EE565:Mobile Robotics Lecture 6 Welcome Dr. Ahmad Kamal Nasir

EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

  • Upload
    others

  • View
    12

  • Download
    0

Embed Size (px)

Citation preview

Page 1: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565:Mobile Robotics Lecture 6

Welcome

Dr. Ahmad Kamal Nasir

Page 2: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Announcement

• Mid-Term Examination # 1 (25%) – Understand basic wheel robot kinematics, common mobile

robot sensors and actuators knowledge. – Understand and able to apply various robot motion and sensor

models used for recursive state estimation techniques. – Demonstrate Inertial/visual odometeric techniques for mobile

robots pose calculations.

• Date: Wednesday 4th March 2015 • Time: 1700-1800 • Venue: SDSB 203!!! • Format: Objective type • Curriculum: Class and Lab Lecture Slides

02.03.2015 Dr. Ahmad Kamal Nasir 2

Page 3: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Today’s Objectives

• Inertial sensors models – Euler Angle Representation

– Accelerometer • Inertial Odometry

– Gyroscope • Euler Angle Rate

– Magnetometer • Earth Magnetic Field

– GPS • Geodetic to Cartesian Coordinates

02.03.2015 Dr. Ahmad Kamal Nasir 3

Page 4: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Euler Angles

02.03.2015 Dr. Ahmad Kamal Nasir 4

Inertial Frame Vehicle-1 Frame

Vehicle-2 Frame Body Frame

Page 5: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Euler Angles (Cont.)

• When using Euler angles then a defined sequence, Yaw(𝜓)Pitch(𝜃)Roll(𝜙), is used to transform body from one orientation to another orientation in 3D space. For example the transformation from inertial frame to body frame using Euler notation is

Inertial frame 𝑅𝐼𝑣1 𝜓 Vehicle-1 frame 𝑅𝑣1

𝑣2 𝜃 Vehicle-2frame 𝑅𝑣2𝐵 𝜙 Body frame

𝑅𝐼𝐵 𝜙, 𝜃, 𝜓 = 𝑅𝑣2

𝐵 𝜙 ∙ 𝑅𝑣1𝑣2 𝜃 ∙ 𝑅𝐼

𝑣1 𝜓

• Similarly the transformation from body frame to inertial frame is

𝑅𝐵𝐼 𝜙, 𝜃, 𝜓 = 𝑅𝐼

𝑣2 −𝜓 ∙ 𝑅𝑣1𝑣2 −𝜃 ∙ 𝑅𝑣2

𝐵 −𝜙

02.03.2015 Dr. Ahmad Kamal Nasir 5

Page 6: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Rotation Matrices

𝑅𝑋 𝜙 = 𝑅𝑣2𝐵 𝜙 =

1 0 00 c 𝜙 s 𝜙

0 −s 𝜙 c 𝜙

𝑅𝑌 𝜃 = 𝑅𝑣1𝑣2 𝜃 =

c 𝜃 0 − s 𝜃0 1 0

s 𝜃 0 c 𝜃

𝑅𝑧 𝜓 = 𝑅𝐼𝑣1 𝜓 =

c 𝜓 s 𝜓 0

−s 𝜓 c 𝜓 00 0 1

Where’s 𝒄𝒐𝒔 𝜽 = 𝒄 𝜽 and 𝒔𝒊𝒏 𝜽 = 𝒔(𝜽)

02.03.2015 Dr. Ahmad Kamal Nasir 6

Page 7: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Euler Angles (Cont.)

𝑅𝐼𝐵 𝜙, 𝜃, 𝜓

=

c 𝜓 c 𝜃 c 𝜃 s 𝜓 − s 𝜃

c 𝜓 s 𝜙 s 𝜃 − c 𝜙 s 𝜓 c 𝜙 c 𝜓 + s 𝜙 s 𝜓 𝑠 𝜃 c 𝜃 s 𝜙

𝑠 𝜙 𝑠 𝜓 + 𝑐 𝜙 𝑐 𝜓 𝑠 𝜃 𝑐 𝜙 𝑠 𝜓 𝑠 𝜃 − 𝑐 𝜓 𝑠 𝜙 𝑐 𝜙 𝑐 𝜃

𝑅𝐵𝐼 𝜙, 𝜃, 𝜓

=

c 𝜓 c 𝜃 c 𝜓 s 𝜙 s 𝜃 − c 𝜙 s 𝜓 𝑠 𝜙 𝑠 𝜓 + 𝑐 𝜙 𝑐 𝜓 𝑠 𝜃

c 𝜃 s 𝜓 c 𝜙 c 𝜓 + s 𝜙 s 𝜓 𝑠 𝜃 𝑐 𝜙 𝑠 𝜓 𝑠 𝜃 − 𝑐 𝜓 𝑠 𝜙

− s 𝜃 c 𝜃 s 𝜙 𝑐 𝜙 𝑐 𝜃

𝑅𝐼𝐵 𝜙, 𝜃, 𝜓 = 𝑅𝐵

𝐼 𝜙, 𝜃, 𝜓𝑇

02.03.2015 Dr. Ahmad Kamal Nasir 7

Page 8: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Inertial Sensor Model

• We require sensor models to calibrate sensors in order to remove noise from sensor measurements thus enhances the accuracy of sensor measurements

02.03.2015 Dr. Ahmad Kamal Nasir 8

Page 9: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Measurement Errors

• Sensor errors are the deviations of sensor measurements from its expected output.

• Systematic errors: periodic, able to be removed by calibration process

• Stochastic errors: random

02.03.2015 Dr. Ahmad Kamal Nasir 9

Page 10: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

x y

z

• Measures all external forces acting upon them (including gravity)

• To obtain inertial acceleration (due to motion alone), gravity must be subtracted

• Accelerometers behave as a damped mass on a spring. Acceleration causes displacement of this "spring" proportional to the acceleration experienced.

– This room = your weight = 1g

– Bugatti Veyron, 0 to 100Km/h in 2.4s= 1.55g

– Space Shuttle reentry & launch = 3g

– Max experienced by a human* = 46.2g

– Death or extensive & severe injuries= +50g

Accelerometer

02.02.2015 Dr. Ahmad Kamal Nasir 10

Page 11: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Accelerometer (Cont.)

• It measures acceleration indirectly by the use of force applied on its body.

• It measures force in opposite direction of acceleration. • Imagine a cube with pressure sensitive walls and a

sphere inside it – In space the ball floats in the middle of box – If we accelerate(g) to left, the right wall measure

acceleration(-g)

02.03.2015 Dr. Ahmad Kamal Nasir 11

Page 12: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Accelerometer (Cont.)

• If we are on earth the ball will fall on the Z- wall and will apply a force of 1g (gravitation force) on the bottom wall

02.03.2015 Dr. Ahmad Kamal Nasir 12

Page 13: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Accelerometer (Cont.)

• If we rotate the accelerometer an angle of 45 the X and Z axis will measure the acceleration.

• If the accelerometer is stationary then the measured acceleration due to gravity can be calculated as follows

𝑨𝟐 = 𝑨𝑿𝟐 + 𝑨𝒀

𝟐 + 𝑨𝒁𝟐

02.03.2015 Dr. Ahmad Kamal Nasir 13

Page 14: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Accelerometer Raw Measurements

To convert the raw accelerometer’s ADC value we use the following equation

𝑨𝑿 =𝑨𝒅𝒄𝑽𝒂𝒍𝒖𝒆𝑿 ×

𝑽𝒓𝒆𝒇𝟐𝑨𝒅𝒄𝑩𝒊𝒕𝒔 − 𝟏

− 𝑽𝒈𝟎

𝑺𝒆𝒏𝒔𝒊𝒕𝒊𝒗𝒊𝒕𝒚=(𝑨𝒅𝒄𝑽𝒂𝒍𝒖𝒆 − 𝑨𝒅𝒄𝑽𝒂𝒍𝒖𝒆𝒈𝟎) × 𝑽𝒓𝒆𝒇

𝑺𝒆𝒏𝒔𝒊𝒕𝒊𝒗𝒊𝒕𝒚 × (𝟐𝑨𝒅𝒄𝑩𝒊𝒕𝒔 − 𝟏)

Assuming 𝐴𝑑𝑐𝑉𝑎𝑙𝑢𝑒𝑥 = 530 𝑉𝑟𝑒𝑓 = 3.3𝑉, 10bits

ADC, 𝑔0 = 1.65𝑉, ADC 𝑆𝑒𝑛𝑠𝑖𝑡𝑖𝑣𝑖𝑡𝑦 =0.4785𝑉

𝑔

530 − 512 × 3.3

0.4785 × 1023= 0.1213𝑔

02.03.2015 Dr. Ahmad Kamal Nasir 14

Page 15: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Accelerometer Measurement Noise

02.03.2015 Dr. Ahmad Kamal Nasir 15

100 200 300 400 500 600 700 800 900

-0.06

-0.04

-0.02

Time (Sec)

Acc.

due t

o g

ravity (

g)

Accelerometer measurements during static condition

X-Acc

y-acc

0 100 200 300 400 500 600 700 800 900

-1.06

-1.04

-1.02

-1

Time (Sec)

Acc.

due t

o g

ravity (

g)

Z-Acc

Page 16: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Accelerometer Noise Statistics

02.03.2015 Dr. Ahmad Kamal Nasir 16

Page 17: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Euler Angles by Accelerometer

• Gravity vector is perpendicular to the horizontal plane made by the earth surface. Therefore, the gravity vector can be used to determine the roll and pitch angle of the horizontal plane.

• Since the horizontal plan can be rotated to any yaw angle with respect to gravity vector direction, therefore, the yaw angle cannot be uniquely determined.

• The accelerometer readings are in body frame and the gravity vector is in inertial frame.

• If we assume that no external acceleration is acted on the accelerometer then the gravity sensed by the sensor in accelerometer body frame is

𝐴𝑏 = 𝑎𝑥 𝑎𝑦 𝑎𝑧𝑇

where the gravity in the inertial/reference frame is 𝐴𝑖 = 0 0 𝑔 𝑇.

02.03.2015 Dr. Ahmad Kamal Nasir 17

Page 18: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Euler Angles by Accelerometer (Cont.)

• The relationship between 𝐴𝑏 and 𝐴𝑖 is as follows 𝐴𝑏 = 𝐶𝑖

𝑏 𝜃, 𝜙, 𝜓 ∙ 𝐴𝑖 𝐴𝑏 = 𝑅𝑥 𝜙 ∙ 𝑅𝑦 𝜃 ∙ 𝑅𝑧 𝜓 ∙ 𝐴𝑖

• Accelerometer measures the components of acceleration due to gravity of an oriented sensor.

• Since we know the gravity vector, therefore the roll and pitch angles are measured by applying the inverse roll and pitch angle transformation to the accelerometer measurements 𝑅𝑦 −𝜃 ∙ 𝑅𝑥 −𝜙 ∙ 𝐴𝑏 = 𝑅𝑦 −𝜃 ∙ 𝑅𝑥 −𝜙 ∙ 𝑅𝑥 𝜙 ∙ 𝑅𝑦 𝜃 ∙ 𝑅𝑧 𝜓 ∙ 𝐴𝑖

02.03.2015 Dr. Ahmad Kamal Nasir 18

Page 19: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Euler Angles by Accelerometer (Cont.)

𝑅𝑦 −𝜃 ∙ 𝑅𝑥 −𝜙 ∙ 𝐴𝑏 = 𝑅𝑧 𝜓 ∙ 𝐴𝑖 𝑅𝑦 −𝜃 ∙ 𝑅𝑥 −𝜙 ∙ 𝐴𝑏 = 𝐴𝑖

cos 𝜃 0 sin 𝜃0 1 0

− sin 𝜃 0 cos 𝜃∙

1 0 00 cos 𝜙 −sin 𝜙

0 sin 𝜙 cos 𝜙∙

𝑎𝑥𝑎𝑦𝑎𝑧

=00𝑔

𝑎𝑥 cos 𝜃 + 𝑎𝑦 sin 𝜙 sin 𝜃 + 𝑎𝑧cos (𝜙)sin (𝜃)

𝑎𝑦 cos 𝜙 − 𝑎𝑧sin (𝜙)

−𝑎𝑥 sin 𝜃 + 𝑎𝑦 sin 𝜙 cos 𝜃 + 𝑎𝑧cos (𝜙)cos (𝜃)

=00𝑔

02.03.2015 Dr. Ahmad Kamal Nasir 19

Page 20: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Euler Angles by Accelerometer (Cont.)

𝑎𝑥 cos 𝜃 + 𝑎𝑦 sin 𝜙 sin 𝜃 + 𝑎𝑧cos (𝜙)sin (𝜃)

𝑎𝑦 cos 𝜙 − 𝑎𝑧sin (𝜙)

−𝑎𝑥 sin 𝜃 + 𝑎𝑦 sin 𝜙 cos 𝜃 + 𝑎𝑧cos (𝜙)cos (𝜃)

=00𝑔

Solving the above equationfor 𝜙 𝑎𝑛𝑑 𝜃 results into

𝜙 = −arctan𝑎𝑦

𝑎𝑧

𝜃 = −arctan𝑎𝑥

𝑎𝑦2 + 𝑎𝑧

2

= −arctan𝑎𝑥

𝑎𝑦 sin 𝜙 + 𝑎𝑧cos (𝜙)

02.03.2015 Dr. Ahmad Kamal Nasir 20

Page 21: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Inertial Odometry by Accelerometer

• To perform inertial odometry the linear acceleration which is being applied on the body has to be determined.

• Since the accelerometer measure the acceleration due to gravity in addition to acceleration being applied on the body, a normal force is being applied on the accelerometer which keep it moving towards the center of earth.

• Therefore, In order to extract the linear acceleration from the accelerometer measurements, first the measurements are rotated by the accelerometer yaw-pitch-roll angles so that they are in the inertial frame and then gravity vector is being added to it which prevent the accelerometer from moving toward center of earth

02.03.2015 Dr. Ahmad Kamal Nasir 21

Page 22: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Inertial Odometry

𝑎𝑥𝑎𝑦𝑎𝑧 𝑖

=

c 𝜓 c 𝜃 c 𝜓 s 𝜙 s 𝜃 − c 𝜙 s 𝜓 𝑠 𝜙 𝑠 𝜓 + 𝑐 𝜙 𝑐 𝜓 𝑠 𝜃

c 𝜃 s 𝜓 c 𝜙 c 𝜓 + s 𝜙 s 𝜓 𝑠 𝜃 𝑐 𝜙 𝑠 𝜓 𝑠 𝜃 − 𝑐 𝜓 𝑠 𝜙

− s 𝜃 c 𝜃 s 𝜙 𝑐 𝜙 𝑐 𝜃

𝑎𝑥𝑎𝑦𝑎𝑧 𝑏

+00𝑔

• Position can be estimated using the rectangular integration method as follows 𝑣𝑘 = 𝑣𝑘−1 + 𝑎𝑘 ∙ Δ𝑡 𝑝𝑘 = 𝑝𝑘−1 + 𝑣𝑘 ∙ Δ𝑡

02.03.2015 Dr. Ahmad Kamal Nasir 22

0 100 200 300 400 500 600 700 800 900 1000-25

-20

-15

-10

-5

0

Time (Sec)

Velo

city (

m/s

ec)

Integrated velocities from Accelerometer measurements during static condition

X-Vel

y-Vel

-6000 -5000 -4000 -3000 -2000 -1000 0-6000

-5000

-4000

-3000

-2000

-1000

0Integrated position trajectory from Accelerometer measurements during static condition

X (m)

Y (

m)

Page 23: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Inertial Odometry

• In addition to the accelerometer noise errors the biggest error terms come from the orientation (transformation matrix) errors.

• If the accelerometer measurements are assumed to be free from noise then the errors in position and velocity due to the errors in the orientation errors can be surmised from the following table

02.03.2015 Dr. Ahmad Kamal Nasir 23

Page 24: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Inertial Odometry

02.03.2015 Dr. Ahmad Kamal Nasir 24

Page 25: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Gyroscope

• A gyroscope is a device for measuring or maintaining orientation, based on the principles of conservation of angular momentum

• Measures orientation (standard gyro) or angular velocity (rate gyro, needs integration for angle)

02.02.2015 Dr. Ahmad Kamal Nasir 25

Page 26: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Gyroscope Raw Measurements

• Gyroscope measures the rate of changes of the angles. For instance a 3-axes gyroscope will measure the rotation rate about the X, Y and Z axes.

• In practice we'll get an ADC value that need to

converted to θ°

Sec using the following formula

𝜽 =𝑨𝒅𝒄𝑽𝒂𝒍𝒖𝒆 − 𝑨𝒅𝒄𝑽𝒂𝒍𝒖𝒆𝟎 × 𝑽𝒓𝒆𝒇

𝑺𝒆𝒏𝒔𝒊𝒕𝒊𝒗𝒊𝒕𝒚 × (𝟐𝑨𝒅𝒄𝑩𝒊𝒕𝒔 − 𝟏)

02.03.2015 Dr. Ahmad Kamal Nasir 26

Page 27: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Gyroscope Raw Measurements

• 𝐴𝑑𝑐𝑉𝑎𝑙𝑢𝑒0 is the value which gyroscope outputs when it is not subjected to rotation

• Sensitivity: is the scale of measurements and expressed in mV

°/𝑠𝑒𝑐

• For example using a 10bits ADC with 𝑉𝑟𝑒𝑓 = 3.3𝑉, AdcValue0 = 512, Sensitivit =0.002V/°/𝑠𝑒𝑐 and 𝐴𝑑𝑐𝑉𝑎𝑙𝑢𝑒 = 571

𝜽 =𝟓𝟕𝟏 − 𝟓𝟏𝟐 × 𝟑. 𝟑

𝟎. 𝟎𝟎𝟐 × 𝟏𝟎𝟐𝟑= 95°/𝑠𝑒𝑐

02.03.2015 Dr. Ahmad Kamal Nasir 27

Page 28: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Gyroscope Bias Drift

• Gyroscope measurements are integrated to get angle. The blue line represents the drift. The following data shows the bias drift rate of 24°/𝒉𝒓

02.03.2015 Dr. Ahmad Kamal Nasir 28

Page 29: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Gyroscope Temperature Drift

02.03.2015 Dr. Ahmad Kamal Nasir 29

0 100 200 300 400 500 600 700 800 900 100022.5

22.55

22.6

22.65

22.7

22.75

22.8

22.85

22.9Temperature variation duing experiment

Time (Sec)

Tem

pera

ture

(C

)

Page 30: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Gyroscope Measurements Noise

02.03.2015 Dr. Ahmad Kamal Nasir 30

0 100 200 300 400 500 600 700 800 900 1000-0.4

-0.3

-0.2

-0.1

0

0.1

0.2

0.3

0.4

Time (Sec)

Angula

r R

ate

(D

eg/S

ec)

Gyro measurements during static condition

X-Gyro

y-Gyro

Z-Gyro

Page 31: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Gyroscope Noise Statistics

02.03.2015 Dr. Ahmad Kamal Nasir 31

Page 32: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Gyroscope Integration

02.03.2015 Dr. Ahmad Kamal Nasir 32

0 100 200 300 400 500 600 700 800 900 1000-6

-4

-2

0

2

4

6

8

10

12

14

Time (Sec)

Angle

(D

eg)

Integrated angles from Gyro measurements during static condition

X-Angle

Y-Angle

Z-Angle

𝜃𝑡 = 𝜃𝑡−1 + 𝜃𝑡 ⋅ Δ𝑡

Page 33: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Euler Angular Rate Using Gyroscope

• The gyroscopes measurements can’t be directly used because it measures body angular rates not the Euler angular rate.

• The gyroscope measurements can be converted into Euler angular rate using the following transformation

𝜙

𝜃

𝜓 =

1 sin 𝜙 tan (𝜃) cos 𝜙 tan (𝜃)0 cos 𝜙 −sin (𝜙)0 sin 𝜙 /cos (𝜃) cos 𝜙 /cos (𝜃)

⋅𝑝𝑞𝑟

02.03.2015 Dr. Ahmad Kamal Nasir 33

Page 34: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Euler Angular Rate Using Gyroscope

𝐷 𝜙, 𝜃, 𝜓 =

1 sin 𝜙 tan (𝜃) cos 𝜙 tan (𝜃)

0 cos 𝜙 −sin (𝜙)

0 sin 𝜙 /cos (𝜃) cos 𝜙 /cos (𝜃)

• The above transformation matrix is obtained by

– first rotating the z-axis gyro in inertial frame

– then the y-axis gyro is rotated into vehicle-1 frame

– And finally x-axis gyro is rotated in vehicle-2 frame

02.03.2015 Dr. Ahmad Kamal Nasir 34

Page 35: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Magnetometer

• Compass invented by the Chinese in the 4th century, Carl Gauss invented the "magnetometer" in 1833. MEMS magnetometer measures the components of earth’s magnetic field intensity

02.02.2015 Dr. Ahmad Kamal Nasir 35

Page 36: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Earth Magnetic Field

• The earth magnetic field intensity is 20𝜇𝑇 - 70𝜇𝑇 Gauss and has a component of magnetic field parallel to earth surface that always point North while the vertical component points toward the center of earth. The vertical component of magnetic field is not required to find magnetic north.

02.03.2015 Dr. Ahmad Kamal Nasir 36

• The geomagnetic field has strength of 𝐹 and made an inclination angle of 𝐼 depending upon the latitude and longitude. The difference between geographic north and magnetic north has an declination angle D which is also location dependent

Page 37: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Magnetometer (Cont.)

02.03.2015 Dr. Ahmad Kamal Nasir 37

0 100 200 300 400 500 600 700 800 900

0.7

0.8

0.9

X-Magnetometer measurements during static condition

0 100 200 300 400 500 600 700 800 900

-0.5

-0.45

-0.4

-0.35

Y-Magnetometer measurements during static condition

Measure

ments

(

T)

0 100 200 300 400 500 600 700 800 900

-0.2

-0.19

-0.18

Z-Magnetometer measurements during static condition

Time (Sec)

Page 38: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Magnetometer (Cont.)

02.03.2015 Dr. Ahmad Kamal Nasir 38

0.65 0.7 0.75 0.8 0.85 0.9 0.95 10

500

1000Histogram of X-Magnetometer measurement during static condition

-0.55 -0.5 -0.45 -0.4 -0.35 -0.30

1000

2000Histogram of Y-Magnetometer measurement during static condition

Fre

quency (

Counts

)

-0.21 -0.205 -0.2 -0.195 -0.19 -0.185 -0.18 -0.175 -0.17 -0.1650

5000Histogram of Z-Magnetometer measurement during static condition

Measurements ( T)

Page 39: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Hard/Soft Iron Effects

• The accuracy of the magnetometer measurements depends on the stray magnetic field inside and around the magnetometer.

• The fixed part is called hard-iron effect and the part due to geomagnetic field is called soft-iron effect. The magnetic field strength and inclination angle depends upon the location (latitude and longitude) on the surface of earth.

02.03.2015 Dr. Ahmad Kamal Nasir 39

• When the x-axis of the magnetometer is pointing northward and downward then it experiences maximum geomagnetic field strength

Page 40: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Earth Magnetic Field

02.03.2015 Dr. Ahmad Kamal Nasir 40

http://wdc.kugi.kyoto-u.ac.jp/igrf/point/index.html

Page 41: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Orientation Using Magnetometer

• It can be used to determine heading direction using the geomagnetic measurements

𝑀𝑏= 𝑚𝑥 𝑚𝑦 𝑚𝑧𝑇

and the roll and pitch angle measured by the

accelerometer.

02.03.2015 Dr. Ahmad Kamal Nasir 41

Page 42: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Orientation Using Magnetometer

• The measurements of the magnetometer in sensor frame can be calculated as follows

𝑀𝑏 = 𝑅𝑥 𝜙 ∙ 𝑅𝑦 𝜃 ∙ 𝑅𝑧 𝜓 ∙ 𝑀𝑖 + 𝑉

• V is the soft iron effects due to the metallic objects near the magnetometer; the soft iron effects vector is independent from rotations because the objects rotate along magnetometer such as the PCB or casing.

02.03.2015 Dr. Ahmad Kamal Nasir 42

Page 43: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Orientation Using Magnetometer

• The magnetometer readings are applied with inverse roll and pitch angles so that the measurements are only affected by the yaw angle i.e.

𝑅𝑦 −𝜃 ∙ 𝑅𝑥 −𝜙 ∙ (𝑀𝑏 − 𝑉) = 𝑅𝑦 −𝜃 ∙ 𝑅𝑥 −𝜙 ∙ 𝑅𝑥 𝜙 ∙ 𝑅𝑦 𝜃 ∙ 𝑅𝑧 𝜓 ∙ 𝑀𝑖

𝑅𝑦 −𝜃 ∙ 𝑅𝑥 −𝜙 ∙ (𝑀𝑏−𝑉) = 𝑅𝑧 𝜓 ∙ 𝑀𝑖

02.03.2015 Dr. Ahmad Kamal Nasir 43

Page 44: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Orientation Using Magnetometer

cos 𝜃 0 sin 𝜃0 1 0

− sin 𝜃 0 cos 𝜃∙

1 0 00 cos 𝜙 −sin 𝜙

0 sin 𝜙 cos 𝜙∙

𝑚𝑥 − 𝑣𝑥𝑚𝑦 − 𝑣𝑦𝑚𝑧 − 𝑣𝑧

=cos (𝜓) sin (𝜓) 0−sin (𝜓) cos (𝜓) 0

0 0 1

∙𝐵 ∙ cos 𝛿

0𝐵 ∙ sin 𝛿

(𝑚𝑥 − 𝑣𝑥) cos 𝜃 + (𝑚𝑦 − 𝑣𝑦) sin 𝜙 sin 𝜃 + (𝑚𝑧 − 𝑣𝑧)cos (𝜙)sin (𝜃)

(𝑚𝑦 − 𝑣𝑦) cos 𝜙 − (𝑚𝑧 − 𝑣𝑧)sin (𝜙)

−(𝑚𝑥 − 𝑣𝑥) sin 𝜃 + (𝑚𝑦 − 𝑣𝑦) sin 𝜙 cos 𝜃 + (𝑚𝑧 − 𝑣𝑧)cos (𝜙)cos (𝜃)

=

𝐵 ∙ cos 𝛿 ∙ cos (𝜓)

−𝐵 ∙ cos 𝛿 ∙ sin (𝜓)

𝐵 ∙ sin 𝛿

Dividing the y-component by the x-component gives us the yaw angle

𝜓 = arctan𝑚𝑧 − 𝑣𝑧 sin 𝜙 − (𝑚𝑦 − 𝑣𝑦) cos 𝜙

(𝑚𝑥 − 𝑣𝑥) cos 𝜃 + (𝑚𝑦 − 𝑣𝑦) sin 𝜙 sin 𝜃 + (𝑚𝑧 − 𝑣𝑧)cos (𝜙)sin (𝜃)

02.03.2015 Dr. Ahmad Kamal Nasir 44

Page 45: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

IMU

• 3-axes MEMS gyroscope

– Provides angular velocity

– Integrate for angular position

• 3-axes MEMS accelerometer

– Provides accelerations (including gravity)

02.02.2015 Dr. Ahmad Kamal Nasir 45

Page 46: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Global Positioning System

02.02.2015 Dr. Ahmad Kamal Nasir 46

• 24+ satellites, 12 hour orbit, 20.190 km height • 6 orbital planes, 4+ satellites per orbit, 60deg distance • Every satellite transmits its position and time • Requires measurements of 4 different satellites • Low accuracy (3-15m) but absolute

Page 47: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Global Positioning System (Cont.)

• GPS is a space based satellite navigation system that provides location and time information anywhere on earth or near earth where there is direct line of sight with at least four satellites.

• We have to understand some coordinate frame to perform conversion to/from geodetic coordinates (latitude 𝜆 , longitude Φ ) to local Cartesian coordinates 𝑥, 𝑦, 𝑧 .

02.03.2015 Dr. Ahmad Kamal Nasir 47

Page 48: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Geodetic to Cartesian Coordinates

• The first frame is a tangent plane τ which is tangent to earth surface at some latitude and longitude. X-axis of this plane is pointing north, Y-axis toward east and Z-axis toward the center of earth.

• The second frame is Earth Centered Earth Fixed (ECEF) frame 𝜖 which is used by the GPS and is centered at the center of earth and rotating with earth.

02.03.2015 Dr. Ahmad Kamal Nasir 48

Page 49: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Geodetic to Cartesian Coordinates

• The X-axis is passing through the prime meridian and the Z-axis is passing through the North Pole, right hand coordinate system.

• The third plane is a Body plane 𝛽 which is attached to the center of mass of the body, it could be NEU (North-East-Up) mostly used by tracker and NED (North-East-Down) mostly used by aero planes.

02.03.2015 Dr. Ahmad Kamal Nasir 49

Page 50: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Geodetic to Cartesian Coordinates

• The conversion from geodetic to Cartesian coordinate is a simple process because there exist a simple and closed form solution.

• The inverse process is complicated because no simple relation relates Φ to X,Y,Z. Broadly there are indirect methods and direct or closed form solution.

• Indirect methods are preferred because of the simplicity.

02.03.2015 Dr. Ahmad Kamal Nasir 50

Page 51: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Geodetic to Cartesian Coordinates

• The earth is considered as a ellipse with semi-major axis 𝑎 = 6378137 𝑚 and semi-minor axis 𝑏 =6356752.31424 𝑚 and 𝑒 = 6.694 379 990 × 10−3.

• The coordinates of the GPS receiver in ECEF frame are calculated as follows given geodetic coordinates

𝑥𝑦𝑧

=

𝑣 Φ + ℎ ∙ cos Φ ∙ cos 𝜆𝑣 Φ + ℎ ∙ cos Φ ∙ sin 𝜆

𝑣 Φ ∙ (1 − 𝑒2) + ℎ ∙ sin Φ

𝑣 Φ =𝑎2

𝑎2 cos Φ 2+𝑏2 sin Φ 2 is the radius of curvature in

prime vertical plane.

02.03.2015 Dr. Ahmad Kamal Nasir 51

Page 52: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Summary

• Inertial sensors models – Euler Angle Representation

– Accelerometer • Inertial Odometry

– Gyroscope • Euler Angle Rate

– Magnetometer • Earth Magnetic Field

– GPS • Geodetic to Cartesian Coordinates

02.03.2015 Dr. Ahmad Kamal Nasir 52

Page 53: EE565:Mobile Robotics Lecture 6web.lums.edu.pk/~akn/Files/Other/teaching/mobile... · EE565: Mobile Robotics Module 3: Inertial and Visual Odometry Announcement •Mid-Term Examination

EE565: Mobile Robotics Module 3: Inertial and Visual Odometry

Questions

02.03.2015 Dr. Ahmad Kamal Nasir 53