robotics: science and systemswcms.inf.ed.ac.uk/ipab/rss/lecture-notes-2018-2019... ·...
TRANSCRIPT
Robotics: Science and Systems
Zhibin (Alex) LiSchool of Informatics
University of Edinburgh
Localization: fundamentals & grid localization
1
Outline1. Introduction of localization2. Basic concepts3. Grid localization:
a. Spatial discretizationb. Probability and Bayes rulec. Principles (histogram filter)
4. Summary and discussion
2
Recap: What Tools Do We Need?
3
Localisation(Where am I?)
The kidnapped robot problem
4
A situation where an autonomous robot in operation is carried to an arbitrary location.
Where am I?
Wabian @Waseda University, Japan
In a new and unknown environment, the robot needs to build the map and localize itself at the same time, this is called simultaneous localization and mapping (SLAM).
Localization problemLocalization is a fundamental task for an autonomous mobile robot to determine its location in a known environment. This problem is originated from mobile robots but is generalized for any system with mobility: wheeled robots, legged robots as well.
5Global positioning system (GPS) has limited accuracy (large variation, 5-10 m) and latencies for high speed applications.
Localization problemLocalization in robotics, location includes the information of position & orientation for example, to represent the robot as a whole.
6
Mobile robot Legged robot
Multiple info is needed, eg features from environment, lane markers, objects, edges, etc.
Localization in practicalFor example in the practicals, a mobile robot needs to know where it is in the arena by detecting what surroundings are, where the map of arena is known.
7
Real-time localizationIn some real-world applications, localization needs to be accurate and has small latency:❏ Good accuracy: <10cm ❏ Real time, or fast enough
8
Localization
9
Concept
10
Concept
11
Initial Belief
?Belief
Position
Concept: first measurement
12
Belief
Position
How it affects our belief?
After the first measurement, the belief changes, and we call it posterior belief. The posterior function is the probability distribution that represents the current belief.
Concept: move to a new location
13
Belief
PositionIncreased uncertainty!
σProbability propagates with movements: convolution.
What will happen if the robot moves?
Move
Concept: second measurement updates the belief
14
Belief
Position
What will happen if the robot sees a valve again?
The 2nd guess where it possibly can be.
Localization
15
Required information:1. Internal measurement,
odometry, kinematics;2. External measurement (camera,
laser scan, infrared sensor, sonar). Observation of external environment (global reference) is important, because measurement of odometry (dead-reckoning) drifts.
Improving position tracking of a mobile robot
Grid Localization
16
Grid localizationThe previous conceptual example is built on our human cognitive understanding, but how to represent these mathematically in the form of algorithms?
Key elements:1. Discretization of space: to convert a continuous space (infinite) to a
discrete space (finite). Search in a set of real numbers instead of infinite real numbers.
2. Probability theory3. Bayes’ rule
17
Grid localization is a probabilistic map-based localization, where map is given.
Discretization of space
18
1 2 3 4 5 6 7 8
xx Picture source:
www.pirobot.org
y
Discretization of space
Continuous map
19
Discrete map
DefinitionsProbability: How likely an event will happen.Example: Tossing a coin, two possible outcomes with equal likelihood, for heads and tails, their probability is both 50%. These two events are independent, and exclusive (it cannot be heads and tails at the same time).
Probability of an event =
Probability theory
20
Number of ways an event occur ________________________________________________Total number of outcomes
Example of throw a single die: Sample space is all possible outcomes (6)A sample point is one possible outcome
Laws of probabilities
21
Definition: and are two events, and are the corresponding probabilities.A basic rules of probability:
1. , probability of event 2. , probability of no event 3. , probability of event or 4. , probability of event and (if independent)5. , probability of event given the event (if
independent)
Total probabilityLaw of total probability: the total probability of an outcome which can possibly happen from a finite number of different events. Mathematically, it is:
22
Posterior probability: the conditional probability of an event that is assigned after the relevant test evidence is taken into account.
● Posterior probability ∝ Prior probability × Likelihood
Posterior probability
23
Prior Probability
Test Evidence
Posterior Probability
Bayes’ ruleBayes' theorem is stated mathematically as follows:
- and are the probability of observing and regardless of each other.- : the conditional probability of observing event given that is true.- : the conditional probability of observing event given that is true.
24
Bayes’ ruleFor the previous localization, define x as the event, z as the observation/measurement, and the probability, so the probability of event x given measurement of z is .According to Bayes’ rule:
How do we understand this?
25
False positive paradox from Bayes’ rule
Grid localization is a non-parametric approach that approximates the posterior using a histogram filter over a grid decomposition of the pose space.
Grid localization is a probabilistic approach that computes the probability distribution of the robot configuration in operation space using acquired sensor information from a sequence of actions.
Grid localization
26
Exploration
Grid localizationGrid localization: discretize the operational space uniformly.
27
1 2 3 4 5 6 7 8
Suppose the map is known, it is decomposed into grids, eg 1-D case here.
ProbabilityIn the beginning without perception, the robot doesn’t know where it is, so the robot can be in any of this grid cell, what is the probability of each grid?
28
? ?
Apply Bayes’ ruleDefine by the grid cell, the measurement at, and the probability.Define the probability that is measured at the location of the grid cell as .Bayes’ rule:
Let’s say measurement is the detection of an object, eg valve, there are multiple possibilities where this is measured (grid 2, 4, 7). is the possibility of the location of grid cell, in our case, possibility is equal in the beginning for all cells, so . is the conditional probability, the probability of having measurement at . Normally, measurement is noisy, so the successful detection of has probability less than 1. For simplicity, we assume at the orange cell, and at the grey cell. 29
Apply law of total probabilityBayes’ rule:
The sum of all the probabilities is equal to unit of 1. So is a way to normalise so the sum of equals to 1.
In an ideal case here, .
For grid cell 2,4, 7, , , so
So , for ; , otherwise.
The sum of follows exactly the law of total probability.
30
Apply law of total probabilityNon-normalised version of Bayes’ rule:
The normalization factor s ensures law of total probability holds.
Therefore, if we want to rule out what the probability is of being at while seeing , we only need to reason about the probability of a location and the probability of measuring at the location of .
31Key:
Principles: notion
32
Belief
Probability of sensor measurement: , is the grid cell, is the measurement at .
Belief of location: , is the set/vector of grid cells at .
Probability
Sense
Measurement update turns the prior into the posterior.33
Prior
Belief
1/8 1/8 1/8 1/8 1/8 1/8 1/8 1/8
Posterior
Probability: correct detection has a higher probability.
Next, what we do?
Without movements, sensors produce the same reading, thus no new info can be generated to update the belief. The robot needs to move for getting new sensor measurements.
34
Recall what we learned
Acquire new sensor feedback by actions
Obtain new information by a variety of actions: move to new observation point, scan camera, etc..
35Adapted from Robot Localization using ArUco @youtube
Move/Act
Here, for simplicity, we assume a perfect movement without any uncertainty.36
Belief
Posterior
Convolution
Move 2 grids
Sense
37
Belief
Posterior
New measurement
Summary of grid localizationMovement introduces uncertainties, it loses some information. Sensing, however, regains new information.The iteration/loop of ‘move’ and ‘sense’ is a process of losing, gaining and updating information. Bayes’ rule is the core to update the belief.
38
Sense Move/Act
Pseudo code of discrete Bayes filter
39(See details in Thrun et al., Probabilistic Robotics: chapters 8.2)
An exampleGrid localization to correct accumulated errors from dead-reckoning by matching sonar information with fine grid maps.
40
Pros:1. Grid localization is a straightforward implementation of discrete
Bayes filter, it is simple and easy. 2. Easy to recover from localization errors.
Rethink critically, what are the pros and cons?
41
Rethink critically, what are the pros and cons?
42
The resolution of the grid is a key variable in the grid localization. The localization error reduces as the resolution increases, ie, smaller and finer grids. However, it demands more computation power and time in return. For a mobile robot in 2D, each discretized pose consists of , for a 10m x 10m area, resolution of 0.05m and 5 degrees results in: 200∙200∙72=2,880,000 states. Cons:1. This indicates scalability issue. A fine fixed-size discretization results
in a huge state space and memory consumption.2. Significant computational power for a large map with high resolution.
RSS PracticalGeometric representation of arena.
43
RSS PracticalDiscretization of geometric space: conceptual grids.
44
RSS PracticalDiscretization of arena: practical representation by matrix.
45