From ea53799f91693d087237aa2a58e71c40b7afd8b4 Mon Sep 17 00:00:00 2001 From: Chris Iverach-Brereton Date: Fri, 27 Sep 2024 13:59:16 -0400 Subject: [PATCH] Clear the blue ring when stopping the camera --- .../turtlebot4_vision_tutorials/pose_detection.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/turtlebot4_vision_tutorials/turtlebot4_vision_tutorials/pose_detection.py b/turtlebot4_vision_tutorials/turtlebot4_vision_tutorials/pose_detection.py index 9f94fc6..694d099 100644 --- a/turtlebot4_vision_tutorials/turtlebot4_vision_tutorials/pose_detection.py +++ b/turtlebot4_vision_tutorials/turtlebot4_vision_tutorials/pose_detection.py @@ -141,7 +141,7 @@ def __init__(self): 10, ) - self._is_paused = False + self.is_paused_ = False self.start_camera_srv = self.create_service( Trigger, @@ -175,7 +175,7 @@ def __init__(self): # self.button_1_function() def pose_detect(self): - if self._is_paused: + if self.is_paused_: return if not (POSE_DETECT_ENABLE): @@ -326,8 +326,9 @@ def autonomous_lights(self): self.lightring_publisher.publish(lightring_msg) def handle_start_camera(self, req, resp): - if self._is_paused: - self._is_paused = False + if self.is_paused_: + self.is_paused_ = False + self.lights_blue_ = False self.pose = MovenetDepthai(input_src='rgb', model='thunder', score_thresh=0.3, @@ -340,8 +341,9 @@ def handle_start_camera(self, req, resp): return resp def handle_stop_camera(self, req, resp): - if not self._is_paused: - self._is_paused = True + if not self.is_paused_: + self.is_paused_ = True + self.lights_blue_ = False self.pose.device.close() self.pose = None resp.success = True