Skip to content

Commit 4a6e6f6

Browse files
Minipadaclaude
andcommitted
fix(ci): fix Format job failures from the small-world commit
Mark the two new Python scripts executable (both carry a shebang) and fix ruff's N806 (uppercase locals in gen_small_world.py's build_map) and N811 (constant imported under a lowercase alias in verify_sim.py). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Af2qGVQQHArcTfQZvHA6aN Signed-off-by: David Bensoussan <d.bensoussan@proton.me>
1 parent 54a34bf commit 4a6e6f6

3 files changed

Lines changed: 11 additions & 9 deletions

File tree

dc_demos/dc_demos/qrcodes_small_waypoint_follower.py

100644100755
File mode changed.

dc_simulation/tools/gen_small_world.py

100644100755
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,8 @@ def build_map():
255255
origin_x = -MAP_HALF_X
256256
origin_y = -MAP_HALF_Y
257257

258-
UNKNOWN, FREE, OCCUPIED = 205, 254, 0
259-
grid = [[UNKNOWN] * width for _ in range(height)]
258+
unknown, free, occupied = 205, 254, 0
259+
grid = [[unknown] * width for _ in range(height)]
260260

261261
def to_px(x, y):
262262
return (round((x - origin_x) / RESOLUTION), round((y - origin_y) / RESOLUTION))
@@ -270,17 +270,17 @@ def fill_rect(x0, y0, x1, y1, value):
270270

271271
outer_x = HALF_X + WALL_T
272272
outer_y = HALF_Y + WALL_T
273-
fill_rect(-outer_x, -outer_y, outer_x, outer_y, FREE)
274-
fill_rect(-outer_x, -outer_y, -HALF_X, outer_y, OCCUPIED) # west wall
275-
fill_rect(HALF_X, -outer_y, outer_x, outer_y, OCCUPIED) # east wall
276-
fill_rect(-outer_x, -outer_y, outer_x, -HALF_Y, OCCUPIED) # south wall
277-
fill_rect(-outer_x, HALF_Y, outer_x, outer_y, OCCUPIED) # north wall
273+
fill_rect(-outer_x, -outer_y, outer_x, outer_y, free)
274+
fill_rect(-outer_x, -outer_y, -HALF_X, outer_y, occupied) # west wall
275+
fill_rect(HALF_X, -outer_y, outer_x, outer_y, occupied) # east wall
276+
fill_rect(-outer_x, -outer_y, outer_x, -HALF_Y, occupied) # south wall
277+
fill_rect(-outer_x, HALF_Y, outer_x, outer_y, occupied) # north wall
278278

279279
# Each pallet+bag stack, approximated as a 1.0 x 1.3 m footprint around its own
280280
# origin (europallet_bag's model origin, QR_DX behind the QR face).
281281
for qr_face_x, y, _ in STATIONS:
282282
pallet_x = qr_face_x - QR_DX
283-
fill_rect(pallet_x - 0.6, y - 0.65, pallet_x + 0.4, y + 0.65, OCCUPIED)
283+
fill_rect(pallet_x - 0.6, y - 0.65, pallet_x + 0.4, y + 0.65, occupied)
284284

285285
# PGM rows run top-to-bottom, i.e. decreasing y (map_server convention, matching
286286
# qrcodes.pgm) -- row 0 of the image is the map's northmost row.

tools/sim/scripts/verify_sim.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,9 @@ def ground_truth_codes(path=None):
293293
if world_to_map_env:
294294
world_to_map = tuple(float(v) for v in world_to_map_env.split(","))
295295
else:
296-
from lint_launch_files import WORLD_TO_MAP as world_to_map
296+
from lint_launch_files import WORLD_TO_MAP
297+
298+
world_to_map = WORLD_TO_MAP
297299

298300
world = re.sub(r"<!--.*?-->", "", pathlib.Path(path).read_text(), flags=re.S)
299301

0 commit comments

Comments
 (0)