File tree Expand file tree Collapse file tree 4 files changed +18
-6
lines changed Expand file tree Collapse file tree 4 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ describe('disengageMagnet', () => {
17
17
id : moduleId ,
18
18
type : MAGNETIC_MODULE_TYPE ,
19
19
model : MAGNETIC_MODULE_V1 ,
20
- pythonName : 'mockPythonName ' ,
20
+ pythonName : 'mock_magnetic_module_1 ' ,
21
21
}
22
22
robotState = getInitialRobotStateStandard ( invariantContext )
23
23
robotState . modules [ moduleId ] = {
@@ -46,6 +46,7 @@ describe('disengageMagnet', () => {
46
46
} ,
47
47
} ,
48
48
] ,
49
+ python : 'mock_magnetic_module_1.disengage()' ,
49
50
} )
50
51
} )
51
52
} )
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ describe('engageMagnet', () => {
17
17
id : moduleId ,
18
18
type : MAGNETIC_MODULE_TYPE ,
19
19
model : MAGNETIC_MODULE_V1 ,
20
- pythonName : 'mockPythonName ' ,
20
+ pythonName : 'mock_magnetic_module_1 ' ,
21
21
}
22
22
robotState = getInitialRobotStateStandard ( invariantContext )
23
23
robotState . modules [ moduleId ] = {
@@ -49,6 +49,7 @@ describe('engageMagnet', () => {
49
49
} ,
50
50
} ,
51
51
] ,
52
+ python : `mock_magnetic_module_1.engage(height_from_base=${ height } )` ,
52
53
} )
53
54
} )
54
55
} )
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ export const disengageMagnet: CommandCreator<ModuleOnlyParams> = (
12
12
prevRobotState
13
13
) => {
14
14
const { moduleId } = args
15
+ const { moduleEntities } = invariantContext
15
16
const commandType = 'magneticModule/disengage'
16
17
17
18
if ( moduleId === null ) {
@@ -21,9 +22,12 @@ export const disengageMagnet: CommandCreator<ModuleOnlyParams> = (
21
22
}
22
23
23
24
assert (
24
- invariantContext . moduleEntities [ moduleId ] ?. type === MAGNETIC_MODULE_TYPE ,
25
- `expected module ${ moduleId } to be magdeck, got ${ invariantContext . moduleEntities [ moduleId ] ?. type } `
25
+ moduleEntities [ moduleId ] ?. type === MAGNETIC_MODULE_TYPE ,
26
+ `expected module ${ moduleId } to be magdeck, got ${ moduleEntities [ moduleId ] ?. type } `
26
27
)
28
+
29
+ const pythonName = moduleEntities [ moduleId ] . pythonName
30
+
27
31
return {
28
32
commands : [
29
33
{
@@ -34,5 +38,6 @@ export const disengageMagnet: CommandCreator<ModuleOnlyParams> = (
34
38
} ,
35
39
} ,
36
40
] ,
41
+ python : `${ pythonName } .disengage()` ,
37
42
}
38
43
}
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ export const engageMagnet: CommandCreator<EngageMagnetParams> = (
12
12
prevRobotState
13
13
) => {
14
14
const { moduleId, height } = args
15
+ const { moduleEntities } = invariantContext
15
16
const commandType = 'magneticModule/engage'
16
17
17
18
if ( moduleId === null ) {
@@ -21,9 +22,12 @@ export const engageMagnet: CommandCreator<EngageMagnetParams> = (
21
22
}
22
23
23
24
assert (
24
- invariantContext . moduleEntities [ moduleId ] ?. type === MAGNETIC_MODULE_TYPE ,
25
- `expected module ${ moduleId } to be magdeck, got ${ invariantContext . moduleEntities [ moduleId ] ?. type } `
25
+ moduleEntities [ moduleId ] ?. type === MAGNETIC_MODULE_TYPE ,
26
+ `expected module ${ moduleId } to be magdeck, got ${ moduleEntities [ moduleId ] ?. type } `
26
27
)
28
+
29
+ const pythonName = moduleEntities [ moduleId ] . pythonName
30
+
27
31
return {
28
32
commands : [
29
33
{
@@ -35,5 +39,6 @@ export const engageMagnet: CommandCreator<EngageMagnetParams> = (
35
39
} ,
36
40
} ,
37
41
] ,
42
+ python : `${ pythonName } .engage(height_from_base=${ height } )` ,
38
43
}
39
44
}
You can’t perform that action at this time.
0 commit comments