File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -259,11 +259,15 @@ def _place_charger_from_header(
259259 map_data : MapData ,
260260 packet : Q10MapPacket ,
261261) -> bool :
262- """Place the saved dock using its absolute header pixel coordinates."""
262+ """Place the saved dock using its absolute header pixel coordinates.
263+
264+ The Q10 header angle follows the dock axis, while the shared V1 marker
265+ expects the outward-facing normal, so rotate it by 90 degrees.
266+ """
263267 header = packet .header_calibration
264268 if header is None or (position := header .charger_pixels ()) is None :
265269 return False
266- map_data .charger = Point (* position , - header .charger_phi )
270+ map_data .charger = Point (* position , 90 - header .charger_phi )
267271 return True
268272
269273
Original file line number Diff line number Diff line change @@ -164,13 +164,13 @@ def test_render_draws_dock_from_header_without_trace() -> None:
164164
165165
166166def test_place_charger_uses_absolute_header_pixels () -> None :
167- """The dock coordinates do not receive the world origin a second time ."""
167+ """The dock uses absolute pixels and converts its axis to a V1 heading ."""
168168 packet = replace (_packet (), header_calibration = HEADER )
169169 map_data = MapData ()
170170
171171 assert _place_charger_from_header (map_data , packet )
172172
173- assert map_data .charger == Point (3 , 3 , - 90 )
173+ assert map_data .charger == Point (3 , 3 , 0 )
174174
175175
176176def test_place_docked_robot_uses_shared_v1_marker_geometry () -> None :
You can’t perform that action at this time.
0 commit comments