Skip to content
Snippets Groups Projects
Commit 43796926 authored by Simon Wittl's avatar Simon Wittl
Browse files

added proj example

parent 500668f9
No related branches found
No related tags found
No related merge requests found
/.vscode/
\ No newline at end of file
/.vscode/
/temp/
\ No newline at end of file
......@@ -10,7 +10,7 @@ from rq_hardware.artist.artist_hardware_service import ArtistHardwareInterface
class MeshPublisher(Node):
def __init__(self):
super().__init__('mesh_publisher')
super().__init__('mesh_publisher', namespace='rq')
self.publisher = self.create_publisher(Mesh, 'rq_artist_collision_mesh_mm', 10)
def publish_mesh(self, msg):
......
......@@ -12,7 +12,7 @@ from rq_hardware.hardware_client import HardwareClient
rclpy.init()
client = HardwareClient(namespace="rq")
client = HardwareClient()
roi = PyRegionOfIntrest.dummy()
roi.dimensions_mm = roi.dimensions_mm * 100.
roi.resolution_mm = roi.resolution_mm * 10.
......@@ -26,4 +26,5 @@ volume = client.reachability_map_response_2_py(future.result())
print(volume.shape)
print(volume.array.sum())
\ No newline at end of file
print(volume.array.sum())
import rclpy
import numpy as np
from rq_controller.common import PyProjection
from rq_hardware.hardware_client import HardwareClient
import matplotlib.pyplot as plt
rclpy.init()
hardware_client = HardwareClient()
proj = PyProjection.dummy()
proj.focal_spot_mm = np.array([0., 0., 1000.])
proj.detector_postion_mm = np.array([0., 0., -1000.])
proj.detector_orientation_quad = np.array([0., 0., 0., 1.])
proj.voltage_kv = 100.
proj.current_ua = 40.
future = hardware_client.aquire_projection(proj)
rclpy.spin_until_future_complete(hardware_client, future)
proj_response = hardware_client.projection_response_2_py(future.result())
plt.imshow(proj_response.image)
plt.show()
......@@ -12,10 +12,10 @@ class BaseHardwareInterfaceService(Node):
interface_type: str = 'Base'
last_projection: PyProjection = None
measurement_name: str = 'projection'
projection_tempfolder: Path = Path(r'C:\ros\ros\humble_embedded\rq_workflow\src\rq_hardware\temp')
projection_tempfolder: Path = Path(r'C:\dev\rq_workflow\src\rq_hardware\temp')
def __init__(self, node_name: str = 'rq_base_hardware_interface_service'):
super().__init__(node_name)
super().__init__(node_name, namespace="rq")
self.aquire_projection_srv = self.create_service(AquireProjection, 'aquire_projection', self.aquire_projection_callback)
self.reachability_srv = self.create_service(ReachabilityCheck, 'check_reachability', self.check_reachability_callback)
self.reachability_map_srv = self.create_service(ReachabilityMapCheck, 'check_reachability_map', self.check_reachability_map_callback)
......
......@@ -13,7 +13,7 @@ import numpy as np
class HardwareClient(Node):
def __init__(self, **kwargs):
super().__init__('rq_hardware_client', **kwargs)
super().__init__('rq_hardware_client', namespace="rq", **kwargs)
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...')
......
......@@ -33,7 +33,8 @@ try:
from trajectory_toolbox.util.util_poses import Frame, ScanPoseList, ScanPoseTuple # type: ignore
except ModuleNotFoundError:
raise ModuleNotFoundError("Packages are spedific for the RoboCT of the Deggendorf Institute of Technology. Please Contact: simon.wittl@th-deg.de")
raise ModuleNotFoundError("Packages are spedific for the RoboCT of the Deggendorf Institute of Technology. \n" +
"Please Contact: simon.wittl@th-deg.de")
class TurntablePlannerParameter:
......@@ -44,7 +45,7 @@ class TurntablePlannerParameter:
class ThdRoboCTHardwareInterface(BaseHardwareInterfaceService):
interface_type: str = 'THD'
def __init__(self, node_name: str = 'rq_hardware_interface_service'):
def __init__(self, node_name: str = 'rq_thd_hardware_interface_service'):
super().__init__(node_name)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment