Skip to content

Commit

Permalink
Merge branch 'edge' into chore_react-18-no-hmr
Browse files Browse the repository at this point in the history
  • Loading branch information
b-cooper committed Dec 12, 2023
2 parents 183e2f2 + cf8876f commit ea972ca
Show file tree
Hide file tree
Showing 196 changed files with 11,483 additions and 1,788 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/shared-data-test-lint-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,10 @@ jobs:
- id: publish-switch
run: |
echo "Determining whether to publish artifacts for event ${{github.event_type}} and ref ${{github.ref}}"
if [ "${{ format('{0}', startsWith(github.ref, 'refs/tags/shared-data')) }}" ] ; then
if [ "${{ format('{0}', startsWith(github.ref, 'refs/tags/shared-data')) }}" = "true"] ; then
echo "Publishing builds for shared-data@ tags"
echo 'should_publish=true' >> $GITHUB_OUTPUT
elif [ "${{ format('{0}', startsWith(github.ref, 'refs/tags/components')) }}" ] ; then
elif [ "${{ format('{0}', startsWith(github.ref, 'refs/tags/components')) }}" = "true"] ; then
echo "Publishing builds for components@ tags"
echo 'should_publish=true' >> $GITHUB_OUTPUT
else
Expand Down
26 changes: 24 additions & 2 deletions api/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,35 @@ log][]. For a list of currently known issues, please see the [Opentrons issue tr
[opentrons issue tracker]: https://github.com/Opentrons/opentrons/issues?q=is%3Aopen+is%3Aissue+label%3Abug


## Opentrons Robot Software Changes in 7.1.0

Welcome to the v7.1.0 release of the Opentrons robot software! This release includes support for deck configuration on Opentrons Flex, partial tip pickup with the Flex 96-Channel Pipette, and other improvements.

### New Features

- Pick up either a column of 8 tips or all 96 tips with the Flex 96-Channel Pipette.
- Specify the deck configuration of Flex, including the movable trash bin, waste chute, and staging area slots.
- Use the Flex Gripper to drop labware into the waste chute, or use Flex pipettes to dispense liquid or drop tips into the waste chute.
- Manually prepare a pipette for aspiration, when required for your application.

### Improved Features

- Improves aspirate, dispense, and mix behavior with volumes set to zero.
- The `opentrons_simulate` command-line tool now works with all Python API versions.

### Known Issues

JSON protocols created or modified with Protocol Designer v6.0.0 or higher can't be simulated with `opentrons_simulate`.

---

## Opentrons Robot Software Changes in 7.0.2

The 7.0.2 hotfix release does not contain any changes to the robot software
The 7.0.2 hotfix release does not contain any changes to the robot software.

### Known Issues

JSON protocols created or modified with Protocol Designer v6.0.0 or higher can't be simulated with the `opentrons_simulate` command-line tool
JSON protocols created or modified with Protocol Designer v6.0.0 or higher can't be simulated with the `opentrons_simulate` command-line tool.

---

Expand Down
15 changes: 11 additions & 4 deletions api/src/opentrons/hardware_control/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,29 @@
from .api import API
from .pause_manager import PauseManager
from .backends import Controller, Simulator
from .types import CriticalPoint, ExecutionState
from .types import CriticalPoint, ExecutionState, OT3Mount
from .constants import DROP_TIP_RELEASE_DISTANCE
from .thread_manager import ThreadManager
from .execution_manager import ExecutionManager
from .threaded_async_lock import ThreadedAsyncLock, ThreadedAsyncForbidden
from .protocols import HardwareControlInterface
from .protocols import HardwareControlInterface, FlexHardwareControlInterface
from .instruments import AbstractInstrument, Gripper
from typing import Union
from .ot3_calibration import OT3Transforms
from .robot_calibration import RobotCalibration
from opentrons.config.types import RobotConfig, OT3Config

from opentrons.types import Mount

# TODO (lc 12-05-2022) We should 1. figure out if we need
# to globally export a class that is strictly used in the hardware controller
# and 2. how to properly export an ot2 and ot3 pipette.
from .instruments.ot2.pipette import Pipette

OT2HardwareControlAPI = HardwareControlInterface[RobotCalibration]
OT3HardwareControlAPI = HardwareControlInterface[OT3Transforms]
OT2HardwareControlAPI = HardwareControlInterface[RobotCalibration, Mount, RobotConfig]
OT3HardwareControlAPI = FlexHardwareControlInterface[
OT3Transforms, Union[Mount, OT3Mount], OT3Config
]
HardwareControlAPI = Union[OT2HardwareControlAPI, OT3HardwareControlAPI]

ThreadManagedHardware = ThreadManager[HardwareControlAPI]
Expand All @@ -55,4 +60,6 @@
"ThreadedAsyncForbidden",
"ThreadManagedHardware",
"SyncHardwareAPI",
"OT2HardwareControlAPI",
"OT3HardwareControlAPI",
]
5 changes: 4 additions & 1 deletion api/src/opentrons/hardware_control/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class API(
# of methods that are present in the protocol will call the (empty,
# do-nothing) methods in the protocol. This will happily make all the
# tests fail.
HardwareControlInterface[RobotCalibration],
HardwareControlInterface[RobotCalibration, top_types.Mount, RobotConfig],
):
"""This API is the primary interface to the hardware controller.
Expand Down Expand Up @@ -426,6 +426,9 @@ async def update_firmware(
firmware_file, checked_loop, explicit_modeset
)

def has_gripper(self) -> bool:
return False

async def cache_instruments(
self, require: Optional[Dict[top_types.Mount, PipetteName]] = None
) -> None:
Expand Down
26 changes: 25 additions & 1 deletion api/src/opentrons/hardware_control/instruments/ot3/gripper.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
)
from ..instrument_abc import AbstractInstrument
from opentrons.hardware_control.dev_types import AttachedGripper, GripperDict
from opentrons_shared_data.errors.exceptions import CommandPreconditionViolated
from opentrons_shared_data.errors.exceptions import (
CommandPreconditionViolated,
FailedGripperPickupError,
)

from opentrons_shared_data.gripper import (
GripperDefinition,
Expand Down Expand Up @@ -101,6 +104,10 @@ def remove_probe(self) -> None:
assert self.attached_probe
self._attached_probe = None

@property
def max_allowed_grip_error(self) -> float:
return self._geometry.max_allowed_grip_error

@property
def jaw_width(self) -> float:
jaw_max = self.geometry.jaw_width["max"]
Expand Down Expand Up @@ -196,6 +203,23 @@ def check_calibration_pin_location_is_accurate(self) -> None:
},
)

def check_labware_pickup(self, labware_width: float) -> None:
"""Ensure that a gripper pickup succeeded."""
# check if the gripper is at an acceptable position after attempting to
# pick up labware
expected_gripper_position = labware_width
current_gripper_position = self.jaw_width
if (
abs(current_gripper_position - expected_gripper_position)
> self.max_allowed_grip_error
):
raise FailedGripperPickupError(
details={
"expected jaw width": expected_gripper_position,
"actual jaw width": current_gripper_position,
},
)

def critical_point(self, cp_override: Optional[CriticalPoint] = None) -> Point:
"""
The vector from the gripper mount to the critical point, which is selectable
Expand Down
40 changes: 20 additions & 20 deletions api/src/opentrons/hardware_control/ot3_calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
from .util import DeckTransformState

if TYPE_CHECKING:
from .ot3api import OT3API
from opentrons.hardware_control import OT3HardwareControlAPI

LOG = getLogger(__name__)

Expand Down Expand Up @@ -123,7 +123,7 @@ def _verify_height(


async def _verify_edge_pos(
hcapi: OT3API,
hcapi: OT3HardwareControlAPI,
mount: OT3Mount,
search_axis: Union[Literal[Axis.X, Axis.Y]],
found_edge: Point,
Expand Down Expand Up @@ -177,7 +177,7 @@ def critical_edge_offset(


async def find_edge_binary(
hcapi: OT3API,
hcapi: OT3HardwareControlAPI,
mount: OT3Mount,
slot_edge_nominal: Point,
search_axis: Union[Literal[Axis.X, Axis.Y]],
Expand Down Expand Up @@ -272,7 +272,7 @@ async def find_edge_binary(


async def find_slot_center_binary(
hcapi: OT3API,
hcapi: OT3HardwareControlAPI,
mount: OT3Mount,
estimated_center: Point,
raise_verify_error: bool = True,
Expand Down Expand Up @@ -337,7 +337,7 @@ async def find_slot_center_binary(


async def find_calibration_structure_height(
hcapi: OT3API,
hcapi: OT3HardwareControlAPI,
mount: OT3Mount,
nominal_center: Point,
probe: InstrumentProbeType = InstrumentProbeType.PRIMARY,
Expand Down Expand Up @@ -365,7 +365,7 @@ async def find_calibration_structure_height(


async def _probe_deck_at(
api: OT3API,
api: OT3HardwareControlAPI,
mount: OT3Mount,
target: Point,
settings: CapacitivePassSettings,
Expand All @@ -390,7 +390,7 @@ async def _probe_deck_at(


async def find_axis_center(
hcapi: OT3API,
hcapi: OT3HardwareControlAPI,
mount: OT3Mount,
minus_edge_nominal: Point,
plus_edge_nominal: Point,
Expand Down Expand Up @@ -530,7 +530,7 @@ def _edges_from_data(


async def find_slot_center_noncontact(
hcapi: OT3API, mount: OT3Mount, estimated_center: Point
hcapi: OT3HardwareControlAPI, mount: OT3Mount, estimated_center: Point
) -> Point:
NONCONTACT_INTERVAL_MM: float = 0.1
travel_center = estimated_center + Point(0, 0, NONCONTACT_INTERVAL_MM)
Expand All @@ -552,7 +552,7 @@ async def find_slot_center_noncontact(


async def find_calibration_structure_center(
hcapi: OT3API,
hcapi: OT3HardwareControlAPI,
mount: OT3Mount,
nominal_center: Point,
method: CalibrationMethod = CalibrationMethod.BINARY_SEARCH,
Expand All @@ -574,7 +574,7 @@ async def find_calibration_structure_center(


async def _calibrate_mount(
hcapi: OT3API,
hcapi: OT3HardwareControlAPI,
mount: OT3Mount,
slot: int = SLOT_CENTER,
method: CalibrationMethod = CalibrationMethod.BINARY_SEARCH,
Expand Down Expand Up @@ -641,7 +641,7 @@ async def _calibrate_mount(


async def find_calibration_structure_position(
hcapi: OT3API,
hcapi: OT3HardwareControlAPI,
mount: OT3Mount,
nominal_center: Point,
method: CalibrationMethod = CalibrationMethod.BINARY_SEARCH,
Expand Down Expand Up @@ -673,7 +673,7 @@ async def find_calibration_structure_position(


async def find_slot_center_binary_from_nominal_center(
hcapi: OT3API,
hcapi: OT3HardwareControlAPI,
mount: OT3Mount,
slot: int,
) -> Tuple[Point, Point]:
Expand All @@ -698,7 +698,7 @@ async def find_slot_center_binary_from_nominal_center(


async def _determine_transform_matrix(
hcapi: OT3API,
hcapi: OT3HardwareControlAPI,
mount: OT3Mount,
) -> Tuple[types.AttitudeMatrix, Dict[str, Any]]:
"""
Expand Down Expand Up @@ -750,7 +750,7 @@ def gripper_pin_offsets_mean(front: Point, rear: Point) -> Point:


async def calibrate_gripper_jaw(
hcapi: OT3API,
hcapi: OT3HardwareControlAPI,
probe: GripperProbe,
slot: int = 5,
method: CalibrationMethod = CalibrationMethod.BINARY_SEARCH,
Expand Down Expand Up @@ -788,7 +788,7 @@ async def calibrate_gripper_jaw(


async def calibrate_gripper(
hcapi: OT3API, offset_front: Point, offset_rear: Point
hcapi: OT3HardwareControlAPI, offset_front: Point, offset_rear: Point
) -> Point:
"""Calibrate gripper."""
offset = gripper_pin_offsets_mean(front=offset_front, rear=offset_rear)
Expand All @@ -798,7 +798,7 @@ async def calibrate_gripper(


async def find_pipette_offset(
hcapi: OT3API,
hcapi: OT3HardwareControlAPI,
mount: Literal[OT3Mount.LEFT, OT3Mount.RIGHT],
slot: int = 5,
method: CalibrationMethod = CalibrationMethod.BINARY_SEARCH,
Expand Down Expand Up @@ -829,7 +829,7 @@ async def find_pipette_offset(


async def calibrate_pipette(
hcapi: OT3API,
hcapi: OT3HardwareControlAPI,
mount: Literal[OT3Mount.LEFT, OT3Mount.RIGHT],
slot: int = 5,
method: CalibrationMethod = CalibrationMethod.BINARY_SEARCH,
Expand All @@ -852,7 +852,7 @@ async def calibrate_pipette(


async def calibrate_module(
hcapi: OT3API,
hcapi: OT3HardwareControlAPI,
mount: OT3Mount,
slot: str,
module_id: str,
Expand Down Expand Up @@ -907,7 +907,7 @@ async def calibrate_module(


async def calibrate_belts(
hcapi: OT3API,
hcapi: OT3HardwareControlAPI,
mount: OT3Mount,
pipette_id: str,
) -> Tuple[types.AttitudeMatrix, Dict[str, Any]]:
Expand Down Expand Up @@ -1005,7 +1005,7 @@ def validate_attitude_deck_calibration(
return DeckTransformState.OK


def delete_belt_calibration_data(hcapi: OT3API) -> None:
def delete_belt_calibration_data(hcapi: OT3HardwareControlAPI) -> None:
delete_robot_belt_attitude()
hcapi.reset_deck_calibration()

Expand Down
Loading

0 comments on commit ea972ca

Please sign in to comment.