Skip to content

Commit 2c0bfba

Browse files
committed
add test to hardware tests
1 parent 412d10c commit 2c0bfba

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

hardware/tests/opentrons_hardware/hardware_control/test_motion_plan.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,3 +267,38 @@ def test_pipette_high_speed_motion() -> None:
267267
top_set_axis_speed = unit_vector[set_axis_kind] * block.final_speed
268268
if top_set_axis_speed != 0:
269269
assert abs(top_set_axis_speed) == dummy_em_pipette_max_speed
270+
271+
@given(
272+
x_constraint=generate_axis_constraint(),
273+
y_constraint=generate_axis_constraint(),
274+
z_constraint=generate_axis_constraint(),
275+
a_constraint=generate_axis_constraint(),
276+
b_constraint=generate_axis_constraint(),
277+
c_constraint=generate_axis_constraint(),
278+
)
279+
async def test_plunger_devectorize(
280+
x_constraint: AxisConstraints,
281+
y_constraint: AxisConstraints,
282+
z_constraint: AxisConstraints,
283+
a_constraint: AxisConstraints,
284+
b_constraint: AxisConstraints,
285+
c_constraint: AxisConstraints,
286+
) -> None:
287+
constraints: SystemConstraints[str] = {
288+
"X": x_constraint,
289+
"Y": y_constraint,
290+
"Z": z_constraint,
291+
"A": a_constraint,
292+
"B": b_constraint,
293+
"C": c_constraint,
294+
}
295+
manager = move_manager.MoveManager(constraints=constraints)
296+
origin = {"X": 0, "Y": 0, "Z": 0, "A": 0}
297+
target = {"X": 10, "Y": 10, "Z": 10, "A": 10}
298+
speed = 10
299+
all_vectored = MoveTarget.build(position=target, max_speed=speed)
300+
devectorized = manager.devectorize_axes(origin, target, speed, ["A"])
301+
assert devectorized.max_speed > all_vectored.max_speed
302+
assert devectorized.max_speed == 20
303+
304+

0 commit comments

Comments
 (0)