From 83c765f0ab7ecb60a0374827aa5df3b02a6cef13 Mon Sep 17 00:00:00 2001 From: Junhan Chang Date: Wed, 14 May 2025 22:14:14 +0800 Subject: [PATCH] unify liquid_handler definition --- ...finition.py => liquid_handler_abstract.py} | 2 +- unilabos/registry/devices/liquid_handler.yaml | 192 ++++++++---------- unilabos_msgs/CMakeLists.txt | 12 +- .../action/DPLiquidHandlerCustomDelay.action | 6 - .../action/DPLiquidHandlerSetTiprack.action | 5 - .../action/DPLiquidHandlerTouchTip.action | 5 - .../DPLiquidHandlerTransferLiquid.action | 25 --- ...dLiquid.action => LiquidHandlerAdd.action} | 0 ...dlerMix.action => LiquidHandlerMix.action} | 0 ...veTo.action => LiquidHandlerMoveTo.action} | 0 ...quid.action => LiquidHandlerRemove.action} | 0 .../action/LiquidHandlerTransfer.action | 30 ++- 12 files changed, 114 insertions(+), 163 deletions(-) rename unilabos/devices/liquid_handling/{action_definition.py => liquid_handler_abstract.py} (99%) delete mode 100644 unilabos_msgs/action/DPLiquidHandlerCustomDelay.action delete mode 100644 unilabos_msgs/action/DPLiquidHandlerSetTiprack.action delete mode 100644 unilabos_msgs/action/DPLiquidHandlerTouchTip.action delete mode 100644 unilabos_msgs/action/DPLiquidHandlerTransferLiquid.action rename unilabos_msgs/action/{DPLiquidHandlerAddLiquid.action => LiquidHandlerAdd.action} (100%) rename unilabos_msgs/action/{DPLiquidHandlerMix.action => LiquidHandlerMix.action} (100%) rename unilabos_msgs/action/{DPLiquidHandlerMoveTo.action => LiquidHandlerMoveTo.action} (100%) rename unilabos_msgs/action/{DPLiquidHandlerRemoveLiquid.action => LiquidHandlerRemove.action} (100%) diff --git a/unilabos/devices/liquid_handling/action_definition.py b/unilabos/devices/liquid_handling/liquid_handler_abstract.py similarity index 99% rename from unilabos/devices/liquid_handling/action_definition.py rename to unilabos/devices/liquid_handling/liquid_handler_abstract.py index 530703ad..c349403e 100644 --- a/unilabos/devices/liquid_handling/action_definition.py +++ b/unilabos/devices/liquid_handling/liquid_handler_abstract.py @@ -14,7 +14,7 @@ from pylabrobot.resources import ( Well ) -class DPLiquidHandler(LiquidHandler): +class LiquidHandlerAbstract(LiquidHandler): """Extended LiquidHandler with additional operations.""" # --------------------------------------------------------------- diff --git a/unilabos/registry/devices/liquid_handler.yaml b/unilabos/registry/devices/liquid_handler.yaml index ba921c77..2bf975de 100644 --- a/unilabos/registry/devices/liquid_handler.yaml +++ b/unilabos/registry/devices/liquid_handler.yaml @@ -1,11 +1,96 @@ liquid_handler: description: Liquid handler device controlled by pylabrobot class: - module: pylabrobot.liquid_handling:LiquidHandler + module: unilabos.devices.liquid_handling.liquid_handler_abstract:LiquidHandlerAbstract type: python status_types: name: String action_value_mappings: + remove: + type: LiquidHandlerRemove + goal: + vols: vols + sources: sources + waste_liquid: waste_liquid + use_channels: use_channels + flow_rates: flow_rates + offsets: offsets + liquid_height: liquid_height + blow_out_air_volume: blow_out_air_volume + spread: spread + delays: delays + is_96_well: is_96_well + top: top + none_keys: none_keys + feedback: { } + result: { } + add_liquid: + type: LiquidHandlerAdd + goal: + asp_vols: asp_vols + dis_vols: dis_vols + reagent_sources: reagent_sources + targets: targets + use_channels: use_channels + flow_rates: flow_rates + offsets: offsets + liquid_height: liquid_height + blow_out_air_volume: blow_out_air_volume + spread: spread + is_96_well: is_96_well + mix_time: mix_time + mix_vol: mix_vol + mix_rate: mix_rate + mix_liquid_height: mix_liquid_height + none_keys: none_keys + feedback: { } + result: { } + transfer_liquid: + type: LiquidHandlerTransfer + goal: + asp_vols: asp_vols + dis_vols: dis_vols + sources: sources + targets: targets + tip_racks: tip_racks + use_channels: use_channels + asp_flow_rates: asp_flow_rates + dis_flow_rates: dis_flow_rates + offsets: offsets + touch_tip: touch_tip + liquid_height: liquid_height + blow_out_air_volume: blow_out_air_volume + spread: spread + is_96_well: is_96_well + mix_stage: mix_stage + mix_times: mix_times + mix_vol: mix_vol + mix_rate: mix_rate + mix_liquid_height: mix_liquid_height + delays: delays + none_keys: none_keys + feedback: { } + result: { } + mix: + type: DPLiquidHandlerMix + goal: + targets: targets + mix_time: mix_time + mix_vol: mix_vol + height_to_bottom: height_to_bottom + offsets: offsets + mix_rate: mix_rate + none_keys: none_keys + feedback: { } + result: { } + move_to: + type: LiquidHandlerMoveTo + goal: + well: well + dis_to_top: dis_to_top + channel: channel + feedback: { } + result: { } aspirate: type: LiquidHandlerAspirate goal: @@ -178,110 +263,7 @@ dp_liquid_handler: status_types: status: String action_value_mappings: - remove_liquid: - type: DPLiquidHandlerRemoveLiquid - goal: - vols: vols - sources: sources - waste_liquid: waste_liquid - use_channels: use_channels - flow_rates: flow_rates - offsets: offsets - liquid_height: liquid_height - blow_out_air_volume: blow_out_air_volume - spread: spread - delays: delays - is_96_well: is_96_well - top: top - none_keys: none_keys - feedback: {} - result: {} - add_liquid: - type: DPLiquidHandlerAddLiquid - goal: - asp_vols: asp_vols - dis_vols: dis_vols - reagent_sources: reagent_sources - targets: targets - use_channels: use_channels - flow_rates: flow_rates - offsets: offsets - liquid_height: liquid_height - blow_out_air_volume: blow_out_air_volume - spread: spread - is_96_well: is_96_well - mix_time: mix_time - mix_vol: mix_vol - mix_rate: mix_rate - mix_liquid_height: mix_liquid_height - none_keys: none_keys - feedback: {} - result: {} - transfer_liquid: - type: DPLiquidHandlerTransferLiquid - goal: - asp_vols: asp_vols - dis_vols: dis_vols - sources: sources - targets: targets - tip_racks: tip_racks - use_channels: use_channels - asp_flow_rates: asp_flow_rates - dis_flow_rates: dis_flow_rates - offsets: offsets - touch_tip: touch_tip - liquid_height: liquid_height - blow_out_air_volume: blow_out_air_volume - spread: spread - is_96_well: is_96_well - mix_stage: mix_stage - mix_times: mix_times - mix_vol: mix_vol - mix_rate: mix_rate - mix_liquid_height: mix_liquid_height - delays: delays - none_keys: none_keys - feedback: {} - result: {} - custom_delay: - type: DPLiquidHandlerCustomDelay - goal: - seconds: seconds - msg: msg - feedback: {} - result: {} - touch_tip: - type: DPLiquidHandlerTouchTip - goal: - targets: targets - feedback: {} - result: {} - mix: - type: DPLiquidHandlerMix - goal: - targets: targets - mix_time: mix_time - mix_vol: mix_vol - height_to_bottom: height_to_bottom - offsets: offsets - mix_rate: mix_rate - none_keys: none_keys - feedback: {} - result: {} - set_tiprack: - type: DPLiquidHandlerSetTiprack - goal: - tip_racks: tip_racks - feedback: {} - result: {} - move_to: - type: DPLiquidHandlerMoveTo - goal: - well: well - dis_to_top: dis_to_top - channel: channel - feedback: {} - result: {} + schema: type: object properties: diff --git a/unilabos_msgs/CMakeLists.txt b/unilabos_msgs/CMakeLists.txt index 69fbaa3a..49406931 100644 --- a/unilabos_msgs/CMakeLists.txt +++ b/unilabos_msgs/CMakeLists.txt @@ -43,14 +43,10 @@ set(action_files "action/LiquidHandlerStamp.action" "action/LiquidHandlerTransfer.action" - "action/DPLiquidHandlerAddLiquid.action" - "action/DPLiquidHandlerCustomDelay.action" - "action/DPLiquidHandlerMix.action" - "action/DPLiquidHandlerMoveTo.action" - "action/DPLiquidHandlerRemoveLiquid.action" - "action/DPLiquidHandlerSetTiprack.action" - "action/DPLiquidHandlerTouchTip.action" - "action/DPLiquidHandlerTransferLiquid.action" + "action/LiquidHandlerAdd.action" + "action/LiquidHandlerMix.action" + "action/LiquidHandlerMoveTo.action" + "action/LiquidHandlerRemove.action" "action/EmptyIn.action" "action/FloatSingleInput.action" diff --git a/unilabos_msgs/action/DPLiquidHandlerCustomDelay.action b/unilabos_msgs/action/DPLiquidHandlerCustomDelay.action deleted file mode 100644 index 29f9b45b..00000000 --- a/unilabos_msgs/action/DPLiquidHandlerCustomDelay.action +++ /dev/null @@ -1,6 +0,0 @@ -float64 seconds -string msg ---- -bool success ---- -# 反馈 \ No newline at end of file diff --git a/unilabos_msgs/action/DPLiquidHandlerSetTiprack.action b/unilabos_msgs/action/DPLiquidHandlerSetTiprack.action deleted file mode 100644 index 437d3e3f..00000000 --- a/unilabos_msgs/action/DPLiquidHandlerSetTiprack.action +++ /dev/null @@ -1,5 +0,0 @@ -Resource[] tip_racks ---- -bool success ---- -# 反馈 \ No newline at end of file diff --git a/unilabos_msgs/action/DPLiquidHandlerTouchTip.action b/unilabos_msgs/action/DPLiquidHandlerTouchTip.action deleted file mode 100644 index e0c31046..00000000 --- a/unilabos_msgs/action/DPLiquidHandlerTouchTip.action +++ /dev/null @@ -1,5 +0,0 @@ -Resource[] targets ---- -bool success ---- -# 反馈 \ No newline at end of file diff --git a/unilabos_msgs/action/DPLiquidHandlerTransferLiquid.action b/unilabos_msgs/action/DPLiquidHandlerTransferLiquid.action deleted file mode 100644 index 39df59bb..00000000 --- a/unilabos_msgs/action/DPLiquidHandlerTransferLiquid.action +++ /dev/null @@ -1,25 +0,0 @@ -float64[] asp_vols -float64[] dis_vols -Resource[] sources -Resource[] targets -Resource[] tip_racks -int32[] use_channels -float64[] asp_flow_rates -float64[] dis_flow_rates -geometry_msgs/Point[] offsets -bool touch_tip -float64[] liquid_height -float64[] blow_out_air_volume -string spread -bool is_96_well -string mix_stage -int32[] mix_times -int32 mix_vol -int32 mix_rate -float64 mix_liquid_height -int32[] delays -string[] none_keys ---- -bool success ---- -# 反馈 \ No newline at end of file diff --git a/unilabos_msgs/action/DPLiquidHandlerAddLiquid.action b/unilabos_msgs/action/LiquidHandlerAdd.action similarity index 100% rename from unilabos_msgs/action/DPLiquidHandlerAddLiquid.action rename to unilabos_msgs/action/LiquidHandlerAdd.action diff --git a/unilabos_msgs/action/DPLiquidHandlerMix.action b/unilabos_msgs/action/LiquidHandlerMix.action similarity index 100% rename from unilabos_msgs/action/DPLiquidHandlerMix.action rename to unilabos_msgs/action/LiquidHandlerMix.action diff --git a/unilabos_msgs/action/DPLiquidHandlerMoveTo.action b/unilabos_msgs/action/LiquidHandlerMoveTo.action similarity index 100% rename from unilabos_msgs/action/DPLiquidHandlerMoveTo.action rename to unilabos_msgs/action/LiquidHandlerMoveTo.action diff --git a/unilabos_msgs/action/DPLiquidHandlerRemoveLiquid.action b/unilabos_msgs/action/LiquidHandlerRemove.action similarity index 100% rename from unilabos_msgs/action/DPLiquidHandlerRemoveLiquid.action rename to unilabos_msgs/action/LiquidHandlerRemove.action diff --git a/unilabos_msgs/action/LiquidHandlerTransfer.action b/unilabos_msgs/action/LiquidHandlerTransfer.action index b6e3be32..39df59bb 100644 --- a/unilabos_msgs/action/LiquidHandlerTransfer.action +++ b/unilabos_msgs/action/LiquidHandlerTransfer.action @@ -1,11 +1,25 @@ -# Bio -Resource source +float64[] asp_vols +float64[] dis_vols +Resource[] sources Resource[] targets -float64 source_vol -float64[] ratios -float64[] target_vols -float64 aspiration_flow_rate -float64[] dispense_flow_rates +Resource[] tip_racks +int32[] use_channels +float64[] asp_flow_rates +float64[] dis_flow_rates +geometry_msgs/Point[] offsets +bool touch_tip +float64[] liquid_height +float64[] blow_out_air_volume +string spread +bool is_96_well +string mix_stage +int32[] mix_times +int32 mix_vol +int32 mix_rate +float64 mix_liquid_height +int32[] delays +string[] none_keys --- bool success ---- \ No newline at end of file +--- +# 反馈 \ No newline at end of file