Skip to content

Commit ccfad28

Browse files
committed
always specify waste chute drop tip location
1 parent 954cc9c commit ccfad28

File tree

2 files changed

+1
-49
lines changed

2 files changed

+1
-49
lines changed

step-generation/src/__tests__/dropTipInWasteChute.test.ts

-38
Original file line numberDiff line numberDiff line change
@@ -26,44 +26,6 @@ const prevRobotState: RobotState = {
2626

2727
describe('dropTipInWasteChute', () => {
2828
it('returns correct commands for drop tip in waste chute', () => {
29-
const args = {
30-
pipetteId: DEFAULT_PIPETTE,
31-
wasteChuteId: mockWasteChuteId,
32-
}
33-
const result = dropTipInWasteChute(args, invariantContext, prevRobotState)
34-
expect(getSuccessResult(result).commands).toEqual([
35-
{
36-
commandType: 'moveToAddressableArea',
37-
key: expect.any(String),
38-
params: {
39-
pipetteId: DEFAULT_PIPETTE,
40-
addressableAreaName: '1ChannelWasteChute',
41-
offset: { x: 0, y: 0, z: 0 },
42-
},
43-
},
44-
{
45-
commandType: 'dropTipInPlace',
46-
key: expect.any(String),
47-
params: {
48-
pipetteId: DEFAULT_PIPETTE,
49-
},
50-
},
51-
])
52-
expect(getSuccessResult(result).python).toBe('mockPythonName.drop_tip()')
53-
})
54-
it('returns correct commands for drop tip in waste chute when trash bin also exists', () => {
55-
const mockTrashId = 'mockTrashId'
56-
invariantContext = {
57-
...invariantContext,
58-
additionalEquipmentEntities: {
59-
...invariantContext.additionalEquipmentEntities,
60-
[mockTrashId]: {
61-
name: 'trashBin',
62-
location: 'cutoutA3',
63-
id: mockTrashId,
64-
},
65-
},
66-
}
6729
const args = {
6830
pipetteId: DEFAULT_PIPETTE,
6931
wasteChuteId: mockWasteChuteId,

step-generation/src/commandCreators/compound/dropTipInWasteChute.ts

+1-11
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ export const dropTipInWasteChute: CommandCreator<DropTipInWasteChuteArgs> = (
2424
const addressableAreaName = getWasteChuteAddressableAreaNamePip(
2525
pipetteChannels
2626
)
27-
const hasTrashBin =
28-
Object.values(additionalEquipmentEntities).find(
29-
ae => ae.name === 'trashBin'
30-
) != null
3127

3228
let commandCreators: CurriedCommandCreator[] = []
3329

@@ -38,15 +34,9 @@ export const dropTipInWasteChute: CommandCreator<DropTipInWasteChuteArgs> = (
3834
const pipettePythonName = pipetteEntities[pipetteId].pythonName
3935
const wasteChutePythonName =
4036
additionalEquipmentEntities[wasteChuteId].pythonName
41-
// if there is no trash bin selected, drop tip will occur at the default
42-
// trash container, which would be the waste_chute since we do not support
43-
// having no trash container in PD. Since our code generator always generates
44-
// the trash bins first, if a trash bin exists, we will have to provide the
45-
// waste chute location.
46-
const pythonLocation = hasTrashBin ? [wasteChutePythonName] : []
4737
const pythonCommandCreator: CurriedCommandCreator = () => ({
4838
commands: [],
49-
python: `${pipettePythonName}.drop_tip(${pythonLocation})`,
39+
python: `${pipettePythonName}.drop_tip(${wasteChutePythonName})`,
5040
})
5141

5242
commandCreators = [

0 commit comments

Comments
 (0)