# Open-loop trajectory-fit action2code policy generated from the RoboCasa GT EE trajectory
# Task: CloseBlenderLid
# Episode: episode_000000

from primitives import moveJoint, moveLinear, moveC, moveA, moveWholeBodyPath, moveActionSequence, grasp, release, wait

SCENE_ARTIFACT = '../../../artifacts/20260324/CloseBlenderLid/20260324_205249_close-blender-lid_episode_000000_action2code-open-loop-joint_initial-scene.json'
POLICY_METADATA = {
    'policy_kind': 'open_loop_joint',
    'policy_variant': 'open-loop-joint',
    'task_name': 'CloseBlenderLid',
    'episode_id': 'episode_000000',
    'scene_artifact_path': '../../../artifacts/20260324/CloseBlenderLid/20260324_205249_close-blender-lid_episode_000000_action2code-open-loop-joint_initial-scene.json',
    'fitting_summary_path': '../../../artifacts/20260324/CloseBlenderLid/20260324_205249_close-blender-lid_episode_000000_action2code-open-loop-joint_fitting-summary.json',
    'extracted_pose_metadata_path': '../../../artifacts/20260324/CloseBlenderLid/20260324_205249_close-blender-lid_episode_000000_action2code-open-loop-joint_extracted-pose-metadata.json',
    'stable_grasp_contact_t': 76,
    'stable_release_contact_loss_t': 76,
    'uses_moveC': False,
    'controller_mode': 'whole_body_ik',
}

OBJ_POSE_T0 = pose(x=float('nan'), y=float('nan'), z=float('nan'), qw=float('nan'), qx=float('nan'), qy=float('nan'), qz=float('nan'))
GOAL_RECEPTACLE_POSE = pose(x=float('nan'), y=float('nan'), z=float('nan'), qw=float('nan'), qx=float('nan'), qy=float('nan'), qz=float('nan'))

APPROACH_003_JOINTS = [-0.018129, -1.055660, -0.008860, -2.256801, 0.038554, 1.507538, 0.671120]  # t=3
APPROACH_004_JOINTS = [-0.018888, -1.070419, -0.013096, -2.255506, 0.036090, 1.490269, 0.675154]  # t=4
APPROACH_005_JOINTS = [-0.021039, -1.088220, -0.025171, -2.259211, 0.030900, 1.475702, 0.685451]  # t=5
APPROACH_007_JOINTS = [-0.027392, -1.129855, -0.078486, -2.277934, 0.020895, 1.457084, 0.697556]  # t=7
APPROACH_008_JOINTS = [-0.031148, -1.150873, -0.112914, -2.287349, 0.016891, 1.447865, 0.701255]  # t=8
APPROACH_012_JOINTS = [-0.049658, -1.212915, -0.256520, -2.313199, -0.008999, 1.428368, 0.728637]  # t=12
APPROACH_013_JOINTS = [-0.054608, -1.221184, -0.290673, -2.319493, -0.020854, 1.428320, 0.734192]  # t=13
APPROACH_016_JOINTS = [-0.068627, -1.228322, -0.384397, -2.346362, -0.071275, 1.437685, 0.740958]  # t=16
APPROACH_018_JOINTS = [-0.076768, -1.223824, -0.428582, -2.373372, -0.110730, 1.445509, 0.741331]  # t=18
APPROACH_020_JOINTS = [-0.084484, -1.220449, -0.462064, -2.394356, -0.136423, 1.462408, 0.741862]  # t=20
APPROACH_024_JOINTS = [-0.100250, -1.218668, -0.513996, -2.446999, -0.181638, 1.491752, 0.723935]  # t=24
APPROACH_028_JOINTS = [-0.113779, -1.201362, -0.556023, -2.504391, -0.237675, 1.507416, 0.707651]  # t=28
APPROACH_031_JOINTS = [-0.122951, -1.184799, -0.586133, -2.542702, -0.273715, 1.526181, 0.695913]  # t=31
APPROACH_032_JOINTS = [-0.125871, -1.180020, -0.594519, -2.550925, -0.282520, 1.533801, 0.691563]  # t=32
APPROACH_036_JOINTS = [-0.134964, -1.156424, -0.636951, -2.549721, -0.304428, 1.562691, 0.659997]  # t=36
APPROACH_040_JOINTS = [-0.137045, -1.120581, -0.663366, -2.586268, -0.325234, 1.603627, 0.650614]  # t=40
APPROACH_044_JOINTS = [-0.139024, -1.088414, -0.685408, -2.618015, -0.343426, 1.643822, 0.633545]  # t=44
APPROACH_045_JOINTS = [-0.138810, -1.078945, -0.691754, -2.626693, -0.347965, 1.658451, 0.628000]  # t=45
APPROACH_048_JOINTS = [-0.140313, -1.054106, -0.716987, -2.642030, -0.363250, 1.694279, 0.597996]  # t=48
APPROACH_052_JOINTS = [-0.139952, -1.020663, -0.743111, -2.653754, -0.372951, 1.738308, 0.560611]  # t=52
APPROACH_054_JOINTS = [-0.139604, -1.003672, -0.755807, -2.658018, -0.377563, 1.756285, 0.544261]  # t=54
APPROACH_056_JOINTS = [-0.135429, -0.979073, -0.766679, -2.673272, -0.383081, 1.788796, 0.539194]  # t=56
APPROACH_060_JOINTS = [-0.122675, -0.925622, -0.776299, -2.691582, -0.383257, 1.844778, 0.536554]  # t=60
APPROACH_064_JOINTS = [-0.104085, -0.860256, -0.780118, -2.702965, -0.378246, 1.901693, 0.539299]  # t=64
APPROACH_068_JOINTS = [-0.088474, -0.798573, -0.786116, -2.702716, -0.366655, 1.939511, 0.529773]  # t=68
APPROACH_072_JOINTS = [-0.084501, -0.756150, -0.800344, -2.706422, -0.359218, 1.970529, 0.511496]  # t=72
APPROACH_076_JOINTS = [-0.084282, -0.720002, -0.817821, -2.721585, -0.357946, 2.014410, 0.496257]  # t=76
PRESS_078_JOINTS = [-0.084706, -0.702430, -0.827099, -2.726683, -0.359231, 2.037927, 0.489291]  # t=78
PRESS_080_JOINTS = [-0.085231, -0.686583, -0.834470, -2.727113, -0.358952, 2.054503, 0.482564]  # t=80
PRESS_082_JOINTS = [-0.085836, -0.673628, -0.838582, -2.726498, -0.357032, 2.065361, 0.478815]  # t=82
PRESS_084_JOINTS = [-0.085956, -0.660816, -0.841896, -2.726781, -0.355175, 2.077560, 0.476889]  # t=84
PRESS_085_JOINTS = [-0.085999, -0.655454, -0.841990, -2.727152, -0.353791, 2.081886, 0.476950]  # t=85
PRESS_086_JOINTS = [-0.086163, -0.650268, -0.841126, -2.728221, -0.354107, 2.086883, 0.478758]  # t=86
PRESS_087_JOINTS = [-0.086760, -0.645907, -0.839072, -2.729613, -0.356027, 2.091484, 0.482555]  # t=87
PRESS_088_JOINTS = [-0.087845, -0.643207, -0.836492, -2.729342, -0.357231, 2.093927, 0.486311]  # t=88
PRESS_090_JOINTS = [-0.090254, -0.639840, -0.831957, -2.727958, -0.357005, 2.096313, 0.491857]  # t=90
PRESS_092_JOINTS = [-0.092145, -0.637364, -0.826515, -2.727292, -0.355557, 2.098337, 0.498149]  # t=92
PRESS_094_JOINTS = [-0.093847, -0.636256, -0.819909, -2.727242, -0.353539, 2.098759, 0.504872]  # t=94
PRESS_096_JOINTS = [-0.095822, -0.638887, -0.809824, -2.727459, -0.351015, 2.094201, 0.510861]  # t=96
PRESS_098_JOINTS = [-0.098315, -0.644895, -0.797488, -2.727437, -0.348728, 2.085916, 0.515730]  # t=98
PRESS_100_JOINTS = [-0.101137, -0.655057, -0.781860, -2.726980, -0.345025, 2.072814, 0.521595]  # t=100
PRESS_102_JOINTS = [-0.104042, -0.667378, -0.766077, -2.729275, -0.339616, 2.062420, 0.529134]  # t=102
PRESS_104_JOINTS = [-0.107097, -0.682560, -0.748729, -2.736030, -0.333353, 2.052563, 0.538572]  # t=104
PRESS_106_JOINTS = [-0.110195, -0.702892, -0.725533, -2.747949, -0.324639, 2.038036, 0.553643]  # t=106
PRESS_107_JOINTS = [-0.112289, -0.715686, -0.712336, -2.754166, -0.320008, 2.028593, 0.562720]  # t=107
PRESS_108_JOINTS = [-0.115693, -0.731702, -0.699077, -2.757801, -0.316028, 2.013906, 0.571029]  # t=108
PRESS_110_JOINTS = [-0.125793, -0.771423, -0.675857, -2.758921, -0.309499, 1.978536, 0.581246]  # t=110
PRESS_112_JOINTS = [-0.138065, -0.821591, -0.655259, -2.753826, -0.298091, 1.942794, 0.581946]  # t=112
PRESS_114_JOINTS = [-0.152320, -0.880157, -0.639055, -2.743921, -0.284494, 1.909811, 0.574546]  # t=114
PRESS_116_JOINTS = [-0.167813, -0.944207, -0.627189, -2.732834, -0.269338, 1.877947, 0.561755]  # t=116
PRESS_117_JOINTS = [-0.175367, -0.975108, -0.623657, -2.730577, -0.263021, 1.866829, 0.555207]  # t=117
PRESS_118_JOINTS = [-0.181499, -0.999001, -0.621276, -2.738710, -0.262046, 1.862541, 0.554076]  # t=118
PRESS_119_JOINTS = [-0.187675, -1.018434, -0.621318, -2.750061, -0.266935, 1.860398, 0.555697]  # t=119
PRESS_120_JOINTS = [-0.195312, -1.041063, -0.626249, -2.758492, -0.270136, 1.859387, 0.550625]  # t=120
PRESS_121_JOINTS = [-0.204465, -1.067957, -0.633206, -2.764943, -0.271382, 1.855664, 0.541164]  # t=121
PRESS_122_JOINTS = [-0.214034, -1.099603, -0.635520, -2.765032, -0.267806, 1.844264, 0.531681]  # t=122
PRESS_124_JOINTS = [-0.232451, -1.169908, -0.628334, -2.751578, -0.249765, 1.807641, 0.515682]  # t=124
PRESS_126_JOINTS = [-0.247841, -1.236358, -0.616075, -2.736442, -0.227833, 1.773461, 0.505561]  # t=126
PRESS_128_JOINTS = [-0.259465, -1.295308, -0.600094, -2.725106, -0.205196, 1.743773, 0.503502]  # t=128
PRESS_130_JOINTS = [-0.266610, -1.346722, -0.577359, -2.714198, -0.179432, 1.717114, 0.509523]  # t=130
PRESS_132_JOINTS = [-0.269360, -1.390678, -0.548182, -2.701135, -0.150935, 1.691915, 0.523088]  # t=132
PRESS_134_JOINTS = [-0.268603, -1.427879, -0.517069, -2.684815, -0.122019, 1.668412, 0.540439]  # t=134
PRESS_136_JOINTS = [-0.264632, -1.458881, -0.484819, -2.664593, -0.092398, 1.647041, 0.560326]  # t=136
PRESS_138_JOINTS = [-0.258152, -1.485036, -0.452786, -2.640099, -0.062918, 1.626397, 0.581668]  # t=138
PRESS_140_JOINTS = [-0.249364, -1.504627, -0.422365, -2.609662, -0.038444, 1.610626, 0.602305]  # t=140
PRESS_142_JOINTS = [-0.238806, -1.518173, -0.391962, -2.575324, -0.020834, 1.599137, 0.622312]  # t=142
PRESS_144_JOINTS = [-0.226833, -1.526999, -0.363093, -2.538471, -0.005262, 1.591879, 0.642510]  # t=144
PRESS_146_JOINTS = [-0.214041, -1.532330, -0.337447, -2.500283, 0.008875, 1.590126, 0.662083]  # t=146
PRESS_148_JOINTS = [-0.200361, -1.532728, -0.310980, -2.460377, 0.024136, 1.593958, 0.684224]  # t=148
PRESS_149_JOINTS = [-0.193200, -1.530916, -0.297241, -2.439809, 0.032601, 1.597423, 0.696305]  # t=149
PRESS_150_JOINTS = [-0.185945, -1.528076, -0.283212, -2.418943, 0.041390, 1.600828, 0.708914]  # t=150
PRESS_152_JOINTS = [-0.171606, -1.521668, -0.256197, -2.374772, 0.058784, 1.605576, 0.733464]  # t=152
PRESS_154_JOINTS = [-0.157574, -1.515560, -0.232543, -2.329737, 0.077454, 1.609848, 0.755685]  # t=154
PRESS_156_JOINTS = [-0.144639, -1.513200, -0.210617, -2.287470, 0.096737, 1.615688, 0.776846]  # t=156
PRESS_158_JOINTS = [-0.133203, -1.515396, -0.190085, -2.247535, 0.114717, 1.625423, 0.797049]  # t=158
PRESS_159_JOINTS = [-0.127889, -1.516658, -0.180274, -2.228300, 0.122888, 1.631963, 0.806757]  # t=159
PRESS_160_JOINTS = [-0.122882, -1.518274, -0.170811, -2.211332, 0.130124, 1.637775, 0.816180]  # t=160
PRESS_162_JOINTS = [-0.113694, -1.523825, -0.152183, -2.181075, 0.144456, 1.655544, 0.833687]  # t=162
PRESS_164_JOINTS = [-0.105294, -1.526388, -0.130731, -2.158703, 0.159059, 1.682591, 0.851436]  # t=164
PRESS_165_JOINTS = [-0.101442, -1.525278, -0.117997, -2.151796, 0.165974, 1.697354, 0.861485]  # t=165
PRESS_166_JOINTS = [-0.097818, -1.522366, -0.104087, -2.146070, 0.172235, 1.710957, 0.872703]  # t=166
PRESS_168_JOINTS = [-0.091150, -1.511595, -0.073065, -2.132031, 0.182932, 1.727616, 0.899634]  # t=168
PRESS_170_JOINTS = [-0.085056, -1.494370, -0.038501, -2.116756, 0.192330, 1.734135, 0.930989]  # t=170
PRESS_172_JOINTS = [-0.079502, -1.469463, -0.002780, -2.105133, 0.198781, 1.725157, 0.966161]  # t=172
PRESS_174_JOINTS = [-0.074106, -1.439250, 0.028922, -2.089317, 0.201935, 1.703947, 1.001225]  # t=174
PRESS_176_JOINTS = [-0.068667, -1.407875, 0.054786, -2.070878, 0.203540, 1.683550, 1.031092]  # t=176
PRESS_178_JOINTS = [-0.063517, -1.375964, 0.072835, -2.052320, 0.202205, 1.665247, 1.054747]  # t=178
PRESS_180_JOINTS = [-0.058415, -1.348056, 0.082264, -2.034000, 0.198555, 1.647117, 1.070198]  # t=180
PRESS_182_JOINTS = [-0.053661, -1.322048, 0.087432, -2.017272, 0.194842, 1.626917, 1.081226]  # t=182
PRESS_184_JOINTS = [-0.049545, -1.295922, 0.091840, -2.000902, 0.192513, 1.606593, 1.090462]  # t=184
PRESS_186_JOINTS = [-0.046055, -1.270991, 0.096619, -1.983509, 0.191610, 1.582979, 1.099830]  # t=186
PRESS_188_JOINTS = [-0.043178, -1.248072, 0.101606, -1.965889, 0.191353, 1.555647, 1.109765]  # t=188
PRESS_190_JOINTS = [-0.040807, -1.226168, 0.107068, -1.949534, 0.192030, 1.527979, 1.119873]  # t=190
PRESS_192_JOINTS = [-0.038993, -1.202546, 0.112500, -1.931648, 0.193327, 1.501037, 1.130143]  # t=192
PRESS_194_JOINTS = [-0.037370, -1.180908, 0.115244, -1.911222, 0.195479, 1.472549, 1.140776]  # t=194
PRESS_195_JOINTS = [-0.036836, -1.171891, 0.115803, -1.901259, 0.194879, 1.458816, 1.146397]  # t=195
PRESS_196_JOINTS = [-0.036713, -1.163536, 0.116959, -1.892331, 0.192423, 1.444935, 1.153324]  # t=196
PRESS_198_JOINTS = [-0.037372, -1.146934, 0.120982, -1.877858, 0.184950, 1.421975, 1.170566]  # t=198
PRESS_200_JOINTS = [-0.038458, -1.132539, 0.125483, -1.867893, 0.176425, 1.407788, 1.187264]  # t=200
PRESS_202_JOINTS = [-0.039481, -1.123052, 0.130013, -1.863641, 0.168364, 1.401487, 1.201703]  # t=202
PRESS_204_JOINTS = [-0.040260, -1.118215, 0.134308, -1.864238, 0.161111, 1.397520, 1.213842]  # t=204
PRESS_206_JOINTS = [-0.040916, -1.117953, 0.138799, -1.868714, 0.153312, 1.396415, 1.224123]  # t=206
PRESS_208_JOINTS = [-0.041419, -1.121381, 0.143085, -1.875997, 0.146158, 1.396200, 1.234241]  # t=208
PRESS_210_JOINTS = [-0.041870, -1.125683, 0.146907, -1.883023, 0.139716, 1.397945, 1.243099]  # t=210
PRESS_212_JOINTS = [-0.042219, -1.129575, 0.149930, -1.889429, 0.134970, 1.399549, 1.250859]  # t=212
PRESS_213_JOINTS = [-0.042376, -1.131124, 0.151085, -1.892426, 0.133249, 1.399776, 1.254598]  # t=213
PRESS_214_JOINTS = [-0.042614, -1.130176, 0.152164, -1.895765, 0.132559, 1.399492, 1.257885]  # t=214
PRESS_216_JOINTS = [-0.043247, -1.119848, 0.154760, -1.900137, 0.133639, 1.397198, 1.261679]  # t=216
PRESS_218_JOINTS = [-0.044316, -1.099411, 0.160192, -1.898474, 0.133897, 1.391247, 1.261833]  # t=218
PRESS_220_JOINTS = [-0.046171, -1.070447, 0.171796, -1.889847, 0.129277, 1.379010, 1.260272]  # t=220
PRESS_222_JOINTS = [-0.048837, -1.034841, 0.191655, -1.871748, 0.118801, 1.357992, 1.258489]  # t=222
PRESS_224_JOINTS = [-0.052258, -0.995722, 0.215687, -1.844927, 0.102379, 1.329165, 1.257239]  # t=224
PRESS_226_JOINTS = [-0.055843, -0.959657, 0.236247, -1.812691, 0.079448, 1.293720, 1.253028]  # t=226
PRESS_228_JOINTS = [-0.059469, -0.925494, 0.252016, -1.782144, 0.058539, 1.263399, 1.247830]  # t=228
PRESS_230_JOINTS = [-0.063064, -0.893750, 0.262306, -1.755674, 0.044146, 1.245521, 1.245426]  # t=230
PRESS_232_JOINTS = [-0.065694, -0.870677, 0.267555, -1.734941, 0.038999, 1.234456, 1.247422]  # t=232
PRESS_234_JOINTS = [-0.067108, -0.858314, 0.270622, -1.722780, 0.037266, 1.222811, 1.250706]  # t=234
PRESS_236_JOINTS = [-0.068277, -0.851552, 0.273224, -1.718744, 0.035030, 1.216542, 1.258023]  # t=236
PRESS_238_JOINTS = [-0.069119, -0.848065, 0.275939, -1.721753, 0.033356, 1.215718, 1.266034]  # t=238
PRESS_240_JOINTS = [-0.069361, -0.847145, 0.277945, -1.727727, 0.032938, 1.217733, 1.270564]  # t=240
PRESS_242_JOINTS = [-0.069227, -0.847746, 0.279234, -1.738919, 0.033150, 1.222894, 1.271685]  # t=242
PRESS_244_JOINTS = [-0.068589, -0.851878, 0.279589, -1.755175, 0.033580, 1.228677, 1.271758]  # t=244
PRESS_246_JOINTS = [-0.067506, -0.859111, 0.278882, -1.772169, 0.033923, 1.235627, 1.271595]  # t=246
PRESS_248_JOINTS = [-0.066638, -0.864896, 0.276406, -1.784346, 0.033428, 1.245253, 1.270104]  # t=248
PRESS_250_JOINTS = [-0.066540, -0.864738, 0.274322, -1.794198, 0.032526, 1.259770, 1.268148]  # t=250
PRESS_252_JOINTS = [-0.067023, -0.858902, 0.273824, -1.802154, 0.031394, 1.277973, 1.267325]  # t=252
PRESS_254_JOINTS = [-0.067925, -0.848577, 0.274041, -1.807903, 0.029639, 1.297970, 1.267275]  # t=254
PRESS_256_JOINTS = [-0.069085, -0.835033, 0.274567, -1.811326, 0.027289, 1.317879, 1.267276]  # t=256
PRESS_258_JOINTS = [-0.070251, -0.820556, 0.275239, -1.812298, 0.024583, 1.334810, 1.267701]  # t=258
PRESS_260_JOINTS = [-0.071432, -0.806031, 0.276149, -1.811799, 0.021297, 1.349117, 1.270155]  # t=260
PRESS_262_JOINTS = [-0.072463, -0.792284, 0.277308, -1.810305, 0.017776, 1.360812, 1.274223]  # t=262
PRESS_264_JOINTS = [-0.073055, -0.779325, 0.278445, -1.808252, 0.015227, 1.370134, 1.276276]  # t=264
PRESS_266_JOINTS = [-0.073522, -0.765196, 0.279001, -1.805693, 0.013525, 1.376844, 1.276483]  # t=266
PRESS_268_JOINTS = [-0.074150, -0.748132, 0.279418, -1.801514, 0.011905, 1.382632, 1.276479]  # t=268
PRESS_270_JOINTS = [-0.074761, -0.728834, 0.280087, -1.796058, 0.010767, 1.383342, 1.276462]  # t=270
PRESS_272_JOINTS = [-0.074929, -0.711021, 0.281237, -1.791821, 0.010464, 1.377587, 1.276483]  # t=272
PRESS_274_JOINTS = [-0.074684, -0.696285, 0.282653, -1.790804, 0.010717, 1.368938, 1.276614]  # t=274
PRESS_276_JOINTS = [-0.074358, -0.683392, 0.282259, -1.790922, 0.010709, 1.359772, 1.275819]  # t=276
PRESS_278_JOINTS = [-0.073758, -0.671892, 0.281905, -1.790486, 0.010810, 1.352250, 1.274782]  # t=278
PRESS_280_JOINTS = [-0.072629, -0.665162, 0.282474, -1.783944, 0.010296, 1.344019, 1.275200]  # t=280
PRESS_282_JOINTS = [-0.071452, -0.660799, 0.282951, -1.779515, 0.009180, 1.338975, 1.276138]  # t=282
PRESS_284_JOINTS = [-0.070202, -0.658491, 0.283540, -1.777091, 0.008421, 1.337320, 1.277513]  # t=284
PRESS_286_JOINTS = [-0.068875, -0.657787, 0.285879, -1.777876, 0.007762, 1.343512, 1.280877]  # t=286
PRESS_288_JOINTS = [-0.067929, -0.658141, 0.288641, -1.784624, 0.004092, 1.367482, 1.286442]  # t=288
PRESS_290_JOINTS = [-0.066955, -0.663865, 0.289822, -1.796256, -0.002444, 1.403956, 1.291968]  # t=290
PRESS_292_JOINTS = [-0.065331, -0.677085, 0.290200, -1.813698, -0.007609, 1.439565, 1.297011]  # t=292
PRESS_293_JOINTS = [-0.064409, -0.685217, 0.290172, -1.824795, -0.009366, 1.457040, 1.299152]  # t=293
PRESS_294_JOINTS = [-0.063491, -0.693011, 0.290361, -1.838249, -0.010104, 1.473764, 1.300952]  # t=294
PRESS_296_JOINTS = [-0.062041, -0.702744, 0.291476, -1.872068, -0.008483, 1.504239, 1.302987]  # t=296
PRESS_297_JOINTS = [-0.061427, -0.706197, 0.292418, -1.888635, -0.007218, 1.519350, 1.303958]  # t=297
PRESS_298_JOINTS = [-0.060821, -0.710351, 0.292510, -1.895479, -0.006292, 1.530291, 1.304096]  # t=298
PRESS_300_JOINTS = [-0.060279, -0.712096, 0.292651, -1.899175, -0.003859, 1.536035, 1.303653]  # t=300
PRESS_302_JOINTS = [-0.060365, -0.708951, 0.292928, -1.895888, -0.002663, 1.532111, 1.303585]  # t=302
PRESS_304_JOINTS = [-0.060436, -0.706851, 0.292932, -1.893266, -0.002711, 1.528021, 1.303806]  # t=304
PRESS_305_JOINTS = [-0.060451, -0.706188, 0.292684, -1.892506, -0.002673, 1.526055, 1.303773]  # t=305
PRESS_306_JOINTS = [-0.060465, -0.705248, 0.292344, -1.891315, -0.002524, 1.523662, 1.303694]  # t=306
PRESS_308_JOINTS = [-0.060554, -0.702422, 0.292054, -1.887588, -0.002075, 1.518088, 1.303678]  # t=308
PRESS_309_JOINTS = [-0.060603, -0.701622, 0.291907, -1.886430, -0.002189, 1.516234, 1.303681]  # t=309
PRESS_310_JOINTS = [-0.060607, -0.701324, 0.291845, -1.885214, -0.002208, 1.514922, 1.303683]  # t=310
PRESS_311_JOINTS = [-0.060621, -0.701140, 0.291761, -1.883677, -0.002295, 1.513972, 1.303680]  # t=311
RETREAT_313_JOINTS = [-0.060638, -0.700425, 0.291683, -1.881660, -0.002413, 1.512651, 1.303675]  # t=313
RETREAT_315_JOINTS = [-0.060528, -0.701259, 0.291610, -1.880884, -0.002452, 1.510975, 1.303694]  # t=315
RETREAT_316_JOINTS = [-0.060192, -0.704278, 0.291612, -1.880748, -0.002350, 1.507888, 1.303783]  # t=316
RETREAT_317_JOINTS = [-0.059654, -0.709075, 0.291638, -1.881109, -0.002144, 1.504333, 1.304041]  # t=317
RETREAT_319_JOINTS = [-0.058012, -0.724070, 0.291686, -1.884454, -0.001378, 1.496979, 1.305041]  # t=319
RETREAT_321_JOINTS = [-0.055307, -0.749545, 0.291665, -1.891240, 0.000091, 1.487071, 1.306784]  # t=321
RETREAT_323_JOINTS = [-0.050998, -0.791895, 0.288572, -1.896390, 0.004836, 1.466417, 1.310115]  # t=323
RETREAT_325_JOINTS = [-0.045840, -0.846570, 0.283208, -1.899629, 0.009792, 1.437688, 1.314248]  # t=325
RETREAT_327_JOINTS = [-0.040860, -0.903208, 0.277184, -1.900258, 0.015298, 1.406949, 1.317031]  # t=327
RETREAT_329_JOINTS = [-0.036412, -0.958389, 0.268606, -1.904254, 0.020224, 1.380284, 1.315811]  # t=329
RETREAT_330_JOINTS = [-0.034364, -0.985932, 0.262668, -1.909548, 0.021680, 1.370836, 1.313909]  # t=330
RETREAT_331_JOINTS = [-0.032337, -1.014291, 0.254786, -1.917039, 0.022412, 1.364227, 1.311177]  # t=331
RETREAT_332_JOINTS = [-0.030319, -1.043026, 0.244822, -1.927364, 0.022968, 1.360877, 1.307439]  # t=332
RETREAT_333_JOINTS = [-0.028275, -1.072243, 0.232571, -1.939907, 0.023539, 1.359916, 1.302712]  # t=333
RETREAT_335_JOINTS = [-0.024174, -1.131376, 0.202272, -1.968705, 0.024262, 1.361127, 1.289713]  # t=335
RETREAT_337_JOINTS = [-0.021036, -1.184774, 0.167558, -2.000046, 0.022348, 1.366285, 1.271582]  # t=337
RETREAT_339_JOINTS = [-0.019847, -1.224398, 0.130031, -2.030698, 0.013946, 1.375808, 1.246516]  # t=339
RETREAT_341_JOINTS = [-0.020147, -1.253749, 0.089774, -2.054690, -0.000498, 1.383810, 1.216590]  # t=341
RETREAT_343_JOINTS = [-0.021429, -1.277063, 0.048197, -2.070866, -0.018985, 1.387250, 1.183404]  # t=343
RETREAT_345_JOINTS = [-0.023578, -1.294933, 0.007068, -2.081377, -0.038693, 1.389299, 1.149294]  # t=345
RETREAT_346_JOINTS = [-0.024944, -1.302040, -0.013308, -2.085143, -0.048619, 1.390499, 1.132348]  # t=346
APPROACH_000_JOINTS = [-0.018305, -1.043733, -0.008421, -2.258683, 0.038732, 1.521158, 0.671115]  # t=1

# Phase-level helper functions keep the open-loop policy readable while preserving
# the exact primitive execution order used at runtime.

def move_to_control_panel():
    """Approach the appliance control region."""
    moveJoint(APPROACH_000_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_003_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_004_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_005_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_007_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_008_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_012_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_013_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_016_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_018_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_020_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_024_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_028_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_031_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_032_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_036_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_040_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_044_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_045_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_048_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_052_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_054_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_056_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_060_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_064_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_068_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_072_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_076_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)

def press_control():
    """Execute the short interaction path that actuates the control."""
    moveJoint(PRESS_078_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_080_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_082_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_084_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_085_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_086_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_087_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_088_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_090_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_092_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_094_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_096_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_098_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_100_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_102_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_104_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_106_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_107_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_108_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_110_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_112_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_114_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_116_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_117_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_118_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_119_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_120_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_121_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_122_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_124_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_126_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_128_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_130_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_132_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_134_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_136_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_138_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_140_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_142_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_144_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_146_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_148_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_149_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_150_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_152_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_154_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_156_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_158_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_159_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_160_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_162_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_164_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_165_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_166_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_168_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_170_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_172_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_174_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_176_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_178_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_180_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_182_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_184_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_186_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_188_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_190_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_192_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_194_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_195_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_196_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_198_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_200_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_202_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_204_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_206_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_208_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_210_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_212_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_213_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_214_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_216_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_218_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_220_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_222_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_224_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_226_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_228_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_230_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_232_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_234_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_236_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_238_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_240_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_242_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_244_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_246_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_248_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_250_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_252_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_254_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_256_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_258_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_260_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_262_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_264_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_266_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_268_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_270_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_272_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_274_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_276_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_278_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_280_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_282_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_284_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_286_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_288_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_290_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_292_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_293_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_294_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_296_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_297_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_298_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_300_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_302_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_304_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_305_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_306_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_308_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_309_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_310_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_311_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)

def retreat_after_press():
    """Retreat away after the button press interaction."""
    moveJoint(RETREAT_313_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_315_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_316_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_317_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_319_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_321_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_323_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_325_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_327_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_329_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_330_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_331_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_332_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_333_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_335_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_337_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_339_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_341_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_343_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_345_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_346_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)

move_to_control_panel()
press_control()
retreat_after_press()

# Fitting strategy:
# - adaptive per-phase waypoint selection on EE position + quaternion error
# - tight tolerances near descend / lift / place, looser tolerances in transport
# - optional moveC / moveA / segmented moveLinear chains / moveActionSequence when a segment is better represented by a smooth or constrained path
# - GT used only during generation; runtime execution uses this saved policy plus scene artifact

Close the lid blender by securely placing the lid on top.


# Open-loop trajectory-fit action2code policy generated from the RoboCasa GT EE trajectory
# Task: CloseCabinet
# Episode: episode_000000

from primitives import moveJoint, moveLinear, moveC, moveA, moveWholeBodyPath, moveActionSequence, grasp, release, wait

SCENE_ARTIFACT = '../../../artifacts/20260324/CloseCabinet/20260324_205250_close-cabinet_episode_000000_action2code-open-loop-joint_initial-scene.json'
POLICY_METADATA = {
    'policy_kind': 'open_loop_joint',
    'policy_variant': 'open-loop-joint',
    'task_name': 'CloseCabinet',
    'episode_id': 'episode_000000',
    'scene_artifact_path': '../../../artifacts/20260324/CloseCabinet/20260324_205250_close-cabinet_episode_000000_action2code-open-loop-joint_initial-scene.json',
    'fitting_summary_path': '../../../artifacts/20260324/CloseCabinet/20260324_205250_close-cabinet_episode_000000_action2code-open-loop-joint_fitting-summary.json',
    'extracted_pose_metadata_path': '../../../artifacts/20260324/CloseCabinet/20260324_205250_close-cabinet_episode_000000_action2code-open-loop-joint_extracted-pose-metadata.json',
    'stable_grasp_contact_t': 139,
    'stable_release_contact_loss_t': 139,
    'uses_moveC': False,
    'controller_mode': 'whole_body_ik',
}

OBJ_POSE_T0 = pose(x=5.011535, y=-0.326828, z=1.466561, qw=0.924577, qx=-0.122572, qy=0.096919, qz=-0.347477)
GOAL_RECEPTACLE_POSE = pose(x=4.633734, y=-0.543107, z=0.947956, qw=0.979094, qx=0.000001, qy=-0.000035, qz=-0.203411)

APPROACH_003_JOINTS = [-0.048599, -1.030665, -0.035566, -2.288837, 0.028148, 1.534844, 0.677663]  # t=3
APPROACH_005_JOINTS = [-0.046065, -1.064152, -0.039163, -2.290504, 0.026958, 1.524947, 0.677641]  # t=5
APPROACH_006_JOINTS = [-0.044946, -1.090841, -0.041405, -2.295427, 0.026443, 1.522175, 0.677529]  # t=6
APPROACH_009_JOINTS = [-0.043320, -1.209489, -0.046504, -2.326058, 0.024164, 1.517557, 0.684008]  # t=9
APPROACH_010_JOINTS = [-0.043520, -1.257886, -0.048177, -2.340378, 0.022316, 1.521012, 0.688592]  # t=10
APPROACH_012_JOINTS = [-0.044906, -1.364293, -0.050617, -2.371350, 0.017204, 1.530002, 0.701599]  # t=12
APPROACH_015_JOINTS = [-0.048803, -1.531898, -0.051343, -2.413772, 0.007084, 1.549605, 0.726955]  # t=15
APPROACH_018_JOINTS = [-0.055183, -1.685314, -0.052023, -2.442365, -0.015588, 1.576378, 0.761914]  # t=18
APPROACH_020_JOINTS = [-0.060396, -1.767920, -0.055536, -2.451065, -0.040618, 1.598403, 0.786772]  # t=20
APPROACH_021_JOINTS = [-0.063362, -1.764786, -0.058119, -2.425563, -0.054298, 1.602421, 0.798205]  # t=21
APPROACH_023_JOINTS = [-0.069680, -1.762997, -0.066862, -2.357809, -0.086901, 1.585125, 0.818307]  # t=23
APPROACH_024_JOINTS = [-0.072679, -1.762955, -0.073847, -2.323448, -0.105661, 1.576194, 0.826183]  # t=24
APPROACH_025_JOINTS = [-0.075517, -1.762941, -0.083158, -2.289831, -0.126348, 1.568780, 0.832209]  # t=25
APPROACH_027_JOINTS = [-0.080625, -1.762925, -0.107683, -2.226746, -0.171244, 1.558397, 0.838013]  # t=27
APPROACH_029_JOINTS = [-0.084970, -1.762899, -0.137944, -2.168332, -0.216429, 1.554888, 0.836099]  # t=29
APPROACH_030_JOINTS = [-0.086918, -1.762894, -0.155466, -2.140798, -0.239502, 1.553680, 0.831903]  # t=30
APPROACH_033_JOINTS = [-0.091662, -1.762867, -0.214793, -2.062117, -0.303173, 1.558535, 0.807792]  # t=33
APPROACH_036_JOINTS = [-0.094814, -1.762832, -0.279122, -1.993271, -0.352379, 1.577391, 0.772128]  # t=36
APPROACH_038_JOINTS = [-0.095843, -1.762807, -0.323314, -1.954906, -0.378951, 1.599288, 0.744472]  # t=38
APPROACH_039_JOINTS = [-0.095888, -1.761868, -0.345592, -1.939810, -0.391087, 1.612915, 0.730017]  # t=39
APPROACH_040_JOINTS = [-0.095412, -1.759158, -0.367988, -1.928007, -0.402050, 1.629141, 0.715423]  # t=40
APPROACH_041_JOINTS = [-0.094115, -1.754251, -0.390721, -1.919855, -0.410600, 1.647917, 0.700562]  # t=41
APPROACH_042_JOINTS = [-0.091974, -1.747389, -0.413964, -1.914407, -0.416299, 1.668957, 0.685272]  # t=42
APPROACH_045_JOINTS = [-0.083308, -1.721349, -0.486038, -1.898419, -0.421038, 1.738289, 0.636285]  # t=45
APPROACH_048_JOINTS = [-0.074022, -1.690365, -0.554341, -1.877596, -0.410382, 1.809636, 0.586886]  # t=48
APPROACH_051_JOINTS = [-0.069874, -1.662547, -0.603971, -1.857654, -0.382308, 1.864549, 0.547299]  # t=51
APPROACH_054_JOINTS = [-0.070534, -1.640486, -0.641032, -1.846479, -0.349631, 1.907762, 0.517543]  # t=54
APPROACH_055_JOINTS = [-0.070019, -1.631879, -0.653095, -1.845990, -0.339167, 1.924937, 0.508799]  # t=55
APPROACH_057_JOINTS = [-0.067719, -1.612300, -0.676737, -1.850660, -0.319354, 1.962880, 0.492573]  # t=57
APPROACH_060_JOINTS = [-0.063479, -1.580261, -0.705724, -1.867788, -0.289474, 2.027159, 0.475156]  # t=60
PRESS_061_JOINTS = [-0.067237, -1.575684, -0.708743, -1.871965, -0.279959, 2.040413, 0.476829]  # t=61
PRESS_062_JOINTS = [-0.071882, -1.572176, -0.709417, -1.878338, -0.270044, 2.051492, 0.479839]  # t=62
PRESS_063_JOINTS = [-0.075973, -1.568191, -0.709288, -1.887618, -0.259539, 2.062922, 0.482342]  # t=63
PRESS_064_JOINTS = [-0.077515, -1.561835, -0.711053, -1.901453, -0.247822, 2.077289, 0.482262]  # t=64
PRESS_066_JOINTS = [-0.078516, -1.549204, -0.715303, -1.931337, -0.223354, 2.112503, 0.477698]  # t=66
PRESS_067_JOINTS = [-0.078563, -1.543213, -0.717167, -1.947064, -0.211039, 2.132270, 0.473545]  # t=67
PRESS_068_JOINTS = [-0.078204, -1.536968, -0.719015, -1.963427, -0.198706, 2.153919, 0.468696]  # t=68
PRESS_070_JOINTS = [-0.076811, -1.523888, -0.721643, -1.996549, -0.174006, 2.201267, 0.457979]  # t=70
PRESS_072_JOINTS = [-0.075872, -1.511589, -0.724936, -2.027264, -0.151458, 2.247356, 0.445294]  # t=72
PRESS_074_JOINTS = [-0.079467, -1.510897, -0.729785, -2.033530, -0.127681, 2.264337, 0.425499]  # t=74
PRESS_076_JOINTS = [-0.081421, -1.509356, -0.733459, -2.032480, -0.101311, 2.265002, 0.405207]  # t=76
PRESS_077_JOINTS = [-0.082237, -1.508973, -0.734702, -2.031452, -0.087847, 2.262591, 0.395365]  # t=77
PRESS_078_JOINTS = [-0.083022, -1.509241, -0.734849, -2.030961, -0.073736, 2.257614, 0.385233]  # t=78
PRESS_080_JOINTS = [-0.082694, -1.513938, -0.731119, -2.031449, -0.036201, 2.234733, 0.358231]  # t=80
PRESS_082_JOINTS = [-0.081789, -1.523185, -0.722311, -2.033344, 0.007852, 2.196181, 0.327655]  # t=82
PRESS_083_JOINTS = [-0.081961, -1.529184, -0.716634, -2.035748, 0.029581, 2.174823, 0.313441]  # t=83
PRESS_084_JOINTS = [-0.082617, -1.535874, -0.711135, -2.038130, 0.050362, 2.153191, 0.301055]  # t=84
PRESS_086_JOINTS = [-0.084083, -1.549832, -0.698732, -2.045380, 0.091062, 2.110182, 0.279281]  # t=86
PRESS_087_JOINTS = [-0.085135, -1.557199, -0.691820, -2.050437, 0.110339, 2.089722, 0.269564]  # t=87
PRESS_088_JOINTS = [-0.086496, -1.564963, -0.684210, -2.056728, 0.129081, 2.069997, 0.260846]  # t=88
PRESS_090_JOINTS = [-0.089802, -1.581166, -0.667267, -2.073086, 0.165510, 2.034421, 0.246476]  # t=90
PRESS_092_JOINTS = [-0.093921, -1.598960, -0.646576, -2.095753, 0.202341, 2.003064, 0.235715]  # t=92
PRESS_094_JOINTS = [-0.098473, -1.617880, -0.621897, -2.125348, 0.240346, 1.978472, 0.227647]  # t=94
PRESS_096_JOINTS = [-0.102515, -1.635647, -0.592201, -2.160257, 0.280389, 1.962827, 0.222783]  # t=96
PRESS_098_JOINTS = [-0.100666, -1.642842, -0.558340, -2.206860, 0.327868, 1.967355, 0.209644]  # t=98
PRESS_100_JOINTS = [-0.097630, -1.650479, -0.522984, -2.253313, 0.377740, 1.977948, 0.192566]  # t=100
PRESS_102_JOINTS = [-0.095038, -1.658683, -0.484306, -2.298063, 0.425644, 1.994636, 0.176836]  # t=102
PRESS_104_JOINTS = [-0.088011, -1.656375, -0.446456, -2.345841, 0.473944, 2.025020, 0.152327]  # t=104
PRESS_106_JOINTS = [-0.077128, -1.648004, -0.412831, -2.395124, 0.522246, 2.060882, 0.115437]  # t=106
PRESS_108_JOINTS = [-0.065435, -1.640449, -0.384002, -2.443689, 0.566404, 2.092875, 0.072104]  # t=108
PRESS_109_JOINTS = [-0.059292, -1.636401, -0.372410, -2.468765, 0.587070, 2.109686, 0.046903]  # t=109
PRESS_110_JOINTS = [-0.053062, -1.632507, -0.362282, -2.492599, 0.606879, 2.125655, 0.020352]  # t=110
PRESS_112_JOINTS = [-0.039902, -1.621760, -0.343641, -2.534633, 0.645367, 2.158201, -0.034986]  # t=112
PRESS_114_JOINTS = [-0.024728, -1.600827, -0.322876, -2.563338, 0.684054, 2.194762, -0.090607]  # t=114
PRESS_116_JOINTS = [-0.006922, -1.565662, -0.297039, -2.576438, 0.723352, 2.234961, -0.143900]  # t=116
PRESS_118_JOINTS = [0.013722, -1.516878, -0.268913, -2.582268, 0.766464, 2.282300, -0.200351]  # t=118
PRESS_120_JOINTS = [0.036568, -1.460779, -0.240024, -2.585544, 0.817156, 2.341422, -0.268187]  # t=120
PRESS_122_JOINTS = [0.060450, -1.401468, -0.212454, -2.585762, 0.874212, 2.409406, -0.345861]  # t=122
PRESS_124_JOINTS = [0.085437, -1.339010, -0.189987, -2.579663, 0.936763, 2.477970, -0.432562]  # t=124
PRESS_126_JOINTS = [0.112464, -1.273251, -0.173097, -2.566434, 1.008812, 2.542795, -0.533999]  # t=126
PRESS_128_JOINTS = [0.141016, -1.202954, -0.159320, -2.545503, 1.093339, 2.605538, -0.650871]  # t=128
PRESS_130_JOINTS = [0.169405, -1.126503, -0.146833, -2.513162, 1.192147, 2.668431, -0.780380]  # t=130
PRESS_132_JOINTS = [0.195305, -1.044262, -0.135890, -2.466428, 1.306959, 2.727706, -0.921371]  # t=132
PRESS_134_JOINTS = [0.214888, -0.956644, -0.126190, -2.403412, 1.437056, 2.778521, -1.072083]  # t=134
PRESS_136_JOINTS = [0.223255, -0.864942, -0.116910, -2.323944, 1.581631, 2.816408, -1.230279]  # t=136
PRESS_138_JOINTS = [0.215426, -0.771147, -0.105669, -2.237604, 1.736061, 2.839715, -1.388948]  # t=138
PRESS_139_JOINTS = [0.203893, -0.727745, -0.099711, -2.197006, 1.814588, 2.850112, -1.465855]  # t=139
PRESS_140_JOINTS = [0.186648, -0.699960, -0.093982, -2.164745, 1.890431, 2.869738, -1.538872]  # t=140
PRESS_142_JOINTS = [0.143571, -0.665939, -0.063061, -2.110626, 2.025686, 2.943885, -1.660997]  # t=142
PRESS_143_JOINTS = [0.118344, -0.650107, -0.036213, -2.082704, 2.085186, 2.997480, -1.708154]  # t=143
PRESS_144_JOINTS = [0.089650, -0.634596, 0.000832, -2.055321, 2.140708, 3.059725, -1.747523]  # t=144
PRESS_146_JOINTS = [0.013968, -0.596887, 0.093994, -1.985106, 2.224037, 3.214258, -1.791736]  # t=146
PRESS_148_JOINTS = [-0.078713, -0.547186, 0.220357, -1.904600, 2.205402, 3.411525, -1.736064]  # t=148
PRESS_150_JOINTS = [-0.121399, -0.479901, 0.343376, -1.837870, 2.060439, 3.652197, -1.575843]  # t=150
PRESS_151_JOINTS = [-0.120389, -0.437665, 0.389099, -1.810115, 1.980582, 3.770065, -1.490446]  # t=151
PRESS_152_JOINTS = [-0.119781, -0.432952, 0.398707, -1.832166, 1.921900, 3.759981, -1.421019]  # t=152
PRESS_153_JOINTS = [-0.115748, -0.448800, 0.399763, -1.867809, 1.872584, 3.753493, -1.358986]  # t=153
PRESS_154_JOINTS = [-0.108936, -0.462565, 0.398288, -1.900048, 1.824847, 3.751859, -1.301264]  # t=154
APPROACH_000_JOINTS = [-0.050970, -1.019523, -0.033659, -2.290474, 0.029730, 1.546336, 0.676788]  # t=1

# Phase-level helper functions keep the open-loop policy readable while preserving
# the exact primitive execution order used at runtime.

def move_to_control_panel():
    """Approach the appliance control region."""
    moveJoint(APPROACH_000_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_003_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_005_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_006_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_009_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_010_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_012_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_015_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_018_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_020_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_021_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_023_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_024_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_025_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_027_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_029_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_030_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_033_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_036_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_038_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_039_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_040_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_041_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_042_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_045_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_048_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_051_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_054_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_055_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_057_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_060_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)

def press_control():
    """Execute the short interaction path that actuates the control."""
    moveJoint(PRESS_061_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_062_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_063_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_064_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_066_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_067_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_068_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_070_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_072_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_074_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_076_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_077_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_078_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_080_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_082_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_083_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_084_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_086_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_087_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_088_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_090_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_092_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_094_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_096_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_098_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_100_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_102_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_104_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_106_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_108_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_109_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_110_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_112_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_114_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_116_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_118_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_120_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_122_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_124_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_126_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_128_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_130_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_132_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_134_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_136_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_138_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_139_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_140_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_142_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_143_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_144_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_146_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_148_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_150_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_151_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_152_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_153_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_154_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)

move_to_control_panel()
press_control()

# Fitting strategy:
# - adaptive per-phase waypoint selection on EE position + quaternion error
# - tight tolerances near descend / lift / place, looser tolerances in transport
# - optional moveC / moveA / segmented moveLinear chains / moveActionSequence when a segment is better represented by a smooth or constrained path
# - GT used only during generation; runtime execution uses this saved policy plus scene artifact

all fish meat food in_container oven_ready


# Open-loop trajectory-fit action2code policy generated from the RoboCasa GT EE trajectory
# Task: CloseDishwasher
# Episode: episode_000000

from primitives import moveJoint, moveLinear, moveC, moveA, moveWholeBodyPath, moveActionSequence, grasp, release, wait

SCENE_ARTIFACT = '../../../artifacts/20260324/CloseDishwasher/20260324_205251_close-dishwasher_episode_000000_action2code-open-loop-joint_initial-scene.json'
POLICY_METADATA = {
    'policy_kind': 'open_loop_joint',
    'policy_variant': 'open-loop-joint',
    'task_name': 'CloseDishwasher',
    'episode_id': 'episode_000000',
    'scene_artifact_path': '../../../artifacts/20260324/CloseDishwasher/20260324_205251_close-dishwasher_episode_000000_action2code-open-loop-joint_initial-scene.json',
    'fitting_summary_path': '../../../artifacts/20260324/CloseDishwasher/20260324_205251_close-dishwasher_episode_000000_action2code-open-loop-joint_fitting-summary.json',
    'extracted_pose_metadata_path': '../../../artifacts/20260324/CloseDishwasher/20260324_205251_close-dishwasher_episode_000000_action2code-open-loop-joint_extracted-pose-metadata.json',
    'stable_grasp_contact_t': 127,
    'stable_release_contact_loss_t': 127,
    'uses_moveC': False,
    'controller_mode': 'whole_body_ik',
}

OBJ_POSE_T0 = pose(x=float('nan'), y=float('nan'), z=float('nan'), qw=float('nan'), qx=float('nan'), qy=float('nan'), qz=float('nan'))
GOAL_RECEPTACLE_POSE = pose(x=4.114777, y=-3.028331, z=0.938904, qw=0.672271, qx=0.001090, qy=-0.003958, qz=-0.740293)

APPROACH_003_JOINTS = [-0.030889, -1.032442, -0.023810, -2.281348, 0.040262, 1.525696, 0.703331]  # t=3
APPROACH_004_JOINTS = [-0.028273, -1.042804, -0.012382, -2.289096, 0.049210, 1.511163, 0.704340]  # t=4
APPROACH_005_JOINTS = [-0.024855, -1.063976, 0.004752, -2.299761, 0.058241, 1.488392, 0.703226]  # t=5
APPROACH_008_JOINTS = [-0.010066, -1.167524, 0.093954, -2.354893, 0.077520, 1.430933, 0.694916]  # t=8
APPROACH_011_JOINTS = [0.012827, -1.283309, 0.217862, -2.403589, 0.089359, 1.370973, 0.664359]  # t=11
APPROACH_012_JOINTS = [0.022327, -1.318693, 0.264128, -2.417441, 0.094911, 1.353463, 0.650666]  # t=12
APPROACH_013_JOINTS = [0.032814, -1.352679, 0.314012, -2.431437, 0.099801, 1.340618, 0.636336]  # t=13
APPROACH_015_JOINTS = [0.057075, -1.417473, 0.422652, -2.461699, 0.113277, 1.331976, 0.611399]  # t=15
APPROACH_016_JOINTS = [0.071282, -1.449016, 0.480823, -2.477999, 0.123316, 1.335410, 0.601969]  # t=16
APPROACH_019_JOINTS = [0.128762, -1.549152, 0.668876, -2.514187, 0.166154, 1.343976, 0.581188]  # t=19
APPROACH_020_JOINTS = [0.153747, -1.582416, 0.730911, -2.514952, 0.184378, 1.336586, 0.570746]  # t=20
APPROACH_024_JOINTS = [0.257666, -1.667653, 0.931830, -2.471557, 0.264089, 1.297687, 0.513829]  # t=24
APPROACH_025_JOINTS = [0.282528, -1.677931, 0.982392, -2.454431, 0.281629, 1.292296, 0.504920]  # t=25
APPROACH_028_JOINTS = [0.353452, -1.692525, 1.158674, -2.395489, 0.321378, 1.299636, 0.516197]  # t=28
APPROACH_032_JOINTS = [0.418568, -1.655507, 1.371159, -2.307717, 0.355721, 1.358909, 0.583742]  # t=32
APPROACH_033_JOINTS = [0.426462, -1.636364, 1.412563, -2.280080, 0.356990, 1.377449, 0.603956]  # t=33
APPROACH_036_JOINTS = [0.425455, -1.566533, 1.499850, -2.205039, 0.347626, 1.438439, 0.669250]  # t=36
APPROACH_037_JOINTS = [0.420249, -1.542442, 1.518055, -2.189673, 0.340445, 1.456650, 0.691649]  # t=37
APPROACH_040_JOINTS = [0.396120, -1.474092, 1.564253, -2.171072, 0.326439, 1.516616, 0.747765]  # t=40
APPROACH_041_JOINTS = [0.385164, -1.454353, 1.582848, -2.166988, 0.323460, 1.538613, 0.765949]  # t=41
APPROACH_043_JOINTS = [0.359239, -1.420497, 1.627762, -2.157826, 0.321428, 1.583875, 0.805584]  # t=43
APPROACH_044_JOINTS = [0.344480, -1.406364, 1.653306, -2.152627, 0.322448, 1.607073, 0.826795]  # t=44
APPROACH_048_JOINTS = [0.273293, -1.370267, 1.767942, -2.125451, 0.334948, 1.705362, 0.911268]  # t=48
APPROACH_052_JOINTS = [0.178654, -1.372743, 1.881305, -2.073777, 0.350761, 1.808932, 0.971628]  # t=52
APPROACH_056_JOINTS = [0.065998, -1.419289, 1.978751, -1.982973, 0.366918, 1.900748, 0.981028]  # t=56
APPROACH_060_JOINTS = [-0.044417, -1.504906, 2.047934, -1.859793, 0.394181, 1.950136, 0.982877]  # t=60
APPROACH_064_JOINTS = [-0.153363, -1.625303, 2.085317, -1.700700, 0.431582, 1.966872, 0.974220]  # t=64
APPROACH_068_JOINTS = [-0.248465, -1.758033, 2.090510, -1.535592, 0.493244, 1.956015, 0.988539]  # t=68
APPROACH_069_JOINTS = [-0.270205, -1.765617, 2.094505, -1.508226, 0.498712, 1.951689, 0.992940]  # t=69
APPROACH_071_JOINTS = [-0.314666, -1.763098, 2.114848, -1.488341, 0.487448, 1.974100, 0.999770]  # t=71
APPROACH_072_JOINTS = [-0.334195, -1.763070, 2.126264, -1.487857, 0.481624, 1.993927, 1.001319]  # t=72
APPROACH_074_JOINTS = [-0.367919, -1.763062, 2.147812, -1.502445, 0.474951, 2.045719, 0.998753]  # t=74
APPROACH_076_JOINTS = [-0.393205, -1.763045, 2.163690, -1.532871, 0.469247, 2.103317, 0.990996]  # t=76
APPROACH_077_JOINTS = [-0.394605, -1.760988, 2.166996, -1.544261, 0.460522, 2.119502, 0.994391]  # t=77
PRESS_097_JOINTS = [-0.508868, -1.763029, 2.175690, -1.581536, -0.088738, 1.996153, 1.234629]  # t=97
PRESS_113_JOINTS = [-0.641419, -1.763005, 2.026597, -1.709427, 0.136935, 2.158503, 1.063324]  # t=113
PRESS_126_JOINTS = [-0.919682, -1.763041, 1.937925, -1.647116, 0.220034, 2.281735, 0.993140]  # t=126
PRESS_142_JOINTS = [-0.923130, -1.763044, 1.940382, -1.713145, 0.284160, 2.432413, 1.141539]  # t=142
APPROACH_000_JOINTS = [-0.033497, -1.029915, -0.032503, -2.275192, 0.032116, 1.529353, 0.699408]  # t=1

# Phase-level helper functions keep the open-loop policy readable while preserving
# the exact primitive execution order used at runtime.

def move_to_control_panel():
    """Approach the appliance control region."""
    moveJoint(APPROACH_000_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_003_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_004_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_005_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_008_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_011_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_012_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_013_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_015_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_016_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_019_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_020_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_024_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_025_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_028_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_032_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_033_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_036_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_037_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_040_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_041_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_043_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_044_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_048_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_052_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_056_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_060_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_064_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_068_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_069_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_071_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_072_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_074_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_076_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_077_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)

def press_control():
    """Execute the short interaction path that actuates the control."""
    moveJoint(PRESS_097_JOINTS, input_type='joint', steps=20, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_113_JOINTS, input_type='joint', steps=16, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_126_JOINTS, input_type='joint', steps=13, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_142_JOINTS, input_type='joint', steps=16, settle_steps=0, gripper=1.000)

move_to_control_panel()
press_control()

# Fitting strategy:
# - adaptive per-phase waypoint selection on EE position + quaternion error
# - tight tolerances near descend / lift / place, looser tolerances in transport
# - optional moveC / moveA / segmented moveLinear chains / moveActionSequence when a segment is better represented by a smooth or constrained path
# - GT used only during generation; runtime execution uses this saved policy plus scene artifact


# Open-loop trajectory-fit action2code policy generated from the RoboCasa GT EE trajectory
# Task: CloseDrawer
# Episode: episode_000000

from primitives import moveJoint, moveLinear, moveC, moveA, moveWholeBodyPath, moveActionSequence, grasp, release, wait

SCENE_ARTIFACT = '../../../artifacts/20260324/CloseDrawer/20260324_205252_close-drawer_episode_000000_action2code-open-loop-joint_initial-scene.json'
POLICY_METADATA = {
    'policy_kind': 'open_loop_joint',
    'policy_variant': 'open-loop-joint',
    'task_name': 'CloseDrawer',
    'episode_id': 'episode_000000',
    'scene_artifact_path': '../../../artifacts/20260324/CloseDrawer/20260324_205252_close-drawer_episode_000000_action2code-open-loop-joint_initial-scene.json',
    'fitting_summary_path': '../../../artifacts/20260324/CloseDrawer/20260324_205252_close-drawer_episode_000000_action2code-open-loop-joint_fitting-summary.json',
    'extracted_pose_metadata_path': '../../../artifacts/20260324/CloseDrawer/20260324_205252_close-drawer_episode_000000_action2code-open-loop-joint_extracted-pose-metadata.json',
    'stable_grasp_contact_t': 187,
    'stable_release_contact_loss_t': 187,
    'uses_moveC': False,
    'controller_mode': 'whole_body_ik',
}

OBJ_POSE_T0 = pose(x=3.311485, y=-2.844140, z=0.736255, qw=0.721490, qx=0.000163, qy=0.000158, qz=0.692425)
GOAL_RECEPTACLE_POSE = pose(x=2.329933, y=-2.667122, z=0.947955, qw=0.713318, qx=-0.000014, qy=-0.000014, qz=-0.700840)

APPROACH_005_JOINTS = [-0.039742, -1.041528, -0.034553, -2.295304, 0.052049, 1.549461, 0.705016]  # t=5
APPROACH_010_JOINTS = [-0.033970, -1.042708, -0.037854, -2.294979, 0.047958, 1.547045, 0.707716]  # t=10
APPROACH_013_JOINTS = [-0.034276, -1.070706, -0.062246, -2.292772, 0.028010, 1.528809, 0.694407]  # t=13
APPROACH_015_JOINTS = [-0.036334, -1.106662, -0.091743, -2.299021, 0.006514, 1.515731, 0.673678]  # t=15
APPROACH_019_JOINTS = [-0.043817, -1.184590, -0.167365, -2.317359, -0.049195, 1.492914, 0.617234]  # t=19
APPROACH_020_JOINTS = [-0.046345, -1.203545, -0.188683, -2.321062, -0.064900, 1.486788, 0.601110]  # t=20
APPROACH_025_JOINTS = [-0.062011, -1.288312, -0.300840, -2.327318, -0.141164, 1.450957, 0.517428]  # t=25
APPROACH_026_JOINTS = [-0.065741, -1.303451, -0.322923, -2.326122, -0.155750, 1.441076, 0.500689]  # t=26
APPROACH_030_JOINTS = [-0.080542, -1.351213, -0.397952, -2.314296, -0.207904, 1.399299, 0.440245]  # t=30
APPROACH_031_JOINTS = [-0.083833, -1.359302, -0.412807, -2.310590, -0.219153, 1.390596, 0.426972]  # t=31
APPROACH_035_JOINTS = [-0.092153, -1.361647, -0.460667, -2.288540, -0.263164, 1.349019, 0.389069]  # t=35
APPROACH_040_JOINTS = [-0.096074, -1.333140, -0.504584, -2.237781, -0.324901, 1.278818, 0.344482]  # t=40
APPROACH_045_JOINTS = [-0.097208, -1.307960, -0.553008, -2.195287, -0.374743, 1.236108, 0.291181]  # t=45
APPROACH_049_JOINTS = [-0.106198, -1.317799, -0.601570, -2.183221, -0.416635, 1.211241, 0.242481]  # t=49
APPROACH_050_JOINTS = [-0.109509, -1.323383, -0.613875, -2.182844, -0.426603, 1.205782, 0.230733]  # t=50
APPROACH_053_JOINTS = [-0.120243, -1.341238, -0.646494, -2.179446, -0.446314, 1.187910, 0.202657]  # t=53
APPROACH_055_JOINTS = [-0.125056, -1.347596, -0.656626, -2.175159, -0.444407, 1.179635, 0.193221]  # t=55
APPROACH_058_JOINTS = [-0.128702, -1.349233, -0.659163, -2.178414, -0.444064, 1.180622, 0.189273]  # t=58
APPROACH_060_JOINTS = [-0.134015, -1.358716, -0.682628, -2.188375, -0.444235, 1.179162, 0.185608]  # t=60
APPROACH_065_JOINTS = [-0.169284, -1.437572, -0.797091, -2.248757, -0.439054, 1.216045, 0.147161]  # t=65
APPROACH_070_JOINTS = [-0.227281, -1.526157, -0.934918, -2.304468, -0.435050, 1.243807, 0.108931]  # t=70
APPROACH_073_JOINTS = [-0.256885, -1.547246, -1.000411, -2.324068, -0.437039, 1.250663, 0.094244]  # t=73
APPROACH_075_JOINTS = [-0.271949, -1.547885, -1.032443, -2.332637, -0.435464, 1.257091, 0.087852]  # t=75
APPROACH_076_JOINTS = [-0.277952, -1.545000, -1.046375, -2.334261, -0.433088, 1.259879, 0.085084]  # t=76
APPROACH_080_JOINTS = [-0.292642, -1.519221, -1.094043, -2.328440, -0.417590, 1.271000, 0.070023]  # t=80
APPROACH_081_JOINTS = [-0.293904, -1.509860, -1.102892, -2.325686, -0.412132, 1.274253, 0.066895]  # t=81
APPROACH_085_JOINTS = [-0.293053, -1.466871, -1.136831, -2.296548, -0.394913, 1.279453, 0.052682]  # t=85
APPROACH_089_JOINTS = [-0.287506, -1.424371, -1.189329, -2.245929, -0.394365, 1.273467, 0.034495]  # t=89
APPROACH_090_JOINTS = [-0.285509, -1.414757, -1.204772, -2.235121, -0.396293, 1.272124, 0.029265]  # t=90
APPROACH_095_JOINTS = [-0.272979, -1.374573, -1.281108, -2.177713, -0.405620, 1.261364, -0.007838]  # t=95
APPROACH_098_JOINTS = [-0.257162, -1.351660, -1.312948, -2.155055, -0.391661, 1.253137, -0.012377]  # t=98
APPROACH_100_JOINTS = [-0.245119, -1.338098, -1.337317, -2.145639, -0.385719, 1.250873, -0.011765]  # t=100
APPROACH_105_JOINTS = [-0.220409, -1.313805, -1.382866, -2.125812, -0.370709, 1.242842, -0.016710]  # t=105
APPROACH_107_JOINTS = [-0.214917, -1.312803, -1.400928, -2.118181, -0.351000, 1.245856, -0.035573]  # t=107
APPROACH_110_JOINTS = [-0.211695, -1.322474, -1.455112, -2.116098, -0.323233, 1.264917, -0.090119]  # t=110
APPROACH_112_JOINTS = [-0.211906, -1.331127, -1.493360, -2.117019, -0.300902, 1.281806, -0.126955]  # t=112
APPROACH_115_JOINTS = [-0.212129, -1.341766, -1.544403, -2.126072, -0.266332, 1.314008, -0.167033]  # t=115
APPROACH_116_JOINTS = [-0.212198, -1.343712, -1.558317, -2.130325, -0.257001, 1.324032, -0.175281]  # t=116
APPROACH_120_JOINTS = [-0.210631, -1.337848, -1.581310, -2.140875, -0.229825, 1.338656, -0.166201]  # t=120
APPROACH_125_JOINTS = [-0.192293, -1.325223, -1.592219, -2.178004, -0.197565, 1.383430, -0.130556]  # t=125
APPROACH_126_JOINTS = [-0.186248, -1.322612, -1.593934, -2.191411, -0.192162, 1.401675, -0.122974]  # t=126
APPROACH_130_JOINTS = [-0.157606, -1.311228, -1.606956, -2.254873, -0.174454, 1.494956, -0.100613]  # t=130
APPROACH_135_JOINTS = [-0.116390, -1.290792, -1.625770, -2.325213, -0.152076, 1.610178, -0.086534]  # t=135
APPROACH_137_JOINTS = [-0.099415, -1.280985, -1.633904, -2.344376, -0.142141, 1.645496, -0.083967]  # t=137
APPROACH_139_JOINTS = [-0.084922, -1.270489, -1.645380, -2.353026, -0.134157, 1.667522, -0.084164]  # t=139
APPROACH_140_JOINTS = [-0.078875, -1.265314, -1.653893, -2.350665, -0.131389, 1.672321, -0.085735]  # t=140
APPROACH_141_JOINTS = [-0.072752, -1.260590, -1.664125, -2.345045, -0.128459, 1.673796, -0.087177]  # t=141
APPROACH_145_JOINTS = [-0.052955, -1.248685, -1.725623, -2.283375, -0.129882, 1.641803, -0.104841]  # t=145
APPROACH_148_JOINTS = [-0.029282, -1.254762, -1.769280, -2.245108, -0.133771, 1.636991, -0.111685]  # t=148
APPROACH_150_JOINTS = [-0.010727, -1.264791, -1.791984, -2.225665, -0.137227, 1.641322, -0.108317]  # t=150
APPROACH_151_JOINTS = [-0.001403, -1.271303, -1.803940, -2.217706, -0.140766, 1.645687, -0.105932]  # t=151
APPROACH_155_JOINTS = [0.043712, -1.308765, -1.849795, -2.210681, -0.163259, 1.698526, -0.093139]  # t=155
APPROACH_156_JOINTS = [0.056092, -1.319850, -1.861798, -2.211544, -0.171178, 1.717519, -0.089355]  # t=156
APPROACH_160_JOINTS = [0.104162, -1.367943, -1.923408, -2.209494, -0.219466, 1.794157, -0.092264]  # t=160
APPROACH_161_JOINTS = [0.116239, -1.381079, -1.936879, -2.209445, -0.230057, 1.813805, -0.092393]  # t=161
APPROACH_165_JOINTS = [0.171541, -1.438175, -1.976877, -2.218775, -0.267922, 1.913610, -0.077537]  # t=165
APPROACH_170_JOINTS = [0.267922, -1.524428, -2.022584, -2.234719, -0.323894, 2.088276, -0.039964]  # t=170
APPROACH_175_JOINTS = [0.380047, -1.613588, -2.055438, -2.228000, -0.381330, 2.258943, 0.007404]  # t=175
APPROACH_180_JOINTS = [0.502380, -1.706796, -2.080257, -2.196632, -0.442385, 2.419339, 0.055086]  # t=180
APPROACH_185_JOINTS = [0.649303, -1.763089, -2.085852, -2.164521, -0.486498, 2.600300, 0.115132]  # t=185
APPROACH_186_JOINTS = [0.685192, -1.762989, -2.085032, -2.161813, -0.486479, 2.646008, 0.128285]  # t=186
APPROACH_187_JOINTS = [0.709178, -1.759594, -2.085705, -2.156204, -0.485063, 2.673549, 0.130848]  # t=187
PRESS_188_JOINTS = [0.718518, -1.757533, -2.083977, -2.151078, -0.479340, 2.672702, 0.120546]  # t=188
PRESS_189_JOINTS = [0.722492, -1.761372, -2.079552, -2.138779, -0.473374, 2.647868, 0.106631]  # t=189
PRESS_190_JOINTS = [0.725849, -1.763469, -2.072322, -2.119186, -0.468146, 2.600578, 0.094876]  # t=190
PRESS_191_JOINTS = [0.728696, -1.762943, -2.063537, -2.093851, -0.462716, 2.537912, 0.086960]  # t=191
PRESS_192_JOINTS = [0.733489, -1.763011, -2.054667, -2.063948, -0.454115, 2.476034, 0.085730]  # t=192
PRESS_193_JOINTS = [0.740913, -1.762965, -2.045893, -2.035325, -0.442932, 2.432758, 0.086841]  # t=193
PRESS_194_JOINTS = [0.746314, -1.762876, -2.037657, -2.012032, -0.434313, 2.400872, 0.086652]  # t=194
PRESS_195_JOINTS = [0.747661, -1.762853, -2.030811, -1.993125, -0.427575, 2.371936, 0.086564]  # t=195
PRESS_196_JOINTS = [0.743610, -1.762270, -2.026093, -1.978435, -0.421148, 2.340847, 0.087867]  # t=196
PRESS_197_JOINTS = [0.734646, -1.761900, -2.023079, -1.966954, -0.415907, 2.308967, 0.089589]  # t=197
PRESS_198_JOINTS = [0.722538, -1.762023, -2.021212, -1.957966, -0.412323, 2.278501, 0.090924]  # t=198
PRESS_199_JOINTS = [0.705420, -1.761721, -2.019269, -1.951792, -0.406963, 2.245664, 0.088781]  # t=199
PRESS_200_JOINTS = [0.684015, -1.761431, -2.016548, -1.948414, -0.398907, 2.212372, 0.082220]  # t=200
APPROACH_000_JOINTS = [-0.044247, -1.041620, -0.032867, -2.295311, 0.054272, 1.549349, 0.702722]  # t=1

# Phase-level helper functions keep the open-loop policy readable while preserving
# the exact primitive execution order used at runtime.

def move_to_control_panel():
    """Approach the appliance control region."""
    moveJoint(APPROACH_000_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_005_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_010_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_013_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_015_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_019_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_020_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_025_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_026_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_030_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_031_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_035_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_040_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_045_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_049_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_050_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_053_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_055_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_058_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_060_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_065_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_070_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_073_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_075_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_076_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_080_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_081_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_085_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_089_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_090_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_095_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_098_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_100_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_105_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_107_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_110_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_112_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_115_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_116_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_120_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_125_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_126_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_130_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_135_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_137_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_139_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_140_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_141_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_145_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_148_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_150_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_151_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_155_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_156_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_160_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_161_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_165_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_170_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_175_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_180_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_185_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_186_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_187_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)

def press_control():
    """Execute the short interaction path that actuates the control."""
    moveJoint(PRESS_188_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_189_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_190_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_191_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_192_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_193_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_194_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_195_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_196_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_197_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_198_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_199_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_200_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)

move_to_control_panel()
press_control()

# Fitting strategy:
# - adaptive per-phase waypoint selection on EE position + quaternion error
# - tight tolerances near descend / lift / place, looser tolerances in transport
# - optional moveC / moveA / segmented moveLinear chains / moveActionSequence when a segment is better represented by a smooth or constrained path
# - GT used only during generation; runtime execution uses this saved policy plus scene artifact


# Open-loop trajectory-fit action2code policy generated from the RoboCasa GT EE trajectory
# Task: CloseElectricKettleLid
# Episode: episode_000000

from primitives import moveJoint, moveLinear, moveC, moveA, moveWholeBodyPath, moveActionSequence, grasp, release, wait

SCENE_ARTIFACT = '../../../artifacts/20260324/CloseElectricKettleLid/20260324_205253_close-electric-kettle-lid_episode_000000_action2code-open-loop-joint_initial-scene.json'
POLICY_METADATA = {
    'policy_kind': 'open_loop_joint',
    'policy_variant': 'open-loop-joint',
    'task_name': 'CloseElectricKettleLid',
    'episode_id': 'episode_000000',
    'scene_artifact_path': '../../../artifacts/20260324/CloseElectricKettleLid/20260324_205253_close-electric-kettle-lid_episode_000000_action2code-open-loop-joint_initial-scene.json',
    'fitting_summary_path': '../../../artifacts/20260324/CloseElectricKettleLid/20260324_205253_close-electric-kettle-lid_episode_000000_action2code-open-loop-joint_fitting-summary.json',
    'extracted_pose_metadata_path': '../../../artifacts/20260324/CloseElectricKettleLid/20260324_205253_close-electric-kettle-lid_episode_000000_action2code-open-loop-joint_extracted-pose-metadata.json',
    'stable_grasp_contact_t': 45,
    'stable_release_contact_loss_t': 45,
    'uses_moveC': False,
    'controller_mode': 'whole_body_ik',
}

OBJ_POSE_T0 = pose(x=float('nan'), y=float('nan'), z=float('nan'), qw=float('nan'), qx=float('nan'), qy=float('nan'), qz=float('nan'))
GOAL_RECEPTACLE_POSE = pose(x=float('nan'), y=float('nan'), z=float('nan'), qw=float('nan'), qx=float('nan'), qy=float('nan'), qz=float('nan'))

APPROACH_002_JOINTS = [-0.007994, -1.051319, -0.023417, -2.286476, 0.027760, 1.512055, 0.710257]  # t=2
APPROACH_004_JOINTS = [-0.008855, -1.062445, -0.023359, -2.286813, 0.027803, 1.500917, 0.710192]  # t=4
APPROACH_005_JOINTS = [-0.009284, -1.065517, -0.023246, -2.289923, 0.027870, 1.501116, 0.710131]  # t=5
APPROACH_006_JOINTS = [-0.009800, -1.073349, -0.024591, -2.293474, 0.027125, 1.501779, 0.707135]  # t=6
APPROACH_008_JOINTS = [-0.010633, -1.104658, -0.038271, -2.311884, 0.022340, 1.524503, 0.675419]  # t=8
APPROACH_010_JOINTS = [-0.011601, -1.142796, -0.084143, -2.340727, 0.015274, 1.577876, 0.598188]  # t=10
APPROACH_012_JOINTS = [-0.011716, -1.185910, -0.154104, -2.374556, 0.021165, 1.636965, 0.489598]  # t=12
APPROACH_013_JOINTS = [-0.011247, -1.205231, -0.190366, -2.392599, 0.030887, 1.665116, 0.432818]  # t=13
APPROACH_014_JOINTS = [-0.010356, -1.222592, -0.225759, -2.410176, 0.044567, 1.689144, 0.375145]  # t=14
APPROACH_015_JOINTS = [-0.008769, -1.235804, -0.257903, -2.427678, 0.061455, 1.709627, 0.318406]  # t=15
APPROACH_016_JOINTS = [-0.006291, -1.243006, -0.284152, -2.444949, 0.081014, 1.728747, 0.266225]  # t=16
APPROACH_018_JOINTS = [0.001088, -1.241626, -0.321737, -2.477686, 0.125405, 1.762089, 0.173804]  # t=18
APPROACH_020_JOINTS = [0.010139, -1.229399, -0.352726, -2.505907, 0.172396, 1.781723, 0.084157]  # t=20
APPROACH_022_JOINTS = [0.021950, -1.206116, -0.375481, -2.528286, 0.222849, 1.794960, -0.005244]  # t=22
APPROACH_023_JOINTS = [0.028564, -1.190866, -0.387249, -2.534991, 0.248291, 1.798373, -0.051308]  # t=23
APPROACH_024_JOINTS = [0.035316, -1.173734, -0.400012, -2.537860, 0.271653, 1.797906, -0.098644]  # t=24
APPROACH_026_JOINTS = [0.050147, -1.132715, -0.426871, -2.533655, 0.316277, 1.788937, -0.194651]  # t=26
APPROACH_028_JOINTS = [0.067614, -1.080954, -0.451195, -2.519841, 0.359452, 1.775254, -0.288398]  # t=28
APPROACH_030_JOINTS = [0.086010, -1.025696, -0.457536, -2.502832, 0.401115, 1.763640, -0.358369]  # t=30
APPROACH_032_JOINTS = [0.103455, -0.975651, -0.441689, -2.491962, 0.443610, 1.758969, -0.403163]  # t=32
APPROACH_034_JOINTS = [0.114994, -0.943869, -0.411654, -2.487218, 0.480474, 1.752293, -0.422568]  # t=34
PRESS_035_JOINTS = [0.117773, -0.933069, -0.398226, -2.486384, 0.493702, 1.751518, -0.427533]  # t=35
PRESS_036_JOINTS = [0.120366, -0.922496, -0.382439, -2.488740, 0.508631, 1.755776, -0.431469]  # t=36
PRESS_037_JOINTS = [0.122578, -0.912930, -0.365429, -2.493445, 0.524117, 1.762276, -0.435214]  # t=37
PRESS_038_JOINTS = [0.124322, -0.904492, -0.347925, -2.500555, 0.539566, 1.770293, -0.439287]  # t=38
PRESS_040_JOINTS = [0.126526, -0.887985, -0.314156, -2.519095, 0.569250, 1.794429, -0.449823]  # t=40
PRESS_042_JOINTS = [0.127620, -0.871612, -0.283115, -2.542716, 0.597594, 1.822392, -0.464980]  # t=42
PRESS_043_JOINTS = [0.127489, -0.863201, -0.269974, -2.557317, 0.610237, 1.839082, -0.474932]  # t=43
PRESS_044_JOINTS = [0.126638, -0.856400, -0.257650, -2.570561, 0.618843, 1.855206, -0.484262]  # t=44
PRESS_045_JOINTS = [0.125571, -0.850702, -0.243209, -2.583193, 0.623514, 1.871406, -0.491320]  # t=45
PRESS_046_JOINTS = [0.123038, -0.849436, -0.230750, -2.584330, 0.620782, 1.882366, -0.492585]  # t=46
PRESS_048_JOINTS = [0.116957, -0.848267, -0.202331, -2.579585, 0.598765, 1.892982, -0.480973]  # t=48
PRESS_050_JOINTS = [0.109957, -0.849083, -0.175325, -2.574084, 0.565381, 1.897967, -0.464975]  # t=50
PRESS_052_JOINTS = [0.103747, -0.849477, -0.150072, -2.568861, 0.533607, 1.902792, -0.448225]  # t=52
PRESS_054_JOINTS = [0.098311, -0.851597, -0.126681, -2.565443, 0.503241, 1.908080, -0.433757]  # t=54
PRESS_056_JOINTS = [0.093850, -0.856733, -0.108137, -2.566219, 0.480972, 1.916128, -0.425762]  # t=56
PRESS_057_JOINTS = [0.092114, -0.859436, -0.103519, -2.566863, 0.477341, 1.917569, -0.423337]  # t=57
RETREAT_060_JOINTS = [0.088649, -0.863297, -0.098544, -2.569047, 0.478153, 1.918824, -0.421903]  # t=60
APPROACH_000_JOINTS = [-0.007665, -1.047581, -0.023419, -2.286876, 0.027752, 1.517545, 0.710290]  # t=1

# Phase-level helper functions keep the open-loop policy readable while preserving
# the exact primitive execution order used at runtime.

def move_to_control_panel():
    """Approach the appliance control region."""
    moveJoint(APPROACH_000_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_002_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_004_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_005_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_006_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_008_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_010_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_012_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_013_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_014_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_015_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_016_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_018_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_020_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_022_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_023_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_024_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_026_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_028_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_030_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_032_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_034_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)

def press_control():
    """Execute the short interaction path that actuates the control."""
    moveJoint(PRESS_035_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_036_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_037_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_038_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_040_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_042_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_043_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_044_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_045_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_046_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_048_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_050_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_052_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_054_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_056_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_057_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)

def retreat_after_press():
    """Retreat away after the button press interaction."""
    moveJoint(RETREAT_060_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)

move_to_control_panel()
press_control()
retreat_after_press()

# Fitting strategy:
# - adaptive per-phase waypoint selection on EE position + quaternion error
# - tight tolerances near descend / lift / place, looser tolerances in transport
# - optional moveC / moveA / segmented moveLinear chains / moveActionSequence when a segment is better represented by a smooth or constrained path
# - GT used only during generation; runtime execution uses this saved policy plus scene artifact