GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - CodeName-Detective/2D-Grid-Bayes-Filter-Implementation: A ROS2-based 2D Grid Bayes Filter for robot state estimation. Implements a Markov process to maintain a probabilistic belief of a robot's position by fusing noisy motion models and uncertain sensor observations.

BranchesTags
Open more actions menu

Latest commit

 

History

1 Commit
1 Commit

Folders and files

NameName
Last commit message
Last commit date
bayesian_estimation
bayesian_estimation
 
 
launch
launch
 
 
resource
resource
 
 
test
test
 
 
README.md
README.md
 
 
package.xml
package.xml
 
 
setup.cfg
setup.cfg
 
 
setup.py
setup.py
 
 

Repository files navigation

2D Grid Bayes Filter Implementation

A ROS2-based implementation of a Recursive Bayesian Estimator (Bayes Filter) for robot localization on a 2D grid. This project demonstrates how to track a robot's position by fusing noisy motion commands and imperfect sensor observations to maintain a probabilistic belief state.

Overview

In robotics, sensor data and motor execution are rarely perfect. This project implements a Markov Process that accounts for these uncertainties. By maintaining a 2D probability distribution (the "belief"), the system can estimate the most likely position of a robot even when:

  1. Movement is uncertain: The robot may undershoot or overshoot its target.
  2. Sensors are noisy: The sensor reports a likely position, but with a margin of error.

Features

1. Stochastic Motion Model (Prediction)

The filter predicts the next state based on four cardinal directions (Up, Down, Left, Right).

  • Probabilistic Outcomes: A single move command has a 60% chance of moving 1 step, a 20% chance of staying still, and a 20% chance of moving 2 steps.
  • Boundary Logic: If a predicted move would hit the edge of the grid, the probability mass "piles up" at the boundary, reflecting the physical constraint of the environment.

2. Sensor Observation Model (Correction)

The filter updates the belief based on 1D sensor readings ( or coordinates).

  • Gaussian-like Distribution: The model assigns the highest probability () to the reported index, with decreasing probabilities for adjacent cells ( for and for ).
  • Normalization: After every observation, the system re-normalizes the grid to ensure the total probability sum is exactly .

Repository Structure

  • bayesian_estimation/: Core Python package containing the filter logic.

  • bayesian_estimation.py: The main node implementing action_update and observation_update.

  • launch/: Contains ROS2 launch files for spawning the node and the visualizer.

  • resource/: Visualization assets and grid configurations.


Getting Started

Prerequisites

  • ROS2 (Humble or Iron)
  • NumPy & Matplotlib

Installation

  1. Clone this repo into your ROS2 workspace src folder.
  2. Build the package:
colcon build --packages-select bayesian_estimation
source install/setup.bash

Running the Filter

Launch the estimator and the real-time plotter:

ros2 launch bayesian_estimation bayesian_estimation.launch.py

Sending Commands

You can interact with the robot via the /robot topic:

  • Movement: ros2 topic pub /robot std_msgs/String "{data: 'R2 U3'}" (Moves Right 2, Up 3).
  • Sensing: ros2 topic pub /robot std_msgs/String "{data: 'X10 Y5'}" (Sensor detects ).

Results

As the robot moves, you will see the probability distribution "spread out" (increasing uncertainty). When a sensor reading is received, the distribution "contracts" around the most likely coordinates, demonstrating the filter's ability to self-correct.

About

A ROS2-based 2D Grid Bayes Filter for robot state estimation. Implements a Markov process to maintain a probabilistic belief of a robot's position by fusing noisy motion models and uncertain sensor observations.

Topics

bayesian-estimationpython3ros2

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.