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