Skip to content

Commit

Permalink
fix(api): only send moves to moving axes, unless specified otherwise (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ahiuchingau authored Nov 7, 2023
1 parent 30425f7 commit 07d518f
Showing 1 changed file with 15 additions and 1 deletion.
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

0 comments on commit 07d518f

Please sign in to comment.