Skip to content

feat(osmAG): add standalone C++ build, AlphaRemoval noise cleaning, CGAL safety checks, and visual stage export - #2

Open
abdulrahimzulfiqar wants to merge 1 commit into
STAR-Center:masterfrom
abdulrahimzulfiqar:master
Open

feat(osmAG): add standalone C++ build, AlphaRemoval noise cleaning, CGAL safety checks, and visual stage export#2
abdulrahimzulfiqar wants to merge 1 commit into
STAR-Center:masterfrom
abdulrahimzulfiqar:master

Conversation

@abdulrahimzulfiqar

Copy link
Copy Markdown

Summary of Changes

This Pull Request resolves standalone build errors, fixes fatal CGAL precondition crashes on noisy maps, restores missing furniture noise pre-processing from the 2019 Area Graph paper, and adds automated visual stage image export.


1. Standalone Build & Dependency Resolution (ag_osm_generator & osmAG)

  • Resolved CMake Dependencies: Added missing CMake configuration for Qt5 (Qt5::Widgets, Qt5::Gui), CGAL, OpenCV, Eigen3, and PCL.
  • Embedded C++ Source Tree: Fixed missing headers and source files in ag_osm_generator to enable clean standalone C++ building without legacy ROS 1 catkin dependencies.

2. Restored performAlphaRemoval Noise Cleaning

  • Restored Pre-Processing Step: In ag_osm_generator/src/AreaGenerate.cpp, added #include "cgal/AlphaShapeRemoval.h" and invoked performAlphaRemoval().
  • Furniture Clutter Filtering: Automatically strips 3D LiDAR furniture scans and trash bin noise specks from clean.png prior to Voronoi site generation, reducing fragmented 48-polygon decompositions into clean room boundaries.

3. CGAL Assertion & Crash Safeguards (is_simple())

  • Prevented CGAL Precondition Crashes: In ag_osm_generator/src/cgal/CgalVoronoi.cpp, wrapped calls to polygon.bounded_side(p) with polygon.is_simple() checks.
  • Self-Intersecting Loop Protection: Safely skips non-simple contour loops on complex maps instead of throwing uncaught CGAL::Precondition_exception: is_simple() abort errors.

4. Automated Visual Stage Image Export

  • Room Graph (roomGraph.png): Updated ag_osm_generator/src/Area_osm.cpp to automatically save color-coded Voronoi room segmentation maps with red topological room-center nodes.
  • Stage 2 Room Submaps: Updated osmAG/src/data_load_save.cpp to iterate through all leaf area cells (InitOccupancyMap_Area) and export 2D Occupancy Grid Submap images (<map_name>_stage2_room_submap_<1..N>.png).
  • Stage 3 & Stage 4 Vector Rendering: Updated osmAG/src/visualization.cpp with auto-scaled canvas math to render prominent magenta global A* path trajectories, start/goal markers, and passage graph overlays.

5. Flexible Command-Line Output Path

  • Custom Output Destination: Updated ag_osm_generator/test/test_osm_generation.cpp to accept an optional 10th argument (argv[10]) specifying the custom target .osm XML path.

6. Documentation & Build Guides

  • Comprehensive Layman Guide: Completely updated root README.md and ag_osm_generator/ReadMe with system architecture diagrams, macOS/Ubuntu prerequisites, argument reference tables (explaining effective door width $W = \text{door} + 0.1\text{m}$), and copy-paste commands.

Verification & Testing

  • Tested on clean custom maps (big_map_7_cleaned.png: 8 leaf submaps, 4 rooms, 74 A* waypoints).
  • Tested on noisy benchmark maps with furniture clutter (Freiburg79_scan_furnitures_trashbins.png: 44 leaf submaps, 21 passages, 319 A* waypoints over 32.98m).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant