This project implements an Occupancy Grid Map using laser scan data from the Dolly robot.
An occupancy grid is a two-dimensional discretized representation of the environment, where each cell contains the posterior probability that the corresponding space is occupied by an obstacle.
-
Occupancy Grid
- Discrete 2D grid of cells.
- Each cell holds the probability of being occupied, free, or unknown.
- Map is updated based on range sensor data (LaserScan).
-
Assumptions
- Ego-position and heading are known exactly.
- Environment is static (no moving obstacles).
-
Decision Approach
- Bayesian update rule is used for occupancy estimation.
- States are binary: Occupied or Free.
- Probabilities are transformed into log-odds for stable numerical updates.
- Create workspace, src and go to src
mkdir temp_ws
cd temp_ws
mkdir src
cd src- Clone repository
git clone https://github.com/surendrakoganti/occupancy_grid_map.git- Return to workspace and build the package
cd ..
colcon build- Source the setup files
source install/setup.bash- Play ros bag file
ros2 bag play -l ./src/occupancy_grid_map/laser_scan_data/rosbag2_2021_05_09-18_39_42_0.db3 - Run the node in new terminal (in same directory as previous terminal):
ros2 run occupancy_grid_map hsc_mapping_laser- Launch Rviz2 in new terminal and add topic "hsc_map" to view the generated occupancy grid map.
| Input laser scan data | Occupancy grid map |
|---|---|
![]() |
![]() |



