Skip to content

Commit

Permalink
fixture height calculation correction and fixture group map structure
Browse files Browse the repository at this point in the history
  • Loading branch information
CaseyBatten committed Apr 3, 2024
1 parent 0fc0f57 commit 2b4ddd9
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 39 deletions.
39 changes: 24 additions & 15 deletions robot-server/robot_server/deck_configuration/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,21 +149,30 @@ def get_configuration_errors( # noqa: C901
)
)

for fixture_id in found_cutout_fixture["fixtureGroup"]:
result = [
placement.cutout_fixture_id
for placement in placements
if fixture_id in placement.cutout_fixture_id
]
if len(result) == 0:
errors.add(
MissingGroupFixtureError(
cutout_id=placement.cutout_id,
cutout_fixture_id=placement.cutout_fixture_id,
missing_fixture_id=fixture_id,
)
)

for cutout_id in found_cutout_fixture["fixtureGroup"]:
if cutout_id == placement.cutout_id:
map = found_cutout_fixture["fixtureGroup"][cutout_id]
member_found = False
for item in map:
for group_member_cutout_id in item:
group_member_fixtures = item[group_member_cutout_id]
for group_member in group_member_fixtures:
for deck_item in placements:
if (
group_member == deck_item.cutout_fixture_id
and group_member_cutout_id
== deck_item.cutout_id
):
member_found = True
if member_found is False:
errors.add(
MissingGroupFixtureError(
cutout_id=placement.cutout_id,
cutout_fixture_id=placement.cutout_fixture_id,
missing_fixture_id=group_member,
)
)
member_found = False
return errors


Expand Down
42 changes: 23 additions & 19 deletions shared-data/deck/definitions/5/ot3_standard.json
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@
"cutoutB1": ["B1"],
"cutoutA1": ["A1"]
},
"fixtureGroup": [],
"fixtureGroup": {},
"height": 0
},
{
Expand All @@ -772,7 +772,7 @@
"cutoutB2": ["B2"],
"cutoutA2": ["A2"]
},
"fixtureGroup": [],
"fixtureGroup": {},
"height": 0
},
{
Expand All @@ -786,7 +786,7 @@
"cutoutB3": ["B3"],
"cutoutA3": ["A3"]
},
"fixtureGroup": [],
"fixtureGroup": {},
"height": 0
},
{
Expand All @@ -800,7 +800,7 @@
"cutoutB3": ["B3", "B4"],
"cutoutA3": ["A3", "A4"]
},
"fixtureGroup": [],
"fixtureGroup": {},
"height": 0
},
{
Expand All @@ -827,7 +827,7 @@
"cutoutB3": ["movableTrashB3"],
"cutoutA3": ["movableTrashA3"]
},
"fixtureGroup": [],
"fixtureGroup": {},
"height": 40
},
{
Expand All @@ -838,7 +838,7 @@
"providesAddressableAreas": {
"cutoutD3": ["1ChannelWasteChute", "8ChannelWasteChute"]
},
"fixtureGroup": [],
"fixtureGroup": {},
"height": 124.5
},
{
Expand All @@ -854,7 +854,7 @@
"gripperWasteChute"
]
},
"fixtureGroup": [],
"fixtureGroup": {},
"height": 124.5
},
{
Expand All @@ -865,7 +865,7 @@
"providesAddressableAreas": {
"cutoutD3": ["1ChannelWasteChute", "8ChannelWasteChute", "D4"]
},
"fixtureGroup": [],
"fixtureGroup": {},
"height": 124.5
},
{
Expand All @@ -882,7 +882,7 @@
"D4"
]
},
"fixtureGroup": [],
"fixtureGroup": {},
"height": 124.5
},
{
Expand All @@ -893,8 +893,10 @@
"providesAddressableAreas": {
"cutoutA1": []
},
"fixtureGroup": ["thermocyclerModuleV2Rear", "thermocyclerModuleV2Front"],
"height": 211.91
"fixtureGroup": {
"cutoutA1": [{"cutoutA1": ["thermocyclerModuleV2Rear"]}, {"cutoutB1": ["thermocyclerModuleV2Front"]}]
},
"height": 72.35
},
{
"id": "thermocyclerModuleV2Front",
Expand All @@ -904,8 +906,10 @@
"providesAddressableAreas": {
"cutoutB1": ["thermocyclerModuleV2"]
},
"fixtureGroup": ["thermocyclerModuleV2Rear", "thermocyclerModuleV2Front"],
"height": 170.66
"fixtureGroup": {
"cutoutB1": [{"cutoutA1": ["thermocyclerModuleV2Rear"]}, {"cutoutB1": ["thermocyclerModuleV2Front"]}]
},
"height": 72.35
},
{
"id": "heaterShakerModuleV1",
Expand All @@ -931,8 +935,8 @@
"cutoutB3": ["heaterShakerV1B3"],
"cutoutA3": ["heaterShakerV1A3"]
},
"fixtureGroup": [],
"height": 82
"fixtureGroup": {},
"height": 18.95
},
{
"id": "temperatureModuleV2",
Expand All @@ -958,8 +962,8 @@
"cutoutB3": ["temperatureModuleV2B3"],
"cutoutA3": ["temperatureModuleV2A3"]
},
"fixtureGroup": [],
"height": 84
"fixtureGroup": {},
"height": 9.0
},
{
"id": "magneticBlockV1",
Expand Down Expand Up @@ -993,8 +997,8 @@
"cutoutB3": ["magneticBlockV1B3"],
"cutoutA3": ["magneticBlockV1A3"]
},
"fixtureGroup": [],
"height": 45
"fixtureGroup": {},
"height": 38.0
}
],
"gripperOffsets": {
Expand Down
18 changes: 14 additions & 4 deletions shared-data/deck/schemas/5.json
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@
"mayMountTo",
"displayName",
"providesAddressableAreas",
"fixtureGroup",
"height"
],
"properties": {
Expand Down Expand Up @@ -293,10 +294,19 @@
}
},
"fixtureGroup": {
"description": "The group of fixtures that must exist in the deck configuration if this fixture exists.",
"type": "array",
"items": {
"type": "string"
"description": "The map of fixtures that must exist in the deck configuration if this fixture exists, with the mounting location acting as a key to determine the location of the rest of the group.",
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"height": {
Expand Down
2 changes: 1 addition & 1 deletion shared-data/python/opentrons_shared_data/deck/dev_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class CutoutFixture(TypedDict):
mayMountTo: List[str]
displayName: str
providesAddressableAreas: Dict[str, List[str]]
fixtureGroup: List[str]
fixtureGroup: Dict[str, List[Dict[str, List[str]]]]
height: float


Expand Down

0 comments on commit 2b4ddd9

Please sign in to comment.