Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(api): only send moves to moving axes, unless specified otherwise #13933

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion api/src/opentrons/hardware_control/backends/ot3controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,18 +535,32 @@ async def move(
origin: Coordinates[Axis, float],
moves: List[Move[Axis]],
stop_condition: MoveStopCondition = MoveStopCondition.none,
nodes_in_moves_only: bool = True,
) -> None:
"""Move to a position.

Args:
origin: The starting point of the move
moves: List of moves.
stop_condition: The stop condition.
nodes_in_moves_only: Default is True. If False, also send empty moves to
nodes that are present but not defined in moves.

.. caution::
Setting `nodes_in_moves_only` to False will enable *all* present motors in
the system. DO NOT USE when you want to keep one of the axes disabled.

Returns:
None
"""
group = create_move_group(origin, moves, self._motor_nodes(), stop_condition)
ordered_nodes = self._motor_nodes()
if nodes_in_moves_only:
moving_axes = {
axis_to_node(ax) for move in moves for ax in move.unit_vector.keys()
}
ordered_nodes = ordered_nodes.intersection(moving_axes)

group = create_move_group(origin, moves, ordered_nodes, stop_condition)
move_group, _ = group
runner = MoveGroupRunner(
move_groups=[move_group],
Expand Down