Skip to content

Commit

Permalink
fix(labware-library): labware creator adapter z offset fit (#17347)
Browse files Browse the repository at this point in the history
Closes #17238
and  https://opentrons.atlassian.net/browse/RESC-382 by adding in the Module's height when doing ModuleOffsets
  • Loading branch information
alexjoel42 authored Jan 27, 2025
1 parent 68070c0 commit d05ef3f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions labware-library/src/labware-creator/fieldsToLabware.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createRegularLabware } from '@opentrons/shared-data'
import { createRegularLabware, getModuleDef2 } from '@opentrons/shared-data'

import { DISPLAY_VOLUME_UNITS } from './fields'
import { getIsCustomTubeRack } from './utils'
Expand All @@ -11,6 +11,7 @@ import type {
LabwareDisplayCategory,
LabwareWellProperties,
LabwareOffset,
ModuleModel,
} from '@opentrons/shared-data'

// TODO Ian 2019-07-29: move this constant to shared-data?
Expand Down Expand Up @@ -121,11 +122,15 @@ export function fieldsToLabware(
})
const stackingOffsetWithModule: Record<string, LabwareOffset> = {}
Object.entries(compatibleModules).forEach(([moduleModel, z]) => {
const moduleDefinition = getModuleDef2(moduleModel as ModuleModel)
return (stackingOffsetWithModule[moduleModel] = {
x: 0,
y: 0,
// ensure that z is a number!
z: fields.labwareZDimension - parseFloat(String(z)),
z:
fields.labwareZDimension -
parseFloat(String(z)) +
moduleDefinition.labwareOffset.z,
})
})

Expand Down

0 comments on commit d05ef3f

Please sign in to comment.