Skip to content

Commit 8b8600e

Browse files
author
andy
committed
fix airsensor
1 parent b2b3ac9 commit 8b8600e

File tree

4 files changed

+32
-29
lines changed

4 files changed

+32
-29
lines changed

devices/amsamotion_sensor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ def get_distance_multi(self, device_addr: int, channel_num=8) -> dict:
4949
else:
5050
# use serial driver
5151
ret = self.serial.read_buffer()
52-
ret = ret.split('\r\n')[1]
52+
ret = ret.split('\r\n')
53+
ret = ret[1]
5354

5455
for index, item in enumerate(ret.split(',')):
5556
multi_value.update({index: (float(item.split(':')[1].strip()) / 1000)})

devices/sanliang.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ def clear(self):
4444

4545
if __name__ == '__main__':
4646
s = SanLiang()
47-
ret = s.read_distance_n_times(5)
48-
print(ret)
47+
# ret = s.read_distance_n_times(5)
48+
# print(ret)
4949
# s.clear()

ot3_testing/test_config/pipette_leveling_config.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,30 @@ class CalibrateMethod(enum.Enum):
77
Dichotomy = "dichotomy"
88

99

10-
SlotLocationCH96 = {"C1-Y": {"Point": Point(223, 203, 318), "compensation": 0.25},
11-
"C3-Y": {"Point": Point(207, 203, 318), "compensation": 0.01},
12-
"A2-Y": {"Point": Point(387, 421, 318), "compensation": 0.26},
13-
"C1-X": {"Point": Point(50, 91, 300), "compensation": 0.30},
14-
"C3-X": {"Point": Point(382, 91, 300), "compensation": 0.27},
15-
"A2-X": {"Point": Point(213, 305, 300), "compensation": 0.3},
16-
"D1-Z": {"Point": Point(51, 99, 318), "compensation": 0.5},
10+
SlotLocationCH96 = {"C1-Y": {"Point": Point(223, 203, 318), "compensation": 0.0},
11+
"C3-Y": {"Point": Point(207, 203, 318), "compensation": 0.0},
12+
"A2-Y": {"Point": Point(387, 421, 318), "compensation": 0.0},
13+
"C1-X": {"Point": Point(50, 91, 300), "compensation": 0.0},
14+
"C3-X": {"Point": Point(382, 91, 300), "compensation": 0.0},
15+
"A2-X": {"Point": Point(213, 305, 300), "compensation": 0.0},
16+
"D1-Z": {"Point": Point(51, 99, 318), "compensation": 0.0},
1717
# "B2-Z": Point(213, 324, 317),
18-
"D3-Z": {"Point": Point(377, 99, 318), "compensation": 0.44},
19-
"C2-Z": {"Point": Point(214, 210, 318), "compensation": 0.46},
20-
"A2-Z": {"Point": Point(218, 424, 390.5), "compensation": 0.31},
18+
"D3-Z": {"Point": Point(377, 99, 318), "compensation": 0.0},
19+
"C2-Z": {"Point": Point(214, 210, 318), "compensation": 0.0},
20+
"A2-Z": {"Point": Point(218, 424, 390.5), "compensation": 0.0},
2121
"UninstallPos": {"Point": Point(223, 203, 500)}
2222
}
2323

24-
ChannelDefinitionCH96 = {"left_front": {"device_addr": 1, "channel": 4, "offset": 0},
25-
"left_rear": {"device_addr": 1, "channel": 5, "offset": 0},
26-
"right_front": {"device_addr": 1, "channel": 3, "offset": 0},
27-
"right_rear": {"device_addr": 1, "channel": 2, "offset": 0},
28-
"rear_right": {"device_addr": 1, "channel": 0, "offset": 0},
29-
"rear_left": {"device_addr": 1, "channel": 1, "offset": 0},
30-
"below_front_left": {"device_addr": 2, "channel": 1, "offset": 0},
31-
"below_front_right": {"device_addr": 2, "channel": 0, "offset": 0},
32-
"below_rear_left": {"device_addr": 2, "channel": 3, "offset": 0},
33-
"below_rear_right": {"device_addr": 2, "channel": 2, "offset": 0},
24+
ChannelDefinitionCH96 = {"left_front": {"device_addr": 1, "channel": 0, "offset": 0},
25+
"left_rear": {"device_addr": 1, "channel": 1, "offset": 0},
26+
"right_front": {"device_addr": 1, "channel": 2, "offset": 0},
27+
"right_rear": {"device_addr": 1, "channel": 3, "offset": 0},
28+
"rear_right": {"device_addr": 1, "channel": 5, "offset": 0},
29+
"rear_left": {"device_addr": 1, "channel": 4, "offset": 0},
30+
"below_front_left": {"device_addr": 2, "channel": 8, "offset": 0},
31+
"below_front_right": {"device_addr": 2, "channel": 9, "offset": 0},
32+
"below_rear_left": {"device_addr": 2, "channel": 10, "offset": 0},
33+
"below_rear_right": {"device_addr": 2, "channel": 11, "offset": 0},
3434
}
3535

3636
# device addr are un-useful in ch8

ot3_testing/tests/pipette_leveling.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ async def read_distance_mm_from_code_value(self, code_value: int, get_voltage=Fa
8787
:param get_voltage: return voltage
8888
:return:
8989
"""
90-
if self.test_name == "96ch":
91-
voltage = round(float((code_value / 1600) / 2), 3) # /V
92-
else:
93-
voltage = round(float(code_value), 3)
90+
# if self.test_name == "96ch":
91+
# voltage = round(float((code_value / 1600) / 2), 3) # /V
92+
# else:
93+
voltage = round(float(code_value), 3)
9494
if get_voltage:
9595
return voltage
9696
else:
@@ -317,7 +317,7 @@ async def run_96ch_test(self, flex_name: str, project_path=None):
317317
addr = self.robot_ip
318318
self.initial_api(addr, hc=True)
319319
await self.api.home()
320-
self.init_laser_sensor()
320+
self.init_laser_sensor(send=False)
321321

322322
ret = await self.run_test_slot("Test y-Axis-A2", "A2-Y", ["left_front", "left_rear"], with_cal=DoCalibrate)
323323
test_result.update(ret)
@@ -412,4 +412,6 @@ async def run_96ch_test(self, flex_name: str, project_path=None):
412412

413413

414414
if __name__ == '__main__':
415-
pass
415+
import asyncio
416+
pipette_leveling = PipetteLeveling(SlotLocationCH96, ChannelDefinitionCH96, robot_ip="192.168.6.62")
417+
asyncio.run(pipette_leveling.run_96ch_test(""))

0 commit comments

Comments
 (0)