Skip to content

Commit ea53799

Browse files
committed
Clear the blue ring when stopping the camera
1 parent 51bfc7f commit ea53799

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

turtlebot4_vision_tutorials/turtlebot4_vision_tutorials/pose_detection.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def __init__(self):
141141
10,
142142
)
143143

144-
self._is_paused = False
144+
self.is_paused_ = False
145145

146146
self.start_camera_srv = self.create_service(
147147
Trigger,
@@ -175,7 +175,7 @@ def __init__(self):
175175
# self.button_1_function()
176176

177177
def pose_detect(self):
178-
if self._is_paused:
178+
if self.is_paused_:
179179
return
180180

181181
if not (POSE_DETECT_ENABLE):
@@ -326,8 +326,9 @@ def autonomous_lights(self):
326326
self.lightring_publisher.publish(lightring_msg)
327327

328328
def handle_start_camera(self, req, resp):
329-
if self._is_paused:
330-
self._is_paused = False
329+
if self.is_paused_:
330+
self.is_paused_ = False
331+
self.lights_blue_ = False
331332
self.pose = MovenetDepthai(input_src='rgb',
332333
model='thunder',
333334
score_thresh=0.3,
@@ -340,8 +341,9 @@ def handle_start_camera(self, req, resp):
340341
return resp
341342

342343
def handle_stop_camera(self, req, resp):
343-
if not self._is_paused:
344-
self._is_paused = True
344+
if not self.is_paused_:
345+
self.is_paused_ = True
346+
self.lights_blue_ = False
345347
self.pose.device.close()
346348
self.pose = None
347349
resp.success = True

0 commit comments

Comments
 (0)