Skip to content

Front-left STL placement and A1 bed park position for pickup - #11

Merged
cyrilcaoyang merged 1 commit into
mainfrom
feat/a1-placement-and-park
Nov 5, 2026
Merged

cyrilcaoyang merged 1 commit into
mainfrom
feat/a1-placement-and-park

Conversation

@cyrilcaoyang

Copy link
Copy Markdown
Collaborator

Summary

  • POST /submissions takes an optional placement for an .stl the gateway slices: auto (default, centred by the slicer) or front_left (footprint slicer.placement_margin_mm, default 10 mm, in from the front-left corner of the printable area, resting on the plate, orientation unchanged). The mesh is wrapped in a one-object 3MF whose build transform carries the offset and sliced with --arrange 0. A part that does not fit, an unreadable STL, or placement on an already-sliced .3mf/.gcode → 422.
  • New per-printer slicer.machine_profiles.<id>.end_bed_y_mm rewrites the Y of the stock end gcode's final park move (A1: G1 X-48 Y180 F3600, just before M18) so the finished plate is presented forward. Values outside the printable area, or end gcode without that move, are refused rather than guessed. Recorded as provenance.end_bed_y_mm and returned by pickup-targets as bed_park_y_mm.
  • Docs: README, API reference, agent guide, printers.example.yaml.

Robot pickup impact

Bed-frame object positions are unchanged. On the A1 the bed moves in Y, so parking at Y250 instead of the stock Y180 puts the plate and every object 70 mm further toward the front of the printer. The arm agent should use bed_park_y_mm (null = unknown/stock) in its transform. Motors are released after the print, so the bed can still be pushed.

Safety scope

No new control verb and no gate relaxed: both changes only alter the slice the gateway produces; nothing here sends a printer command. Y250 is within the A1's normal travel (its own start gcode moves to G1 Y250). The user confirmed the forward park position will not hit the robot.

Test plan

  • uv run pytest -q — 333 passed (14 new)
  • uv run ruff check .
  • Real Bambu Studio CLI, A1 presets: cube authored at (100, 150) slices to bed X/Y 10–30 mm (first-layer toolpath 10.3–29.7); auto still centres at 118–138; end gcode ends G1 X-48 Y250 F3600 before M18
  • First hardware print on bambu_a1_01 with placement=front_left and end_bed_y_mm: 250

🤖 Generated with Claude Code

POST /submissions takes an optional `placement` for an .stl the gateway
slices: `auto` (default, the slicer centres the part) or `front_left`
(footprint `slicer.placement_margin_mm`, default 10 mm, in from the bed's
front-left corner, resting on the plate). The CLI has no translate option
and drops a bare STL off the plate with arrange off, so the mesh is wrapped
in a one-object 3MF whose build transform carries the offset and sliced
with --arrange 0. A part that does not fit, or `placement` on an already
sliced file, is refused with 422.

A per-printer `end_bed_y_mm` rewrites the Y of the stock end gcode's final
park move (A1: G1 X-48 Y180 F3600, before M18) so the finished plate is
presented further forward. Out-of-range values and end gcode without that
move are refused. The value is recorded in provenance and returned by
pickup-targets as `bed_park_y_mm`, since bed-frame object positions move
with the bed.

Checked against the real Bambu Studio CLI with the A1 presets: a cube
authored at (100, 150) slices to bed X/Y 10-30 mm (first-layer toolpath
10.3-29.7), and the end gcode parks at Y250 just before M18.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cyrilcaoyang
cyrilcaoyang merged commit 7476165 into main Nov 5, 2026
1 check 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.

1 participant