mirror of
https://github.com/dptech-corp/Uni-Lab-OS.git
synced 2026-02-06 14:34:58 +00:00
remove parent's parent link
This commit is contained in:
@@ -125,8 +125,13 @@ class ResourceVisualization:
|
|||||||
new_dev.set("parent_link", "world")
|
new_dev.set("parent_link", "world")
|
||||||
new_dev.set("mesh_path", str(self.mesh_path))
|
new_dev.set("mesh_path", str(self.mesh_path))
|
||||||
new_dev.set("device_name", node["id"]+"_")
|
new_dev.set("device_name", node["id"]+"_")
|
||||||
if node["parent"] is not None:
|
# if node["parent"] is not None:
|
||||||
new_dev.set("station_name", node["parent"]+'_')
|
# 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("x",str(float(node["position"]["x"])/1000))
|
||||||
new_dev.set("y",str(float(node["position"]["y"])/1000))
|
new_dev.set("y",str(float(node["position"]["y"])/1000))
|
||||||
new_dev.set("z",str(float(node["position"]["z"])/1000))
|
new_dev.set("z",str(float(node["position"]["z"])/1000))
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
"y":{
|
"y":{
|
||||||
"first_joint":{
|
"first_joint":{
|
||||||
"factor":-0.001,
|
"factor":-0.001,
|
||||||
"offset":0.163
|
"offset":0.166
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"x":{
|
"x":{
|
||||||
|
|||||||
@@ -57,7 +57,8 @@ class LiquidHandlerJointPublisher(BaseROS2DeviceNode):
|
|||||||
if resource['class'] == 'liquid_handler':
|
if resource['class'] == 'liquid_handler':
|
||||||
deck_id = resource['config']['data']['children'][0]['_resource_child_name']
|
deck_id = resource['config']['data']['children'][0]['_resource_child_name']
|
||||||
deck_class = resource['config']['data']['children'][0]['_resource_type'].split(':')[-1]
|
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] = {
|
self.lh_devices[key] = {
|
||||||
'joint_msg':JointState(
|
'joint_msg':JointState(
|
||||||
name=[f'{key}_{x}' for x in joint_config[deck_class]['joint_names']],
|
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)
|
self.deck_list.append(deck_id)
|
||||||
|
|
||||||
|
print('='*20)
|
||||||
|
print(self.lh_devices)
|
||||||
|
print('='*20)
|
||||||
self.j_action = ActionServer(
|
self.j_action = ActionServer(
|
||||||
self,
|
self,
|
||||||
SendCmd,
|
SendCmd,
|
||||||
@@ -103,7 +106,7 @@ class LiquidHandlerJointPublisher(BaseROS2DeviceNode):
|
|||||||
try:
|
try:
|
||||||
if parent_id in self.deck_list:
|
if parent_id in self.deck_list:
|
||||||
p_ = self.resources_config[parent_id]['parent']
|
p_ = self.resources_config[parent_id]['parent']
|
||||||
str_ = f'{p_}_{parent_id}'
|
str_ = f'{parent_id}'
|
||||||
return str(str_)
|
return str(str_)
|
||||||
else:
|
else:
|
||||||
return self.find_resource_parent(parent_id)
|
return self.find_resource_parent(parent_id)
|
||||||
@@ -215,6 +218,10 @@ class LiquidHandlerJointPublisher(BaseROS2DeviceNode):
|
|||||||
|
|
||||||
parent_id = self.find_resource_parent(resource_name_)
|
parent_id = self.find_resource_parent(resource_name_)
|
||||||
|
|
||||||
|
|
||||||
|
print('!'*20)
|
||||||
|
print(parent_id)
|
||||||
|
print('!'*20)
|
||||||
if x_joint is None:
|
if x_joint is None:
|
||||||
xa,xb = next(iter(self.lh_devices[parent_id]['joint_config']['x'].items()))
|
xa,xb = next(iter(self.lh_devices[parent_id]['joint_config']['x'].items()))
|
||||||
x_joint_config = {xa:xb}
|
x_joint_config = {xa:xb}
|
||||||
|
|||||||
@@ -190,7 +190,8 @@ class ResourceMeshManager(BaseROS2DeviceNode):
|
|||||||
|
|
||||||
pass
|
pass
|
||||||
elif parent is not None and resource_id in self.resource_model:
|
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:
|
else:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user