From b390ee00352585e81a6dd09864c84b0976c7f512 Mon Sep 17 00:00:00 2001
From: swittl <simon.wittl@th-deg.de>
Date: Fri, 21 Jun 2024 16:05:44 +0200
Subject: [PATCH] fixed hardware added reachability

---
 rq_hardware/artist/artist_harware_service.py | 2 +-
 rq_hardware/base_hardware_service.py         | 8 +++-----
 rq_hardware/hardware_client.py               | 4 ++--
 3 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/rq_hardware/artist/artist_harware_service.py b/rq_hardware/artist/artist_harware_service.py
index 7a3d218..289b65d 100644
--- a/rq_hardware/artist/artist_harware_service.py
+++ b/rq_hardware/artist/artist_harware_service.py
@@ -66,7 +66,7 @@ class ArtistHardwareInterface(BaseHardwareInterfaceService):
     def check_reachability_callback(self,
                                     request: ReachabilityCheck.Request,
                                     response: ReachabilityCheck.Response):
-        
+        self.get_logger().info('Pose to check ...')
         # include some logic
         response.checked_scan_pose.scan_pose = request.scan_pose
         response.checked_scan_pose.reachable = True
diff --git a/rq_hardware/base_hardware_service.py b/rq_hardware/base_hardware_service.py
index a320265..6060a27 100644
--- a/rq_hardware/base_hardware_service.py
+++ b/rq_hardware/base_hardware_service.py
@@ -11,7 +11,7 @@ class BaseHardwareInterfaceService(Node):
     def __init__(self, node_name: str = 'rq_base_hardware_interface_service'):
         super().__init__(node_name)
         self.srv = self.create_service(AquireProjection, 'aquire_projection', self.aquire_projection_callback)
-        self.srv = self.create_service(AquireProjection, 'reachability_check', self.reachability_check_callback)
+        self.srv = self.create_service(ReachabilityCheck, 'check_reachability', self.check_reachability_callback)
 
         self.projection_publisher = self.create_publisher(Image, 'current_projection_image', 5)
         self.projection_geometry_publisher = self.create_publisher(ProjectionGeometry, 'current_projection_geometry', 5)
@@ -22,11 +22,9 @@ class BaseHardwareInterfaceService(Node):
                                    response: AquireProjection.Response):
         raise NotImplementedError
     
-    def reachability_check_callback(self,
+    def check_reachability_callback(self,
                                     request: ReachabilityCheck.Request,
                                     response: ReachabilityCheck.Response):
         raise NotImplementedError
 
-        
-
-s
\ No newline at end of file
+        
\ No newline at end of file
diff --git a/rq_hardware/hardware_client.py b/rq_hardware/hardware_client.py
index 8cfc236..db89e0f 100644
--- a/rq_hardware/hardware_client.py
+++ b/rq_hardware/hardware_client.py
@@ -15,7 +15,7 @@ class HardwareClient(Node):
         self.cli_projection = self.create_client(AquireProjection, 'aquire_projection')
         while not self.cli_projection.wait_for_service(timeout_sec=1.0):
             self.get_logger().info('projection service not available, waiting again...')
-        self.cli_reachability = self.create_client(ReachabilityCheck, 'reachability_check')
+        self.cli_reachability = self.create_client(ReachabilityCheck, 'check_reachability')
         while not self.cli_projection.wait_for_service(timeout_sec=1.0):
             self.get_logger().info('reachability service not available, waiting again...')
         
@@ -30,7 +30,7 @@ class HardwareClient(Node):
     def check_reachability(self, projection: PyProjection) -> rclpy.Future:
         self.req_reachability.scan_pose = projection.as_message()
 
-        return self.cli_projection.call_async(self.req_reachability)
+        return self.cli_reachability.call_async(self.req_reachability)
     
     @staticmethod
     def projection_response_2_py(response: AquireProjection.Response) -> PyProjection:
-- 
GitLab