Skip to content

sherif1152/SDF2MAP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

SDF2MAP — SDF to Occupancy Map Converter


📖 Overview

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.

Key Features

  • 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 .pgm and .yaml map files for the ROS map_server.

Installation

1. Option 1 — Pre-Built Binary

Go to the Releases page.

  • Download sdf2map-linux-x64.tar.gz.
  • Navigate to your Downloads folder
    cd ~/Downloads

1. Option 2 — Direct Download via wget

Download the latest release

wget -q https://github.com/sherif1152/SDF2MAP/releases/latest/download/sdf2map-linux-x64.tar.gz

2. Create a directory and extract the contents into it

mkdir -p sdf2map-linux-x64 && tar -xzf sdf2map-linux-x64.tar.gz -C sdf2map-linux-x64

3. Move into the directory and run the tool

cd sdf2map-linux-x64

Running SDF2MAP

After extraction, you can run the tool in two ways:

Quick Start

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.


System-Wide Installation

Install SDF2MAP so you can run it from anywhere:

./install.sh

This will:

  • Copy sdf2map to ~/.local/bin (or /usr/local/bin if run as root)
  • Make it executable

Then simply run from any directory:

sdf2map

Usage Guide

Step-by-Step Workflow

Usage Demo

1️⃣ Select Input File

  • Click Browse next to “Input File”
  • Choose your .sdf file

2️⃣ Configure Output Directory

  • Click Browse next to “Output Dir”
  • Select where the generated map files will be saved

3️⃣ Adjust Map Parameters

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

4️⃣ Generate Preview

  • Click “Convert to Map (Preview)”
  • Inspect the preview using zoom controls

5️⃣ Handle Missing Models

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.

6️⃣ Save Final Map

Click “Save Map Files” to export:

  • map.pgm — Grayscale occupancy map
  • map.yaml — ROS-compatible metadata

Technical Details

Output Format

🖼️ PGM File

Standard grayscale occupancy grid image.

📄 YAML File (ROS map metadata)

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

Troubleshooting

Cannot locate mesh files

  • Ensure .stl, .dae, .obj files are in the same directory as your SDF.
  • Or use Browse to locate them manually.

Map looks empty

  • 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages