加入Z轴运行控制,加快五轴运行速度
This commit is contained in:
@@ -31,7 +31,6 @@ from orisys_autocal.motion import (
|
||||
from orisys_autocal.motion.models import AxisState, AxisStatusBits, BusStatus
|
||||
from orisys_autocal.motion.pose_move import (
|
||||
MOVE_ORDER,
|
||||
RETURN_ORDER,
|
||||
PoseMover,
|
||||
SETTLE_DEG,
|
||||
SETTLE_MM,
|
||||
@@ -128,11 +127,12 @@ def test_the_plan_holds_back_what_it_is_not_given():
|
||||
assert "z" in plan.describe()
|
||||
|
||||
|
||||
def test_returning_to_zero_retracts_the_press_axis_first():
|
||||
def test_returning_to_zero_moves_the_five_axes_together():
|
||||
service = make_service()
|
||||
plan = plan_return_to_initial(service)
|
||||
assert [step.role for step in plan.steps] == list(RETURN_ORDER)
|
||||
assert plan.steps[0].role == "z"
|
||||
assert plan.together
|
||||
assert [step.role for step in plan.steps] == ["yaw", "pitch", "x", "y", "z"]
|
||||
assert plan.held == ()
|
||||
assert all(step.target == 0.0 for step in plan.steps)
|
||||
|
||||
|
||||
@@ -262,15 +262,23 @@ def test_an_execute_plan_moves_the_four_axes_together_and_leaves_z():
|
||||
assert mover.state.finished
|
||||
|
||||
|
||||
def test_return_to_zero_stays_one_axis_at_a_time():
|
||||
def test_return_to_zero_is_one_command_for_the_five_axes():
|
||||
service = make_service()
|
||||
called: list[list[tuple[int, float]]] = []
|
||||
|
||||
def record(moves):
|
||||
called.append(list(moves))
|
||||
return MotionResult.success()
|
||||
|
||||
service.move_abs_many = record # type: ignore[method-assign]
|
||||
poller = FakePoller(service)
|
||||
mover = PoseMover(service, poller.submit)
|
||||
plan = plan_return_to_initial(service)
|
||||
assert not plan.together
|
||||
assert mover.start(plan).ok
|
||||
assert len(poller.commands) == 1
|
||||
assert mover.state.step.role == "z"
|
||||
poller.commands[0](service)
|
||||
assert [axis for axis, _value in called[0]] == [3, 2, 0, 1, 4]
|
||||
assert mover.progress_text().startswith("同时")
|
||||
|
||||
|
||||
def test_the_mover_commands_one_axis_and_waits_for_it_to_arrive():
|
||||
|
||||
Reference in New Issue
Block a user