Skip to content

Fix map obstacle processing order#283

Merged
ClemensElflein merged 1 commit intoClemensElflein:mainfrom
olliewalsh:obstacle_order
May 1, 2026
Merged

Fix map obstacle processing order#283
ClemensElflein merged 1 commit intoClemensElflein:mainfrom
olliewalsh:obstacle_order

Conversation

@olliewalsh
Copy link
Copy Markdown
Collaborator

@olliewalsh olliewalsh commented May 1, 2026

Set obstacle costs only after all map/nav areas have been cleared. Otherwise a map/nav area can clear an existing obstacle cost.

Summary by CodeRabbit

  • Refactor
    • Optimized map building process with improved grid initialization logic for better performance and maintainability.

Set obstacle costs only after all map/nav areas have been cleared.
Otherwise a map/nav area can clear an existing obstacle cost.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b05224ad-8bd8-425b-9419-02d3df01acee

📥 Commits

Reviewing files that changed from the base of the PR and between d9a0f38 and c4950af.

📒 Files selected for processing (1)
  • src/mower_map/src/mower_map_service.cpp

Walkthrough

The buildMap function has been refactored to use two sequential polygon-iteration passes instead of a single combined loop. The first pass initializes free space (0.0) for active mow/nav areas, and the second pass writes occupied space (1.0) for active obstacle areas.

Changes

Cohort / File(s) Summary
Grid Initialization Refactor
src/mower_map/src/mower_map_service.cpp
Split single polygon-iteration loop into two sequential area-type-specific passes: first writes free space (0.0) for active mow/nav areas, second writes occupied space (1.0) for active obstacle areas.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Two passes through the grid we hop,
First plants the clover, second stops the crop,
Free space and obstacles now clearly part,
One loop became two—a cleaner start! 🗺️

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix map obstacle processing order' directly addresses the main change - reorganizing the obstacle processing logic to ensure obstacles are set only after map/nav areas are cleared.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@ClemensElflein ClemensElflein merged commit 332eaad into ClemensElflein:main May 1, 2026
6 checks passed
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.

2 participants