Day 6

Today

    • Conceptual introduction to the particle filter
    • We're all living in a 1D world! (a simple particle filter example)

For Next Time

    • Read Chapters 1 and 2 of ThinkBayes (preferably before next class, definitely before day 8)
    • Watch this video (preferably before next class, definitely before day 8)
    • Put the finishing touches on your Warmup Project, it is officially due at the end of next class.
    • Read over the description of the Robot Localization project.

Conceptual Introduction to the Particle Filter

The particle filter as interpretive dance!

We're all living in a 1D world!

To get the code for today you will need to pull from my comprobo repository.

If you have already setup the a remote to my github repository all you will have to do is:

$ cd ~/catkin_ws/src/comprobo17
$ git pull upstream master

The simple filtering code will be in a package called simple_filter. Before running the code, you will need to do a catkin_make:

$ cd ~/catkin_ws
$ catkin_make

To try things out, let's first startup a 1d simulation of the world

$ rosrun simple_filter simple_filter_world.py _walls:=[0.0,3.0]

Take a look at the topics that are being published. What types of messages are there? What topics correspond to which messages? Take a moment with your partner and make a list of topics and what they might encode.

Next, we will experiment with our first particle filter:

$ rosrun simple_filter simple_particle_filter.py _walls:=[0.0,3.0] _nparticles:=100 _realrobot:=False

A visualization should come up. The visualization shows the position of all the particles, the particle weights, and the true position. Additionally, a histogram is generated that shows the belief about where the robot is.

What happens over time to your visualization?

Try different wall configurations to see what happens. What happens as you change the number of particles? What happens if the wall configuration of the simulator and the particle filter model don't match up?

Construct a scenario where there is an inherent ambiguity in determining where the robot is. How do you do this? What happens when you run your particle filter.

Check out the Code

Next, drill down into the code make sure you take a good look at SensorModel.get_likelihood and SensorModel.sample_prediction. The first function is determining the probability of a sensor measurement for a particular hypothesized robot pose. What does this likelihood function look like? Draw lots of pictures. What assumptions in this function would be violated with the actual Neato.

The second function samples a potential next state based on a measured change via the odometry. What assumptions are encoded in this function. Again, draw lots of pictures.

Run it on the Neato!

If time (likely this would have to be outside of class), try running your particle filter on the actual Neato. To do so, close all nodes and then run:

# do Neato bringup as normal
$ rosrun simple_filter neato_bridge.py
$ rosrun simple_filter simple_particle_filter.py _walls:=[you will need to estimate this] _nparticles:=100 _realrobot:=True

You will have to set the wall configuration based on the distance between obstacles in the room measured along a line (the Neato should be started up on, and aligned to, that line).