diff --git a/unilabos/device_mesh/resource_visalization.py b/unilabos/device_mesh/resource_visalization.py index dab18f1..cea7afc 100644 --- a/unilabos/device_mesh/resource_visalization.py +++ b/unilabos/device_mesh/resource_visalization.py @@ -125,8 +125,13 @@ class ResourceVisualization: new_dev.set("parent_link", "world") new_dev.set("mesh_path", str(self.mesh_path)) new_dev.set("device_name", node["id"]+"_") - if node["parent"] is not None: - new_dev.set("station_name", node["parent"]+'_') + # if node["parent"] is not None: + # new_dev.set("station_name", node["parent"]+'_') + + print('o'*20) + node["parent"] + node["id"] + print('o'*20) new_dev.set("x",str(float(node["position"]["x"])/1000)) new_dev.set("y",str(float(node["position"]["y"])/1000)) new_dev.set("z",str(float(node["position"]["z"])/1000)) diff --git a/unilabos/devices/ros_dev/lh_joint_config.json b/unilabos/devices/ros_dev/lh_joint_config.json index 3f316f5..908cc54 100644 --- a/unilabos/devices/ros_dev/lh_joint_config.json +++ b/unilabos/devices/ros_dev/lh_joint_config.json @@ -15,7 +15,7 @@ "y":{ "first_joint":{ "factor":-0.001, - "offset":0.163 + "offset":0.166 } }, "x":{ diff --git a/unilabos/devices/ros_dev/liquid_handler_joint_publisher.py b/unilabos/devices/ros_dev/liquid_handler_joint_publisher.py index 5075e15..882b519 100644 --- a/unilabos/devices/ros_dev/liquid_handler_joint_publisher.py +++ b/unilabos/devices/ros_dev/liquid_handler_joint_publisher.py @@ -57,7 +57,8 @@ class LiquidHandlerJointPublisher(BaseROS2DeviceNode): if resource['class'] == 'liquid_handler': deck_id = resource['config']['data']['children'][0]['_resource_child_name'] deck_class = resource['config']['data']['children'][0]['_resource_type'].split(':')[-1] - key = f'{resource["id"]}_{deck_id}' + key = f'{deck_id}' + # key = f'{resource["id"]}_{deck_id}' self.lh_devices[key] = { 'joint_msg':JointState( name=[f'{key}_{x}' for x in joint_config[deck_class]['joint_names']], @@ -67,7 +68,9 @@ class LiquidHandlerJointPublisher(BaseROS2DeviceNode): } self.deck_list.append(deck_id) - + print('='*20) + print(self.lh_devices) + print('='*20) self.j_action = ActionServer( self, SendCmd, @@ -103,7 +106,7 @@ class LiquidHandlerJointPublisher(BaseROS2DeviceNode): try: if parent_id in self.deck_list: p_ = self.resources_config[parent_id]['parent'] - str_ = f'{p_}_{parent_id}' + str_ = f'{parent_id}' return str(str_) else: return self.find_resource_parent(parent_id) @@ -215,6 +218,10 @@ class LiquidHandlerJointPublisher(BaseROS2DeviceNode): parent_id = self.find_resource_parent(resource_name_) + + print('!'*20) + print(parent_id) + print('!'*20) if x_joint is None: xa,xb = next(iter(self.lh_devices[parent_id]['joint_config']['x'].items())) x_joint_config = {xa:xb} diff --git a/unilabos/ros/nodes/presets/resource_mesh_manager.py b/unilabos/ros/nodes/presets/resource_mesh_manager.py index f453fe1..dadb49a 100644 --- a/unilabos/ros/nodes/presets/resource_mesh_manager.py +++ b/unilabos/ros/nodes/presets/resource_mesh_manager.py @@ -190,7 +190,8 @@ class ResourceMeshManager(BaseROS2DeviceNode): pass elif parent is not None and resource_id in self.resource_model: - parent_link = f"{self.resource_config_dict[parent]['parent']}_{parent}_device_link".replace("None_","") + # parent_link = f"{self.resource_config_dict[parent]['parent']}_{parent}_device_link".replace("None_","") + parent_link = f"{parent}_device_link".replace("None_","") else: