Skip to content

Commit

Permalink
Update visit_door_list_phhp
Browse files Browse the repository at this point in the history
  • Loading branch information
jinsooPark-17 authored Mar 11, 2024
1 parent a76d5e9 commit 3048da9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions bwi_tasks/scripts/visit_door_list_phhp
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,21 @@ class BWIbot:
self.opponent_location[1] = amcl.pose.pose.position.y

def wifi_cb(self, wifi_msg):
if not wifi_msg in [str(True), str(False)]:
if not wifi_msg.data in [str(True), str(False)]:
raise ValueError("{} is not a valid /iswifion msg. Please check $comms_log_pkg.".format(wifi_msg))
wifi_connection = wifi_msg.data

# Convert mode when wifi status is changed
if self.mode=="baseline" and wifi_msg == str(True):
if self.mode=="baseline" and wifi_connection == str(True):
# Use PHHP mode and remove all virtual obstacles placed during the baseline mode
self.clear_hallucination_srv()
self.clear_hallucination()
rospy.sleep(0.5) # Make sure vos are completely removed.
self.mode = "phhp"
self.vo_installed = False
elif self.mode=="phhp" and wifi_msg == str(False):
elif self.mode=="phhp" and wifi_connection == str(False):
# Use baseline mode
self.mode = "baseline"
self.clear_costmaps()

def clear_costmaps(self):
rospy.wait_for_service("/move_base/clear_costmaps")
Expand Down

0 comments on commit 3048da9

Please sign in to comment.