Skip to content

Commit

Permalink
#506 Fix default value for status
Browse files Browse the repository at this point in the history
  • Loading branch information
KaoruNishikawa committed Mar 26, 2022
1 parent 59e7571 commit 3aee9a7
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions scripts/controller/ROS_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class controller(object):
dome_tracking_flag = False
access_authority = "no_data"

status = ""
status = None

auth = ""
frame = "controller"
Expand Down Expand Up @@ -950,20 +950,18 @@ def read_status(self):
self.read_sub = rospy.Subscriber("read_status", Read_status_msg, self._write_status)

while not rospy.is_shutdown():
if self.status:
if self.status is not None:
status = self.status
self.status = ""
self.status = None
break
else:
status = ""
time.sleep(0.1)

return status

def _write_status(self, req):
self.status = req
self.read_sub.unregister()
return

# ===================
# others
Expand Down

0 comments on commit 3aee9a7

Please sign in to comment.