Skip to content

feat: render Q10 map obstacle markers - #938

Merged
allenporter merged 2 commits into
Python-roborock:mainfrom
hCoureau:feat/q10-obstacles
Nov 8, 2026
Merged

allenporter merged 2 commits into
Python-roborock:mainfrom
hCoureau:feat/q10-obstacles

Conversation

@hCoureau

@hCoureau hCoureau commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Parse Q10 obstacle and skip-clean point tables using their declared counts and section boundaries, and render position-only obstacle markers. Truncated tables do not shift parsing into following sections.

Obstacle coordinates remain on Q10MapPacket. Q10Obstacle is a standalone RoborockBase model with its own 50-units-per-pixel header transform, separate from trace coordinates. Drawable configuration is forwarded through the Q10 factory. No obstacle type, confidence or photo identifier is inferred.

Validation

  • Full pytest suites on Python 3.11 and 3.14: 2,058 passed, 53 xfailed on each. The repository’s default configuration excludes 11 MQTT-broker tests.
  • Focused suites: 120 passed.
  • All pre-commit checks and wheel/source distribution builds passed.

Rebuilt independently on upstream main (8e471dc, 7.15.2), without cumulative feature dependencies. No physical-device validation was run for this revision. Related: #767.

@lboue

lboue commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

@hCoureau Could you fix the conflict?

@hCoureau

hCoureau commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Resolved the merge conflicts with current main in ded170d by merging main and retaining its accepted 30-second Q10 CLI map-push timeout. The PR's feature changes are preserved. GitHub now reports this PR as conflict-free, and it remains ready for review.

Validation: 1,026 tests passed, 92 snapshots passed, all pre-commit hooks passed, and sdist/wheel builds passed. GitHub CI was triggered for the new head. Required maintainer approval still applies.

The existing stacked dependencies on #936 and #937 still apply; this update does not bypass their review or merge order. Conflict resolution and validation performed with OpenAI Codex assistance.

@allenporter allenporter left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Conducting this code review following our /review skill using Antigravity (AGY) and Gemini 4 Argon.

The map parser and renderer changes for decoding the post-carpet obstacle/skip-clean point tables and drawing Drawable.OBSTACLES look clean and well-bounded.

A few architectural and scoping items to simplify this PR:

  1. Decouple from #937 and keep raw obstacle coordinates internal to the map packet/renderer:

    • Neither V1 (v1/map_content.py) nor Q7 (b01/q7/map_content.py) exposes a separate obstacles or detail_obstacles property on MapContentTrait, CleanSummaryTrait, or MapsTrait—obstacles are parsed on the map packet and rendered into the map image (image_content / MapData.obstacles).
    • Moreover, Q10Obstacle is in an internal raw map-packet coordinate frame (50 raw units/pixel relative to the internal map header origin), which isn't usable by a trait consumer without Q10HeaderCalibration.
    • If we keep obstacles and skip_cleaning_points on Q10MapPacket for the parser and renderer and drop map.obstacles, clean_history.detail_obstacles, and maps.detail_obstacles, this PR no longer depends on #937 (since #936 is already merged into main) and can be rebased directly onto main.
  2. Avoid Q10Obstacle(Q10Point) inheritance and stringified forward references in b01_q10_map_parser.py:

    • See inline comments on Q10Obstacle inheriting Q10Point.to_roborock() (which applies the 2.5 mm trace scale factor rather than the 50 raw units/pixel obstacle scale) and the stringified forward references on Q10MapPacket.
  3. Test public behavior rather than private renderer helpers / patched factory call_args:

    • See inline comments on tests/map/test_b01_q10_render.py and tests/devices/test_device_manager.py.

Comment thread roborock/devices/traits/b01/q10/map.py Resolved
Comment thread roborock/map/b01_q10_map_parser.py Resolved
Comment thread roborock/map/b01_q10_map_parser.py Resolved
Comment thread tests/devices/test_device_manager.py Resolved
Comment thread tests/map/test_b01_q10_render.py Resolved
@Lash-L

Lash-L commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

Marking as draft since there are some outstanding comments!

@Lash-L
Lash-L marked this pull request as draft October 31, 2026 01:55
@hCoureau
hCoureau marked this pull request as ready for review November 7, 2026 19:07
@allenporter
allenporter merged commit f0341e8 into Python-roborock:main Nov 8, 2026
9 checks passed
@allenporter

Copy link
Copy Markdown
Contributor

Thank you @hCoureau for the awesome improvement! Much appreciated as a Q10 owner myself.

@hCoureau
hCoureau deleted the feat/q10-obstacles branch November 8, 2026 19:10
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.

4 participants