def joystickUpdated(data): rospy.logfatal("Emergency stop butoon pressed!") if data.buttons[0] == 1: for e in emergencies: try: e() except ServiceException: pass