From 77bb2d3f4252157717e1a7d3f1ffc300d3dbccb2 Mon Sep 17 00:00:00 2001 From: Balint Rozgonyi <43723477+RBT22@users.noreply.github.com> Date: Mon, 19 Aug 2024 16:49:15 +0200 Subject: [PATCH] [backport] use correct synchronous service call (#1006) Backport from https://github.com/ros-perception/image_pipeline/pull/792 to fix https://github.com/ros-perception/image_pipeline/pull/838 Co-authored-by: Christian Rauch --- .../src/camera_calibration/camera_calibrator.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/camera_calibration/src/camera_calibration/camera_calibrator.py b/camera_calibration/src/camera_calibration/camera_calibrator.py index 825b95298..ae5faffcf 100755 --- a/camera_calibration/src/camera_calibration/camera_calibrator.py +++ b/camera_calibration/src/camera_calibration/camera_calibrator.py @@ -193,10 +193,8 @@ def handle_stereo(self, msg): def check_set_camera_info(self, response): - if response.done(): - if response.result() is not None: - if response.result().success: - return True + if response.success: + return True for i in range(10): print("!" * 80) @@ -218,14 +216,14 @@ def do_upload(self): rv = True if self.c.is_mono: req.camera_info = info - response = self.set_camera_info_service.call_async(req) + response = self.set_camera_info_service.call(req) rv = self.check_set_camera_info(response) else: req.camera_info = info[0] - response = self.set_left_camera_info_service.call_async(req) + response = self.set_left_camera_info_service.call(req) rv = rv and self.check_set_camera_info(response) req.camera_info = info[1] - response = self.set_right_camera_info_service.call_async(req) + response = self.set_right_camera_info_service.call(req) rv = rv and self.check_set_camera_info(response) return rv