Lecture 02: probability review + Bayes...

19
Lecture 02: probability review + Bayes filters Katie DC Aug. 29, 2019 Notes from Probabilistic Robotics Ch. 2

Transcript of Lecture 02: probability review + Bayes...

Page 1: Lecture 02: probability review + Bayes filterspublish.illinois.edu/ece470-intro-robotics/files/2019/08/02-lecture-part1.pdfAug 02, 2019  · Lecture 02: probability review + Bayes

Lecture 02:probability review + Bayes filters

Katie DC

Aug. 29, 2019

Notes from Probabilistic Robotics Ch. 2

Page 2: Lecture 02: probability review + Bayes filterspublish.illinois.edu/ece470-intro-robotics/files/2019/08/02-lecture-part1.pdfAug 02, 2019  · Lecture 02: probability review + Bayes

Admin

• Reminder that your first homework (HW0 in PrairieLearn is HW1 on website) is due on Friday at 8pm – this is graded

• Quiz 0 is open through Saturday (not graded, just participation checked)

• For all due dates, check out the website:

https://publish.illinois.edu/ece470-intro-robotics/important-dates/

• Office hours will be finalized tomorrow (Friday) and posted online

Page 3: Lecture 02: probability review + Bayes filterspublish.illinois.edu/ece470-intro-robotics/files/2019/08/02-lecture-part1.pdfAug 02, 2019  · Lecture 02: probability review + Bayes

Logistics: Your Project

Your goal will be to create a dynamic simulation, in which at least one complex robot interacts with some other object or agent. The purpose of this project is to allow you to explore robotics in an independent, free-form fashion.

• Note that the course staff will help you conceptually design your system and help you with the fundamentals, but they will not provide debugging support.

There are 5 project updates. You’ll submit (1) a github link to your current codebase for the TAs to run, (2) a well-written readme, (3) a short description of your progress, and (4) a link to video uploaded to youtube demonstrating the deliverable.

• Project Update 1 (Due Sunday 9/8 at midnight) Form a team and tell us about a task you’d like your robot to perform.

Page 4: Lecture 02: probability review + Bayes filterspublish.illinois.edu/ece470-intro-robotics/files/2019/08/02-lecture-part1.pdfAug 02, 2019  · Lecture 02: probability review + Bayes

Throwback Thursday: Who is Bayes?

Bayes was an English statistician, philosopher, and minister who lived from 1701 to 1761, and is known for two works:

1. Divine Benevolence, or an Attempt to Prove That the Principal End of the Divine Providence and Government is the Happiness of His Creatures (1731)

2. An Introduction to the Doctrine of Fluxions, and a Defence of the Mathematicians Against the Objections of the Author of The Analyst (1736), in which he defended the logical foundation of Isaac Newton's calculus ("fluxions") against the criticism of George Berkeley, author of The Analyst

Bayes never published his most famous accomplishment Bayes’ Theorem. These notes were edited and published after his death by Richard Price.

From the HP Autonomy Lab

Probably not Bayes

Page 5: Lecture 02: probability review + Bayes filterspublish.illinois.edu/ece470-intro-robotics/files/2019/08/02-lecture-part1.pdfAug 02, 2019  · Lecture 02: probability review + Bayes

Robot States and the Environment

Robotic System

Page 6: Lecture 02: probability review + Bayes filterspublish.illinois.edu/ece470-intro-robotics/files/2019/08/02-lecture-part1.pdfAug 02, 2019  · Lecture 02: probability review + Bayes

Robot States and the Environment

• State represents the environment as well as the robot, for example:• location of walls or objects

• pose of the robot

• Environment interaction comes in the form of• Sensor measurements

• Control actions

• Internal representation (or belief) of the state of the world• In general, the state (or the world) cannot be measured directly

• Perception is the process by which the robot uses its sensors to obtain information about the state of the environment

Page 7: Lecture 02: probability review + Bayes filterspublish.illinois.edu/ece470-intro-robotics/files/2019/08/02-lecture-part1.pdfAug 02, 2019  · Lecture 02: probability review + Bayes

Axioms of Probability Theory

Page 8: Lecture 02: probability review + Bayes filterspublish.illinois.edu/ece470-intro-robotics/files/2019/08/02-lecture-part1.pdfAug 02, 2019  · Lecture 02: probability review + Bayes

Random Variable 𝑋Discrete Random Variables

• 𝑋 can take on a countable number of values in 𝑥1, 𝑥2, … , 𝑥𝑛

• 𝑃(𝑋 = 𝑥𝑖), or 𝑃(𝑥𝑖), is the probabilitythat the random variable 𝑋 takes on value 𝑥𝑖

• 𝑃 ∙ is called probability mass function

Continuous Random Variables

• 𝑋 takes on values in the continuum

• 𝑝(𝑋 = 𝑥), or 𝑝(𝑥), is a probability density function

=

b

a

dxxpbax )()),(Pr(

Page 9: Lecture 02: probability review + Bayes filterspublish.illinois.edu/ece470-intro-robotics/files/2019/08/02-lecture-part1.pdfAug 02, 2019  · Lecture 02: probability review + Bayes

Expectation of a RV

Page 10: Lecture 02: probability review + Bayes filterspublish.illinois.edu/ece470-intro-robotics/files/2019/08/02-lecture-part1.pdfAug 02, 2019  · Lecture 02: probability review + Bayes

Joint and Conditional Prob. + Total Prob.

Page 11: Lecture 02: probability review + Bayes filterspublish.illinois.edu/ece470-intro-robotics/files/2019/08/02-lecture-part1.pdfAug 02, 2019  · Lecture 02: probability review + Bayes

Bayes Formula

Page 12: Lecture 02: probability review + Bayes filterspublish.illinois.edu/ece470-intro-robotics/files/2019/08/02-lecture-part1.pdfAug 02, 2019  · Lecture 02: probability review + Bayes

Door example of Bayes Rule

Suppose a robot obtains measurement 𝑧. What is 𝑃 open 𝑧 ?

Page 13: Lecture 02: probability review + Bayes filterspublish.illinois.edu/ece470-intro-robotics/files/2019/08/02-lecture-part1.pdfAug 02, 2019  · Lecture 02: probability review + Bayes

Robot States and the Environment

Robotic System

Page 14: Lecture 02: probability review + Bayes filterspublish.illinois.edu/ece470-intro-robotics/files/2019/08/02-lecture-part1.pdfAug 02, 2019  · Lecture 02: probability review + Bayes

Discrete Bayes Filter - Illustration

Page 15: Lecture 02: probability review + Bayes filterspublish.illinois.edu/ece470-intro-robotics/files/2019/08/02-lecture-part1.pdfAug 02, 2019  · Lecture 02: probability review + Bayes

Discrete Bayes Filter Algorithm: Setup

• Discrete time model

𝑥𝑡1:𝑡2 = 𝑥𝑡1 , 𝑥𝑡1+1, 𝑥𝑡1+2, … , 𝑥𝑡2 sequence of robot states 𝑡1 to 𝑡2

• Robot takes one measurement at a time

𝑧𝑡1:𝑡2 = 𝑧𝑡1 , … , 𝑧𝑡2 sequence of all measurements from 𝑡1 to 𝑡2

• Control also exercised at discrete steps

𝑢𝑡1:𝑡2 = 𝑢𝑡1 , 𝑢𝑡1+1, 𝑢𝑡1+2, … , 𝑢𝑡2 sequence control inputs

Page 16: Lecture 02: probability review + Bayes filterspublish.illinois.edu/ece470-intro-robotics/files/2019/08/02-lecture-part1.pdfAug 02, 2019  · Lecture 02: probability review + Bayes

Discrete Bayes Filter Algorithm: State Evolution

Evolution of the state and measurements are governed by probabilistic laws:

𝑝 𝑥𝑡 𝑥0:𝑡−1, 𝑧1:𝑡−1, 𝑢1:𝑡 describes state evolution / motion model

If the state is complete, we can succinctly state:

𝑝 𝑥𝑡 𝑥0:𝑡−1, 𝑧1:𝑡−1, 𝑢1:𝑡 = 𝑝 𝑥𝑡 𝑥𝑡−1, 𝑢𝑡Measurement process given by:

𝑝 𝑧𝑡 𝑥0:𝑡 , 𝑧1:𝑡−1, 𝑢0:𝑡−1Similarly, if measurement is complete:

𝑝 𝑧𝑡 𝑥0:𝑡 , 𝑧1:𝑡−1, 𝑢1:𝑡 = 𝑝 𝑧𝑡 𝑥𝑡

Page 17: Lecture 02: probability review + Bayes filterspublish.illinois.edu/ece470-intro-robotics/files/2019/08/02-lecture-part1.pdfAug 02, 2019  · Lecture 02: probability review + Bayes

Robot States and the Environment

Robotic System

Page 18: Lecture 02: probability review + Bayes filterspublish.illinois.edu/ece470-intro-robotics/files/2019/08/02-lecture-part1.pdfAug 02, 2019  · Lecture 02: probability review + Bayes

BeliefsBelief: Robot’s knowledge about the state of the environment

Recall that the true state is unknowable or not directly measurable, so our robot must infer state from sensor data and we have to distinguish this inferred/estimated state from the actual state 𝑥𝑡

𝑏𝑒𝑙(𝑥𝑡) = 𝑝(𝑥𝑡|𝑧1:𝑡 , 𝑢1:𝑡)

Posterior distribution over state at time t given all past measurements and control

Prediction: 𝑏𝑒𝑙(𝑥𝑡) = 𝑝(𝑥𝑡|𝑧1:𝑡−1, 𝑢1:𝑡)

Calculating 𝑏𝑒𝑙(𝑥𝑡) from 𝑏𝑒𝑙(𝑥𝑡) is called correction or measurement update

Page 19: Lecture 02: probability review + Bayes filterspublish.illinois.edu/ece470-intro-robotics/files/2019/08/02-lecture-part1.pdfAug 02, 2019  · Lecture 02: probability review + Bayes

Recursive Bayes Filter

Algorithm Bayes_Filter(𝑏𝑒𝑙 𝑥𝑡−1 , 𝑢𝑡 , 𝑧𝑡)

for all 𝑥𝑡 do:

𝑏𝑒𝑙 𝑥𝑡 = ∫ 𝑝(𝑥𝑡|𝑢𝑡,𝑥𝑡−1)𝑏𝑒𝑙(𝑥𝑡−1)𝑑𝑥𝑡−1

𝑏𝑒𝑙 𝑥𝑡 = 𝜂 𝑝 𝑧𝑡 𝑥𝑡 𝑏𝑒𝑙(𝑥𝑡)

end for

return 𝑏𝑒𝑙(𝑥𝑡)

𝑏𝑒𝑙 𝑥𝑡−1

𝑥𝑡

1

2

3

𝑝 𝑥𝑡|𝑢𝑡 , 1

𝑝 𝑥𝑡|𝑢𝑡 , 2

𝑝 𝑥𝑡|𝑢𝑡 , 3

𝑏𝑒𝑙 𝑥𝑡−1

𝑏𝑒𝑙(𝑥𝑡)

𝑝 𝑧𝑡 𝑥𝑡