Skip to content

Commit

Permalink
try multiple oleds shutdown service
Browse files Browse the repository at this point in the history
  • Loading branch information
ArendJan committed Apr 30, 2024
1 parent c460a6a commit ef49e18
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions mirte_telemetrix/scripts/ROS_telemetrix_aio_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1645,14 +1645,15 @@ async def shutdown_robot(self):
f"bash -c \"wall 'Shutting down.'\"",
shell=True,
)
try:
set_image = rospy.ServiceProxy('/mirte/set_middle_image', SetOLEDImage)
set_image("text", "Shutting down")

except rospy.ServiceException as e:
print("Service call failed: %s"%e)
except Exception as e:
print("shutdown image err", e)
for oled_name in ["right", "middle", "left"]: # TODO: use the oled obj directly without hard-coded names
try:
set_image = rospy.ServiceProxy(f'/mirte/set_{oled_name}_image', SetOLEDImage)
set_image("text", "Shutting down")

except rospy.ServiceException as e:
print("Service call failed: %s"%e)
except Exception as e:
print("shutdown image err", e)
rospy.logerr("Triggering shutdown, shutting down in 10s")
# This will make the pico unresponsive after the delay, so ping errors are expected. Need to restart telemetrix to continue.
if hasattr(self, "trigger_shutdown_relay"):
Expand Down

0 comments on commit ef49e18

Please sign in to comment.