Grid based FastSlam relies on the same principle that Landmakr based FastSlam. The difference is that we are not working with each grid cell as a landmark, but the whole gridmap itself.
For Grid based FastSlam, each particle updates its own grid-map using the data from the range sensor (Lidar, UltraSound, etc.) and its odometry. This is called "Mapping with known poses", which is an easy problem (basically update the probability of a grid cell being occupied based on the data from the range sensor and the odometry, supposing the odometry data is totally correct). Then, and here is where the FastSlam algorithm plays its role, we compute the weight of each particle based on its own grid-map and the new measurements. With all the particles weighted, we then can do resampling. In fact, resampling will be only practical after loop-closings, since it is only when we can compare new data with our previously computed grid-maps. After that, we will keep only particles whose map was closer to reality, since the weight of that particles after resampling on loop-closings will be higher.
The steps would be similar to Landmark based Fastslam:
- Get Data from sensors
- Estimate motion based on odometry measurements
- Estimate grid-map based on range measurements
- Compute Weight based on range measurements and grid-map
- Resample.
The difference between FastSlam and FastSlam2.0 is that in the motion estimation we will use also the range measurements to get a better estimate of the robot position after the movement (typically using scan-matching with Iterative Closest Points algorithms).
- Get Data from sensors
- Estimate motion based on odometry and range measurements
- Estimate grid-map based on range measurements
- Compute Weight based on range measurements and grid-map
- Resample.