Skip to content

Commit

Permalink
add go_to_home at the end of drawing shapes
Browse files Browse the repository at this point in the history
  • Loading branch information
co2e14 committed Jan 6, 2025
1 parent bbcfde2 commit 9ebadab
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/rtc6_fastcs/plan_stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,16 @@ def rectangle(rtc6: Rtc6Eth, x: int, y: int, origin: tuple[int, int] = (0, 0)):
yield from line(rtc6, *origin)


JumpOrLineInput = tuple[int, int, bool] # x, y, laser_on
ArcInput = tuple[int, int, float]


@bpp.run_decorator()
def draw_square(rtc6: Rtc6Eth, size: int):
yield from bps.stage(rtc6)
yield from rectangle(rtc6, size, size)
yield from bps.trigger(rtc6)


JumpOrLineInput = tuple[int, int, bool] # x, y, laser_on
ArcInput = tuple[int, int, float]
go_to_home(rtc6)


@bpp.run_decorator()
Expand All @@ -71,6 +72,7 @@ def draw_polygon(rtc6: Rtc6Eth, points: list[JumpOrLineInput]):
else:
yield from jump(rtc6, *point[:-1])
yield from bps.trigger(rtc6)
go_to_home(rtc6)


@bpp.run_decorator()
Expand All @@ -86,6 +88,7 @@ def draw_polygon_with_arcs(rtc6: Rtc6Eth, points: list[JumpOrLineInput | ArcInpu
else:
yield from arc(rtc6, *point)
yield from bps.trigger(rtc6)
go_to_home(rtc6)


@bpp.run_decorator()
Expand Down

0 comments on commit 9ebadab

Please sign in to comment.