Repository navigation
feat: render Q10 map obstacle markers - #938
Conversation
|
@hCoureau Could you fix the conflict? |
|
Resolved the merge conflicts with current 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
left a comment
There was a problem hiding this comment.
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:
-
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 separateobstaclesordetail_obstaclesproperty onMapContentTrait,CleanSummaryTrait, orMapsTrait—obstacles are parsed on the map packet and rendered into the map image (image_content/MapData.obstacles). - Moreover,
Q10Obstacleis in an internal raw map-packet coordinate frame (50 raw units/pixelrelative to the internal map header origin), which isn't usable by a trait consumer withoutQ10HeaderCalibration. - If we keep
obstaclesandskip_cleaning_pointsonQ10MapPacketfor the parser and renderer and dropmap.obstacles,clean_history.detail_obstacles, andmaps.detail_obstacles, this PR no longer depends on #937 (since #936 is already merged intomain) and can be rebased directly ontomain.
- Neither V1 (
-
Avoid
Q10Obstacle(Q10Point)inheritance and stringified forward references inb01_q10_map_parser.py:- See inline comments on
Q10ObstacleinheritingQ10Point.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 onQ10MapPacket.
- See inline comments on
-
Test public behavior rather than private renderer helpers / patched factory
call_args:- See inline comments on
tests/map/test_b01_q10_render.pyandtests/devices/test_device_manager.py.
- See inline comments on
|
Marking as draft since there are some outstanding comments! |
f157a8c to
d025bad
Compare
|
Thank you @hCoureau for the awesome improvement! Much appreciated as a Q10 owner myself. |
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.Q10Obstacleis a standaloneRoborockBasemodel 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
Rebuilt independently on upstream
main(8e471dc, 7.15.2), without cumulative feature dependencies. No physical-device validation was run for this revision. Related: #767.