Skip to content

Commit 18709ce

Browse files
XuwznlnTablewareBoxMile-Awayq434343
authored
24 high level liquidhandler (#28)
* unify liquid_handler definition * remove default values * Dev Sync (#25) * Update README and MQTTClient for installation instructions and code improvements * feat: 支持local_config启动 add: 增加对crt path的说明,为传入config.py的相对路径 move: web component * add: registry description * add 3d visualization * 完成在main中启动设备可视化 完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model 添加物料模型管理类,遍历物料与resource_model,完成TF数据收集 * 完成TF发布 * 修改模型方向,在yaml中添加变换属性 * 添加物料tf变化时,发送topic到前端 另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题 * 添加关节发布节点与物料可视化节点进入unilab * 使用json启动plr与3D模型仿真 * feat: node_info_update srv fix: OTDeck cant create * close #12 feat: slave node registry * feat: show machine name fix: host node registry not uploaded * feat: add hplc registry * feat: add hplc registry * fix: hplc status typo * fix: devices/ * 完成启动OT并联动rviz * add 3d visualization * 完成在main中启动设备可视化 完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model 添加物料模型管理类,遍历物料与resource_model,完成TF数据收集 * 完成TF发布 * 修改模型方向,在yaml中添加变换属性 * 添加物料tf变化时,发送topic到前端 另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题 * 添加关节发布节点与物料可视化节点进入unilab * 使用json启动plr与3D模型仿真 * 完成启动OT并联动rviz * fix: device.class possible null * fix: HPLC additions with online service * fix: slave mode spin not working * fix: slave mode spin not working * 修复rviz位置问题, 修复rviz位置问题, 在无tf变动时减缓发送频率 在backend中添加物料跟随方法 * feat: 多ProtocolNode 允许子设备ID相同 feat: 上报发现的ActionClient feat: Host重启动,通过discover机制要求slaveNode重新注册,实现信息及时上报 * feat: 支持env设置config * fix: running logic * fix: running logic * fix: missing ot * 在main中直接初始化republisher和物料的mesh节点 * 将joint_republisher和resource_mesh_manager添加进 main_slave_run.py中 * Device visualization (#14) * add 3d visualization * 完成在main中启动设备可视化 完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model 添加物料模型管理类,遍历物料与resource_model,完成TF数据收集 * 完成TF发布 * 修改模型方向,在yaml中添加变换属性 * 添加物料tf变化时,发送topic到前端 另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题 * 添加关节发布节点与物料可视化节点进入unilab * 使用json启动plr与3D模型仿真 * 完成启动OT并联动rviz * add 3d visualization * 完成在main中启动设备可视化 完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model 添加物料模型管理类,遍历物料与resource_model,完成TF数据收集 * 完成TF发布 * 修改模型方向,在yaml中添加变换属性 * 添加物料tf变化时,发送topic到前端 另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题 * 添加关节发布节点与物料可视化节点进入unilab * 使用json启动plr与3D模型仿真 * 完成启动OT并联动rviz * 修复rviz位置问题, 修复rviz位置问题, 在无tf变动时减缓发送频率 在backend中添加物料跟随方法 * fix: running logic * fix: running logic * fix: missing ot * 在main中直接初始化republisher和物料的mesh节点 * 将joint_republisher和resource_mesh_manager添加进 main_slave_run.py中 --------- Co-authored-by: zhangshixiang <@zhangshixiang> Co-authored-by: wznln <18435084+Xuwznln@users.noreply.github.com> * fix: missing hostname in devices_names fix: upload_file for model file * fix: missing paho-mqtt package bump version to 0.9.0 * fix startup add ResourceCreateFromOuter.action * fix type hint * update actions * update actions * host node add_resource_from_outer fix cmake list * pass device config to device class * add: bind_parent_ids to resource create action fix: message convert string * fix: host node should not be re_discovered * feat: resource tracker support dict * feat: add more necessary params * feat: fix boolean null in registry action data * feat: add outer resource * 编写mesh添加action * feat: append resource * add action * feat: vis 2d for plr * fix * fix: browser on rviz * fix: cloud bridge error fallback to local * fix: salve auto run rviz * 初始化两个plate * Device visualization (#22) * add 3d visualization * 完成在main中启动设备可视化 完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model 添加物料模型管理类,遍历物料与resource_model,完成TF数据收集 * 完成TF发布 * 修改模型方向,在yaml中添加变换属性 * 添加物料tf变化时,发送topic到前端 另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题 * 添加关节发布节点与物料可视化节点进入unilab * 使用json启动plr与3D模型仿真 * 完成启动OT并联动rviz * add 3d visualization * 完成在main中启动设备可视化 完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model 添加物料模型管理类,遍历物料与resource_model,完成TF数据收集 * 完成TF发布 * 修改模型方向,在yaml中添加变换属性 * 添加物料tf变化时,发送topic到前端 另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题 * 添加关节发布节点与物料可视化节点进入unilab * 使用json启动plr与3D模型仿真 * 完成启动OT并联动rviz * 修复rviz位置问题, 修复rviz位置问题, 在无tf变动时减缓发送频率 在backend中添加物料跟随方法 * fix: running logic * fix: running logic * fix: missing ot * 在main中直接初始化republisher和物料的mesh节点 * 将joint_republisher和resource_mesh_manager添加进 main_slave_run.py中 * 编写mesh添加action * add action * fix * fix: browser on rviz * fix: cloud bridge error fallback to local * fix: salve auto run rviz * 初始化两个plate --------- Co-authored-by: zhangshixiang <@zhangshixiang> Co-authored-by: wznln <18435084+Xuwznln@users.noreply.github.com> * fix: multi channel * fix: aspirate * fix: aspirate * fix: aspirate * fix: aspirate * 提交 * fix: jobadd * fix: jobadd * fix: msg converter * tijiao * add resource creat easy action * identify debug msg * mq client id --------- Co-authored-by: Harvey Que <Q-Query@outlook.com> Co-authored-by: zhangshixiang <@zhangshixiang> Co-authored-by: q434343 <73513873+q434343@users.noreply.github.com> * remove default behavior for visualization * change liquidhandler name * resource create from outer easy * add easy resource creation * easy resource creation logic * remove wrongly debug msg from others * remove wrongly debug msg from others * add missing action clients * fix device_id * fix slot_on_deck * fix registry typo * complete require packages msg converter support array string implements create resource logic * 修复port输入 * fix: remove dirty actions --------- Co-authored-by: Junhan Chang <changjh@pku.edu.cn> Co-authored-by: Harvey Que <Q-Query@outlook.com> Co-authored-by: q434343 <73513873+q434343@users.noreply.github.com>
1 parent e38c0ec commit 18709ce

29 files changed

+276
-223
lines changed

test/commands/resource_add.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
使用plr_test.json启动,将Well加入Plate中
22

33
```bash
4-
ros2 action send_goal /devices/host_node/add_resource_from_outer unilabos_msgs/action/_resource_create_from_outer/ResourceCreateFromOuter "{ resources: [ { 'category': '', 'children': [], 'config': { 'type': 'Well', 'size_x': 6.86, 'size_y': 6.86, 'size_z': 10.67, 'rotation': { 'x': 0, 'y': 0, 'z': 0, 'type': 'Rotation' }, 'category': 'well', 'model': null, 'max_volume': 360, 'material_z_thickness': 0.5, 'compute_volume_from_height': null, 'compute_height_from_volume': null, 'bottom_type': 'flat', 'cross_section_type': 'circle' }, 'data': { 'liquids': [], 'pending_liquids': [], 'liquid_history': [] }, 'id': 'plate_well_11_7', 'name': 'plate_well_11_7', 'pose': { 'orientation': { 'w': 1.0, 'x': 0.0, 'y': 0.0, 'z': 0.0 }, 'position': { 'x': 0.0, 'y': 0.0, 'z': 0.0 } }, 'sample_id': '', 'parent': 'plate', 'type': 'device' } ], device_ids: [ 'PLR_STATION' ], bind_parent_ids: [ 'plate' ], bind_locations: [ { 'x': 0.0, 'y': 0.0, 'z': 0.0 } ], other_calling_params: [ '{}' ] }"
4+
ros2 action send_goal /devices/host_node/create_resource_detailed unilabos_msgs/action/_resource_create_from_outer/ResourceCreateFromOuter "{ resources: [ { 'category': '', 'children': [], 'config': { 'type': 'Well', 'size_x': 6.86, 'size_y': 6.86, 'size_z': 10.67, 'rotation': { 'x': 0, 'y': 0, 'z': 0, 'type': 'Rotation' }, 'category': 'well', 'model': null, 'max_volume': 360, 'material_z_thickness': 0.5, 'compute_volume_from_height': null, 'compute_height_from_volume': null, 'bottom_type': 'flat', 'cross_section_type': 'circle' }, 'data': { 'liquids': [], 'pending_liquids': [], 'liquid_history': [] }, 'id': 'plate_well_11_7', 'name': 'plate_well_11_7', 'pose': { 'orientation': { 'w': 1.0, 'x': 0.0, 'y': 0.0, 'z': 0.0 }, 'position': { 'x': 0.0, 'y': 0.0, 'z': 0.0 } }, 'sample_id': '', 'parent': 'plate', 'type': 'device' } ], device_ids: [ 'PLR_STATION' ], bind_parent_ids: [ 'plate' ], bind_locations: [ { 'x': 0.0, 'y': 0.0, 'z': 0.0 } ], other_calling_params: [ '{}' ] }"
55
```

unilabos-linux-64.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ dependencies:
5656
- ros-humble-moveit-servo
5757
# simulation
5858
- ros-humble-simulation
59+
- ros-humble-tf-transformations
60+
- transforms3d
5961
# ros-humble-gazebo-ros // ignored because of the conflict with ign-gazebo
6062
# ilab equipments
6163
# - ros-humble-unilabos-msgs

unilabos-osx-64.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ dependencies:
5656
# - ros-humble-moveit-servo
5757
# simulation
5858
- ros-humble-simulation
59+
- ros-humble-tf-transformations
60+
- transforms3d
5961
# ros-humble-gazebo-ros // ignored because of the conflict with ign-gazebo
6062
# ilab equipments
6163
# - ros-humble-unilabos-msgs

unilabos-osx-arm64.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ dependencies:
5858
- ros-humble-moveit-servo
5959
# simulation
6060
- ros-humble-simulation
61+
- ros-humble-tf-transformations
62+
- transforms3d
6163
# ros-humble-gazebo-ros // ignored because of the conflict with ign-gazebo
6264
# ilab equipments
6365
# - ros-humble-unilabos-msgs

unilabos-win64.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ dependencies:
5656
- ros-humble-moveit-servo
5757
# simulation
5858
- ros-humble-simulation # ignored because of NO python3.11 package in WIN64
59+
- ros-humble-tf-transformations
60+
- transforms3d
5961
# ros-humble-gazebo-ros // ignored because of the conflict with ign-gazebo
6062
# ilab equipments
6163
# ros-humble-unilabos-msgs

unilabos/app/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
from unilabos.config.config import load_config, BasicConfig, _update_config_from_env
2020
from unilabos.utils.banner_print import print_status, print_unilab_banner
21-
from unilabos.device_mesh.resource_visalization import ResourceVisualization
2221

2322

2423
def parse_args():
@@ -188,11 +187,12 @@ def _exit(signum, frame):
188187
if args_dict["visual"] != "disable":
189188
enable_rviz = args_dict["visual"] == "rviz"
190189
if devices_and_resources is not None:
190+
from unilabos.device_mesh.resource_visalization import ResourceVisualization # 此处开启后,logger会变更为INFO,有需要请调整
191191
resource_visualization = ResourceVisualization(devices_and_resources, args_dict["resources_config"] ,enable_rviz=enable_rviz)
192192
args_dict["resources_mesh_config"] = resource_visualization.resource_model
193193
start_backend(**args_dict)
194194
server_thread = threading.Thread(target=start_server, kwargs=dict(
195-
open_browser=not args_dict["disable_browser"]
195+
open_browser=not args_dict["disable_browser"], port=args_dict["port"],
196196
))
197197
server_thread.start()
198198
asyncio.set_event_loop(asyncio.new_event_loop())
@@ -201,10 +201,10 @@ def _exit(signum, frame):
201201
time.sleep(1)
202202
else:
203203
start_backend(**args_dict)
204-
start_server(open_browser=not args_dict["disable_browser"])
204+
start_server(open_browser=not args_dict["disable_browser"], port=args_dict["port"],)
205205
else:
206206
start_backend(**args_dict)
207-
start_server(open_browser=not args_dict["disable_browser"])
207+
start_server(open_browser=not args_dict["disable_browser"], port=args_dict["port"],)
208208

209209

210210
if __name__ == "__main__":

unilabos/app/mq.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class MQTTClient:
2626
def __init__(self):
2727
self.mqtt_disable = not MQConfig.lab_id
2828
self.client_id = f"{MQConfig.group_id}@@@{MQConfig.lab_id}{uuid.uuid4()}"
29+
logger.info("[MQTT] Client_id: " + self.client_id)
2930
self.client = mqtt.Client(CallbackAPIVersion.VERSION2, client_id=self.client_id, protocol=mqtt.MQTTv5)
3031
self._setup_callbacks()
3132

@@ -52,10 +53,7 @@ def _on_message(self, client, userdata, msg) -> None:
5253
try:
5354
payload_str = msg.payload.decode("utf-8")
5455
payload_json = json.loads(payload_str)
55-
logger.debug(f"Topic: {msg.topic}")
56-
logger.debug("Payload:", json.dumps(payload_json, indent=2, ensure_ascii=False))
5756
if msg.topic == f"labs/{MQConfig.lab_id}/job/start/":
58-
logger.debug("job_add", type(payload_json), payload_json)
5957
if "data" not in payload_json:
6058
payload_json["data"] = {}
6159
if "action" in payload_json:

unilabos/devices/laiyu_add_solid/__init__.py

Whitespace-only changes.

unilabos/devices/liquid_handling/action_definition.py renamed to unilabos/devices/liquid_handling/liquid_handler_abstract.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
Well
1515
)
1616

17-
class DPLiquidHandler(LiquidHandler):
17+
class LiquidHandlerAbstract(LiquidHandler):
1818
"""Extended LiquidHandler with additional operations."""
1919

2020
# ---------------------------------------------------------------

unilabos/registry/devices/liquid_handler.yaml

Lines changed: 86 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,96 @@
11
liquid_handler:
22
description: Liquid handler device controlled by pylabrobot
33
class:
4-
module: pylabrobot.liquid_handling:LiquidHandler
4+
module: unilabos.devices.liquid_handling.liquid_handler_abstract:LiquidHandlerAbstract
55
type: python
66
status_types:
77
name: String
88
action_value_mappings:
9+
remove:
10+
type: LiquidHandlerRemove
11+
goal:
12+
vols: vols
13+
sources: sources
14+
waste_liquid: waste_liquid
15+
use_channels: use_channels
16+
flow_rates: flow_rates
17+
offsets: offsets
18+
liquid_height: liquid_height
19+
blow_out_air_volume: blow_out_air_volume
20+
spread: spread
21+
delays: delays
22+
is_96_well: is_96_well
23+
top: top
24+
none_keys: none_keys
25+
feedback: { }
26+
result: { }
27+
add_liquid:
28+
type: LiquidHandlerAdd
29+
goal:
30+
asp_vols: asp_vols
31+
dis_vols: dis_vols
32+
reagent_sources: reagent_sources
33+
targets: targets
34+
use_channels: use_channels
35+
flow_rates: flow_rates
36+
offsets: offsets
37+
liquid_height: liquid_height
38+
blow_out_air_volume: blow_out_air_volume
39+
spread: spread
40+
is_96_well: is_96_well
41+
mix_time: mix_time
42+
mix_vol: mix_vol
43+
mix_rate: mix_rate
44+
mix_liquid_height: mix_liquid_height
45+
none_keys: none_keys
46+
feedback: { }
47+
result: { }
48+
transfer_liquid:
49+
type: LiquidHandlerTransfer
50+
goal:
51+
asp_vols: asp_vols
52+
dis_vols: dis_vols
53+
sources: sources
54+
targets: targets
55+
tip_racks: tip_racks
56+
use_channels: use_channels
57+
asp_flow_rates: asp_flow_rates
58+
dis_flow_rates: dis_flow_rates
59+
offsets: offsets
60+
touch_tip: touch_tip
61+
liquid_height: liquid_height
62+
blow_out_air_volume: blow_out_air_volume
63+
spread: spread
64+
is_96_well: is_96_well
65+
mix_stage: mix_stage
66+
mix_times: mix_times
67+
mix_vol: mix_vol
68+
mix_rate: mix_rate
69+
mix_liquid_height: mix_liquid_height
70+
delays: delays
71+
none_keys: none_keys
72+
feedback: { }
73+
result: { }
74+
mix:
75+
type: LiquidHandlerMix
76+
goal:
77+
targets: targets
78+
mix_time: mix_time
79+
mix_vol: mix_vol
80+
height_to_bottom: height_to_bottom
81+
offsets: offsets
82+
mix_rate: mix_rate
83+
none_keys: none_keys
84+
feedback: { }
85+
result: { }
86+
move_to:
87+
type: LiquidHandlerMoveTo
88+
goal:
89+
well: well
90+
dis_to_top: dis_to_top
91+
channel: channel
92+
feedback: { }
93+
result: { }
994
aspirate:
1095
type: LiquidHandlerAspirate
1196
goal:
@@ -170,127 +255,6 @@ liquid_handler:
170255
- name
171256
additionalProperties: false
172257

173-
dp_liquid_handler:
174-
description: 通用液体处理
175-
class:
176-
module: unilabos.devices.liquid_handling.action_definition:DPLiquidHandler
177-
type: python
178-
status_types:
179-
status: String
180-
action_value_mappings:
181-
remove_liquid:
182-
type: DPLiquidHandlerRemoveLiquid
183-
goal:
184-
vols: vols
185-
sources: sources
186-
waste_liquid: waste_liquid
187-
use_channels: use_channels
188-
flow_rates: flow_rates
189-
offsets: offsets
190-
liquid_height: liquid_height
191-
blow_out_air_volume: blow_out_air_volume
192-
spread: spread
193-
delays: delays
194-
is_96_well: is_96_well
195-
top: top
196-
none_keys: none_keys
197-
feedback: {}
198-
result: {}
199-
add_liquid:
200-
type: DPLiquidHandlerAddLiquid
201-
goal:
202-
asp_vols: asp_vols
203-
dis_vols: dis_vols
204-
reagent_sources: reagent_sources
205-
targets: targets
206-
use_channels: use_channels
207-
flow_rates: flow_rates
208-
offsets: offsets
209-
liquid_height: liquid_height
210-
blow_out_air_volume: blow_out_air_volume
211-
spread: spread
212-
is_96_well: is_96_well
213-
mix_time: mix_time
214-
mix_vol: mix_vol
215-
mix_rate: mix_rate
216-
mix_liquid_height: mix_liquid_height
217-
none_keys: none_keys
218-
feedback: {}
219-
result: {}
220-
transfer_liquid:
221-
type: DPLiquidHandlerTransferLiquid
222-
goal:
223-
asp_vols: asp_vols
224-
dis_vols: dis_vols
225-
sources: sources
226-
targets: targets
227-
tip_racks: tip_racks
228-
use_channels: use_channels
229-
asp_flow_rates: asp_flow_rates
230-
dis_flow_rates: dis_flow_rates
231-
offsets: offsets
232-
touch_tip: touch_tip
233-
liquid_height: liquid_height
234-
blow_out_air_volume: blow_out_air_volume
235-
spread: spread
236-
is_96_well: is_96_well
237-
mix_stage: mix_stage
238-
mix_times: mix_times
239-
mix_vol: mix_vol
240-
mix_rate: mix_rate
241-
mix_liquid_height: mix_liquid_height
242-
delays: delays
243-
none_keys: none_keys
244-
feedback: {}
245-
result: {}
246-
custom_delay:
247-
type: DPLiquidHandlerCustomDelay
248-
goal:
249-
seconds: seconds
250-
msg: msg
251-
feedback: {}
252-
result: {}
253-
touch_tip:
254-
type: DPLiquidHandlerTouchTip
255-
goal:
256-
targets: targets
257-
feedback: {}
258-
result: {}
259-
mix:
260-
type: DPLiquidHandlerMix
261-
goal:
262-
targets: targets
263-
mix_time: mix_time
264-
mix_vol: mix_vol
265-
height_to_bottom: height_to_bottom
266-
offsets: offsets
267-
mix_rate: mix_rate
268-
none_keys: none_keys
269-
feedback: {}
270-
result: {}
271-
set_tiprack:
272-
type: DPLiquidHandlerSetTiprack
273-
goal:
274-
tip_racks: tip_racks
275-
feedback: {}
276-
result: {}
277-
move_to:
278-
type: DPLiquidHandlerMoveTo
279-
goal:
280-
well: well
281-
dis_to_top: dis_to_top
282-
channel: channel
283-
feedback: {}
284-
result: {}
285-
schema:
286-
type: object
287-
properties:
288-
name:
289-
type: string
290-
description: 物料名
291-
required:
292-
- name
293-
294258
liquid_handler.revvity:
295259
class:
296260
module: unilabos.devices.liquid_handling.revvity:Revvity

0 commit comments

Comments
 (0)