Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pycozmo/anim_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ def play_audio(self, pkts: List[protocol_encoder.OutputAudio]) -> None:

def display_image(self, pkt: protocol_encoder.DisplayImage) -> None:
self.queue.put_image(pkt)
self.playing_animation = True

def clear_screen(self) -> None:
pkt = protocol_encoder.DisplayImage(image=b"\x3f\x3f")
self.queue.put_image(pkt)
self.playing_animation = False

def play_anim_frame(
self,
Expand Down
5 changes: 2 additions & 3 deletions pycozmo/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,7 @@ def enable_camera(self, enable: bool = True, color: bool = False) -> None:
self.conn.send(pkt)

def clear_screen(self) -> None:
pkt = protocol_encoder.DisplayImage(image=b"\x3f\x3f")
self.anim_controller.display_image(pkt)
self.anim_controller.clear_screen()

def display_image(self, im: Image, duration: Optional[float] = None) -> None:
encoder = image_encoder.ImageEncoder(im)
Expand All @@ -464,7 +463,7 @@ def display_image(self, im: Image, duration: Optional[float] = None) -> None:
self.anim_controller.display_image(pkt)
if duration is not None:
time.sleep(duration)
self.clear_screen()
self.anim_controller.clear_screen()

def _load_clips(self, fspec: str) -> None:

Expand Down