调整传感器位置
This commit is contained in:
@@ -136,6 +136,31 @@ def test_returning_to_zero_moves_the_five_axes_together():
|
||||
assert all(step.target == 0.0 for step in plan.steps)
|
||||
|
||||
|
||||
def test_return_to_initial_can_park_y_forward():
|
||||
service = make_service()
|
||||
plan = plan_return_to_initial(service, x_mm=-1.0, y_mm=15.0)
|
||||
targets = {step.role: step.target for step in plan.steps}
|
||||
assert targets == {"yaw": 0.0, "pitch": 0.0, "x": -1.0, "y": 15.0, "z": 0.0}
|
||||
|
||||
|
||||
def test_pitch_positive_direction_matches_the_drive():
|
||||
service = make_service()
|
||||
pitch = ROLES["pitch"]
|
||||
yaw = ROLES["yaw"]
|
||||
seen: list[bool] = []
|
||||
service.transport.jog = lambda axis, forward: seen.append((axis, forward)) # type: ignore[method-assign]
|
||||
|
||||
assert service.jog(pitch, True).ok
|
||||
assert seen == [(pitch, True)]
|
||||
assert service.move_rel(pitch, 90.0).ok
|
||||
assert service.move_rel(yaw, 90.0).ok
|
||||
assert service.transport.get_dpos(pitch) == pytest.approx(90.0)
|
||||
assert service.transport.get_dpos(yaw) == pytest.approx(90.0)
|
||||
snapshot = service.poll()
|
||||
assert snapshot.axis(pitch).dpos == pytest.approx(90.0)
|
||||
assert snapshot.axis(yaw).dpos == pytest.approx(90.0)
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------- guards
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user