SDF2MAP is a lightweight yet powerful tool that converts Gazebo SDF (Simulation Description Format) and World files into 2D occupancy grid maps compatible with ROS navigation stacks.
It simplifies the process of generating high-quality 2D maps from Gazebo environments — ideal for testing and deploying navigation or localization algorithms in ROS.
- Simulation-to-Reality Pipeline: Generate accurate 2D maps from Gazebo simulations for testing navigation algorithms.
- LIDAR Height Slicing: Extract 2D map layers at specific heights to match your robot’s LIDAR sensor placement.
- PyRoboSim Integration: Seamlessly fits into PyRoboSim workflows.
- ROS Ready: Outputs
.pgmand.yamlmap files for the ROSmap_server.
Go to the Releases page.
- Download
sdf2map-linux-x64.tar.gz. - Navigate to your Downloads folder
cd ~/Downloads
wget -q https://github.com/sherif1152/SDF2MAP/releases/latest/download/sdf2map-linux-x64.tar.gzmkdir -p sdf2map-linux-x64 && tar -xzf sdf2map-linux-x64.tar.gz -C sdf2map-linux-x64cd sdf2map-linux-x64After extraction, you can run the tool in two ways:
Simply double-click the sdf2map executable or run::
./sdf2map💡 Note: If you get a permission error:
chmod +x sdf2map
The graphical interface will start immediately.
Install SDF2MAP so you can run it from anywhere:
./install.shThis will:
- Copy
sdf2mapto~/.local/bin(or/usr/local/binif run as root) - Make it executable
Then simply run from any directory:
sdf2map- Click Browse next to “Input File”
- Choose your
.sdffile
- Click Browse next to “Output Dir”
- Select where the generated map files will be saved
| Parameter | Description | Default |
|---|---|---|
| Resolution | Meters per pixel — lower = higher detail | 0.05 m/px |
| Map Size Scale | Enlarges the map canvas (for large worlds) | 1.0x |
| Super Sampling | Anti-aliasing quality | 4x |
| LIDAR Height | Height slice in cm | 20 cm |
| Min Wall Thickness | Prevents thin walls from disappearing | 0.1 m |
| World Margin | Extra space around borders | 1.0 m |
Presets:
- ⚡ Fast: Quick preview, lower quality
- ⚙️ Standard: Balanced performance
- 🏆 High Quality: Maximum detail
- Click “Convert to Map (Preview)”
- Inspect the preview using zoom controls
If models are missing:
- Browse: Manually locate
.stl,.dae,.obj, or.sdf - Skip Missing: Ignore missing models and continue SDF2MAP remembers your paths for future conversions.
Click “Save Map Files” to export:
map.pgm— Grayscale occupancy mapmap.yaml— ROS-compatible metadata
Standard grayscale occupancy grid image.
image: map.pgm
mode: trinary
resolution: 0.05
origin: [-10.5, -8.3, 0.0]
negate: 0
occupied_thresh: 0.65
free_thresh: 0.25- Ensure
.stl,.dae,.objfiles are in the same directory as your SDF. - Or use Browse to locate them manually.
- Verify LIDAR Height (default = 20 cm).
- Increase World Margin if geometry is cropped.
- Adjust Min Wall Thickness for thin walls.
Made with ❤️ for the Robotics Community
