From d33cc0c32dfa3316d9cb6d4d191189ab0096cf8c Mon Sep 17 00:00:00 2001 From: Arthur Golubtsov Date: Fri, 25 Oct 2019 12:28:55 +0100 Subject: [PATCH] Client: modify calibration response and reduce timeout in service check --- Drone/FlightLib/FlightLib.py | 2 +- Drone/copter_client.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Drone/FlightLib/FlightLib.py b/Drone/FlightLib/FlightLib.py index d0c304e..40d019e 100644 --- a/Drone/FlightLib/FlightLib.py +++ b/Drone/FlightLib/FlightLib.py @@ -91,7 +91,7 @@ def _check_nans(*values): @check("Ros services") def check_ros_services(): - timeout = 5.0 + timeout = 0.1 for service in services_list: try: service.wait_for_service(timeout=timeout) diff --git a/Drone/copter_client.py b/Drone/copter_client.py index e60a136..6566a66 100644 --- a/Drone/copter_client.py +++ b/Drone/copter_client.py @@ -301,7 +301,11 @@ def _response_sys_status(*args, **kwargs): @messaging.request_callback("cal_status") def _response_cal_status(*args, **kwargs): - return get_calibration_status() + if check_state_topic(wait_new_status=True): + return get_calibration_status() + else: + stop_subscriber() + return "NOT_CONNECTED_TO_FCU" @messaging.request_callback("position") def _response_position(*args, **kwargs):