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

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

SCENE_ARTIFACT = '../../../artifacts/20260324/PickPlaceToasterToCounter/20260324_205334_pick-place-toaster-to-counter_episode_000000_action2code-open-loop-joint_initial-scene.json'
POLICY_METADATA = {
    'policy_kind': 'open_loop_joint',
    'policy_variant': 'open-loop-joint',
    'task_name': 'PickPlaceToasterToCounter',
    'episode_id': 'episode_000000',
    'scene_artifact_path': '../../../artifacts/20260324/PickPlaceToasterToCounter/20260324_205334_pick-place-toaster-to-counter_episode_000000_action2code-open-loop-joint_initial-scene.json',
    'fitting_summary_path': '../../../artifacts/20260324/PickPlaceToasterToCounter/20260324_205334_pick-place-toaster-to-counter_episode_000000_action2code-open-loop-joint_fitting-summary.json',
    'extracted_pose_metadata_path': '../../../artifacts/20260324/PickPlaceToasterToCounter/20260324_205334_pick-place-toaster-to-counter_episode_000000_action2code-open-loop-joint_extracted-pose-metadata.json',
    'stable_grasp_contact_t': 109,
    'stable_release_contact_loss_t': 271,
    'uses_moveC': False,
    'controller_mode': 'whole_body_ik',
}

OBJ_POSE_T0 = pose(x=0.465153, y=-0.242034, z=1.080905, qw=1.000000, qx=0.000000, qy=0.000005, qz=0.000000)
GOAL_RECEPTACLE_POSE = pose(x=0.180522, y=-0.464177, z=0.945027, qw=0.954857, qx=-0.120464, qy=0.096689, qz=0.253747)

APPROACH_005_JOINTS = [-0.040281, -1.069696, 0.009711, -2.305087, 0.028936, 1.495986, 0.693381]  # t=5
APPROACH_010_JOINTS = [-0.030311, -1.129598, 0.000713, -2.340251, 0.027130, 1.471019, 0.671973]  # t=10
APPROACH_015_JOINTS = [-0.025444, -1.258958, -0.012487, -2.459531, 0.021533, 1.638361, 0.660834]  # t=15
APPROACH_018_JOINTS = [-0.023014, -1.354657, -0.015959, -2.545582, 0.023910, 1.760438, 0.650861]  # t=18
APPROACH_020_JOINTS = [-0.021369, -1.415491, -0.018281, -2.603902, 0.027538, 1.842742, 0.640696]  # t=20
APPROACH_023_JOINTS = [-0.019444, -1.482089, -0.021667, -2.689435, 0.033060, 1.963739, 0.626195]  # t=23
APPROACH_025_JOINTS = [-0.018770, -1.503245, -0.021878, -2.738410, 0.035157, 2.041121, 0.621558]  # t=25
APPROACH_030_JOINTS = [-0.016900, -1.481476, -0.018619, -2.817923, 0.039394, 2.209703, 0.618711]  # t=30
APPROACH_031_JOINTS = [-0.016207, -1.461266, -0.017606, -2.827030, 0.040606, 2.247047, 0.618277]  # t=31
APPROACH_035_JOINTS = [-0.012840, -1.355983, -0.014190, -2.838730, 0.045542, 2.384443, 0.616031]  # t=35
APPROACH_040_JOINTS = [-0.008566, -1.183603, -0.010616, -2.814714, 0.050085, 2.545425, 0.615222]  # t=40
APPROACH_045_JOINTS = [-0.016331, -0.977320, -0.000433, -2.747725, 0.032075, 2.672020, 0.650689]  # t=45
APPROACH_048_JOINTS = [-0.030899, -0.891109, 0.004533, -2.702494, 0.003716, 2.684162, 0.693993]  # t=48
APPROACH_050_JOINTS = [-0.035262, -0.856602, 0.010599, -2.674676, -0.007276, 2.654168, 0.712378]  # t=50
APPROACH_052_JOINTS = [-0.035868, -0.821773, 0.011521, -2.642219, -0.010494, 2.609828, 0.715813]  # t=52
APPROACH_055_JOINTS = [-0.036271, -0.763785, 0.005556, -2.593785, -0.013580, 2.565767, 0.712631]  # t=55
APPROACH_060_JOINTS = [-0.033802, -0.701095, 0.001015, -2.560779, -0.014012, 2.569485, 0.710574]  # t=60
APPROACH_065_JOINTS = [-0.031398, -0.639308, -0.000859, -2.571527, -0.013600, 2.631093, 0.711831]  # t=65
APPROACH_070_JOINTS = [-0.030534, -0.575845, -0.001428, -2.565869, -0.014866, 2.701449, 0.712838]  # t=70
APPROACH_075_JOINTS = [-0.029684, -0.504701, -0.000563, -2.530917, -0.015847, 2.739604, 0.714371]  # t=75
APPROACH_080_JOINTS = [-0.028753, -0.454855, 0.004002, -2.522695, -0.019416, 2.774671, 0.721809]  # t=80
APPROACH_083_JOINTS = [-0.028654, -0.418512, 0.006562, -2.517046, -0.022671, 2.805003, 0.727110]  # t=83
DESCEND_085_JOINTS = [-0.028699, -0.391395, 0.007496, -2.510809, -0.025073, 2.826186, 0.730239]  # t=85
DESCEND_087_JOINTS = [-0.028786, -0.357421, 0.007522, -2.501950, -0.027259, 2.850207, 0.732278]  # t=87
DESCEND_088_JOINTS = [-0.028890, -0.340040, 0.007444, -2.497475, -0.028366, 2.863141, 0.733165]  # t=88
DESCEND_089_JOINTS = [-0.029171, -0.329961, 0.007264, -2.490393, -0.029915, 2.872238, 0.734757]  # t=89
DESCEND_091_JOINTS = [-0.029466, -0.307911, 0.007304, -2.471190, -0.032781, 2.880926, 0.738072]  # t=91
DESCEND_093_JOINTS = [-0.029536, -0.284259, 0.007383, -2.448221, -0.035269, 2.883463, 0.740947]  # t=93
DESCEND_095_JOINTS = [-0.029469, -0.261760, 0.007411, -2.424888, -0.037265, 2.883355, 0.743186]  # t=95
DESCEND_097_JOINTS = [-0.029276, -0.243792, 0.007338, -2.405436, -0.038792, 2.881267, 0.744851]  # t=97
DESCEND_099_JOINTS = [-0.028104, -0.237549, 0.007778, -2.397079, -0.036313, 2.876449, 0.746215]  # t=99
DESCEND_100_JOINTS = [-0.027116, -0.235697, 0.007814, -2.394475, -0.032881, 2.875029, 0.746231]  # t=100
DESCEND_101_JOINTS = [-0.026072, -0.234055, 0.007521, -2.392194, -0.028672, 2.874076, 0.745698]  # t=101
DESCEND_102_JOINTS = [-0.025056, -0.232515, 0.006886, -2.390108, -0.024120, 2.873403, 0.744429]  # t=102
DESCEND_103_JOINTS = [-0.023994, -0.230924, 0.006016, -2.387992, -0.018863, 2.872965, 0.742499]  # t=103
DESCEND_105_JOINTS = [-0.022044, -0.227058, 0.003214, -2.383110, -0.007709, 2.872487, 0.736193]  # t=105
DESCEND_107_JOINTS = [-0.020291, -0.222806, -0.000237, -2.377773, 0.003507, 2.871949, 0.727683]  # t=107
DESCEND_108_JOINTS = [-0.019486, -0.220535, -0.001966, -2.374960, 0.008865, 2.871688, 0.723119]  # t=108
GRASP_HOLD_109_JOINTS = [-0.018687, -0.218321, -0.003587, -2.372224, 0.014217, 2.871353, 0.718576]  # t=109
LIFT_110_JOINTS = [-0.017827, -0.216541, -0.004322, -2.369945, 0.018617, 2.870774, 0.714679]  # t=110
LIFT_111_JOINTS = [-0.017124, -0.215165, -0.004514, -2.368098, 0.021222, 2.870145, 0.712101]  # t=111
LIFT_112_JOINTS = [-0.016686, -0.213925, -0.004670, -2.366579, 0.022454, 2.869617, 0.710958]  # t=112
LIFT_113_JOINTS = [-0.016394, -0.213462, -0.004734, -2.365855, 0.022949, 2.868978, 0.710684]  # t=113
LIFT_114_JOINTS = [-0.016191, -0.213448, -0.004730, -2.365676, 0.023031, 2.868639, 0.710695]  # t=114
LIFT_115_JOINTS = [-0.016023, -0.213467, -0.004712, -2.365674, 0.023032, 2.868587, 0.710724]  # t=115
LIFT_116_JOINTS = [-0.015865, -0.213522, -0.004683, -2.365713, 0.023032, 2.868712, 0.710755]  # t=116
LIFT_117_JOINTS = [-0.015660, -0.213873, -0.004570, -2.365633, 0.023196, 2.872687, 0.710794]  # t=117
LIFT_118_JOINTS = [-0.015397, -0.215087, -0.004403, -2.366279, 0.023566, 2.881662, 0.710796]  # t=118
LIFT_119_JOINTS = [-0.015096, -0.220205, -0.004217, -2.369655, 0.024131, 2.893480, 0.710815]  # t=119
LIFT_120_JOINTS = [-0.014795, -0.230153, -0.004123, -2.376762, 0.024817, 2.906849, 0.710798]  # t=120
LIFT_121_JOINTS = [-0.014477, -0.243386, -0.004064, -2.386701, 0.025611, 2.921504, 0.710709]  # t=121
LIFT_122_JOINTS = [-0.014139, -0.258016, -0.004004, -2.397849, 0.026489, 2.937305, 0.710547]  # t=122
LIFT_123_JOINTS = [-0.013786, -0.273049, -0.003942, -2.409309, 0.027422, 2.953647, 0.710331]  # t=123
LIFT_124_JOINTS = [-0.013431, -0.288526, -0.003882, -2.420767, 0.028374, 2.969760, 0.710080]  # t=124
LIFT_125_JOINTS = [-0.013080, -0.304752, -0.003828, -2.432058, 0.029319, 2.985089, 0.709814]  # t=125
LIFT_126_JOINTS = [-0.012746, -0.321599, -0.003787, -2.442601, 0.030214, 2.999122, 0.709553]  # t=126
LIFT_127_JOINTS = [-0.012447, -0.338327, -0.003768, -2.451830, 0.031007, 3.011048, 0.709321]  # t=127
TRANSPORT_130_JOINTS = [-0.011952, -0.384497, -0.003708, -2.467265, 0.032400, 3.029958, 0.709078]  # t=130
TRANSPORT_131_JOINTS = [-0.011965, -0.398144, -0.003686, -2.468050, 0.032484, 3.029407, 0.709101]  # t=131
TRANSPORT_133_JOINTS = [-0.012255, -0.425989, -0.003683, -2.467641, 0.032484, 3.018866, 0.709104]  # t=133
TRANSPORT_135_JOINTS = [-0.012882, -0.457767, -0.003685, -2.468209, 0.032423, 2.998140, 0.709100]  # t=135
TRANSPORT_136_JOINTS = [-0.013303, -0.475944, -0.003687, -2.469365, 0.032313, 2.984543, 0.709098]  # t=136
TRANSPORT_139_JOINTS = [-0.015363, -0.542190, -0.003819, -2.478201, 0.030194, 2.932272, 0.708935]  # t=139
TRANSPORT_142_JOINTS = [-0.020548, -0.627516, -0.003755, -2.503234, 0.018431, 2.870736, 0.707828]  # t=142
TRANSPORT_143_JOINTS = [-0.023486, -0.657373, -0.003245, -2.513079, 0.010303, 2.850571, 0.707340]  # t=143
TRANSPORT_145_JOINTS = [-0.030241, -0.721003, -0.000349, -2.535534, -0.009781, 2.809297, 0.707592]  # t=145
TRANSPORT_147_JOINTS = [-0.036676, -0.787635, 0.007731, -2.560067, -0.031749, 2.767512, 0.711234]  # t=147
TRANSPORT_148_JOINTS = [-0.039451, -0.821379, 0.014609, -2.572668, -0.042816, 2.746601, 0.715490]  # t=148
TRANSPORT_151_JOINTS = [-0.043434, -0.923466, 0.048263, -2.609190, -0.074074, 2.683811, 0.729910]  # t=151
TRANSPORT_154_JOINTS = [-0.036209, -1.019290, 0.093345, -2.633109, -0.092688, 2.609288, 0.722977]  # t=154
TRANSPORT_155_JOINTS = [-0.031004, -1.047867, 0.109528, -2.636453, -0.094309, 2.579639, 0.714987]  # t=155
TRANSPORT_157_JOINTS = [-0.018271, -1.100338, 0.143739, -2.636214, -0.093733, 2.515259, 0.695891]  # t=157
TRANSPORT_159_JOINTS = [-0.003314, -1.145019, 0.181624, -2.630362, -0.089176, 2.448559, 0.675916]  # t=159
TRANSPORT_160_JOINTS = [0.004527, -1.164044, 0.202303, -2.626502, -0.085699, 2.415843, 0.667376]  # t=160
TRANSPORT_163_JOINTS = [0.030272, -1.208694, 0.270225, -2.611387, -0.065947, 2.316014, 0.642865]  # t=163
TRANSPORT_166_JOINTS = [0.056454, -1.230714, 0.340130, -2.581800, -0.033601, 2.217043, 0.615703]  # t=166
TRANSPORT_167_JOINTS = [0.064210, -1.232764, 0.363568, -2.568385, -0.022327, 2.184619, 0.606866]  # t=167
TRANSPORT_169_JOINTS = [0.074927, -1.225484, 0.405184, -2.538283, -0.006569, 2.121219, 0.588442]  # t=169
TRANSPORT_171_JOINTS = [0.077020, -1.200995, 0.436717, -2.504279, -0.007404, 2.060320, 0.563628]  # t=171
TRANSPORT_172_JOINTS = [0.076360, -1.183877, 0.452258, -2.484122, -0.010740, 2.028061, 0.547349]  # t=172
TRANSPORT_175_JOINTS = [0.069130, -1.119474, 0.502920, -2.411076, -0.026670, 1.921011, 0.498267]  # t=175
TRANSPORT_178_JOINTS = [0.054706, -1.038386, 0.568925, -2.334731, -0.046646, 1.816526, 0.461212]  # t=178
TRANSPORT_179_JOINTS = [0.048334, -1.008118, 0.594982, -2.309054, -0.053733, 1.785787, 0.452140]  # t=179
TRANSPORT_181_JOINTS = [0.033653, -0.945756, 0.653644, -2.260057, -0.066358, 1.734581, 0.446277]  # t=181
TRANSPORT_183_JOINTS = [0.017786, -0.887430, 0.701561, -2.238145, -0.070783, 1.715556, 0.452071]  # t=183
TRANSPORT_184_JOINTS = [0.011303, -0.864718, 0.720415, -2.236212, -0.072831, 1.713908, 0.455258]  # t=184
TRANSPORT_187_JOINTS = [-0.003162, -0.813352, 0.769578, -2.251387, -0.075443, 1.734903, 0.469011]  # t=187
TRANSPORT_190_JOINTS = [-0.014997, -0.777450, 0.804141, -2.284784, -0.087126, 1.786911, 0.487956]  # t=190
TRANSPORT_191_JOINTS = [-0.018227, -0.767555, 0.813068, -2.296797, -0.090703, 1.806121, 0.494250]  # t=191
TRANSPORT_193_JOINTS = [-0.024002, -0.749823, 0.827442, -2.318514, -0.096819, 1.842810, 0.508600]  # t=193
TRANSPORT_195_JOINTS = [-0.030222, -0.734026, 0.836926, -2.336257, -0.107934, 1.878076, 0.525612]  # t=195
TRANSPORT_196_JOINTS = [-0.033673, -0.726726, 0.840844, -2.343779, -0.116874, 1.897529, 0.535913]  # t=196
TRANSPORT_199_JOINTS = [-0.048398, -0.697564, 0.859493, -2.369161, -0.155442, 1.977481, 0.582132]  # t=199
TRANSPORT_202_JOINTS = [-0.063923, -0.672151, 0.885791, -2.394719, -0.209146, 2.053521, 0.651474]  # t=202
TRANSPORT_203_JOINTS = [-0.067891, -0.665887, 0.894303, -2.402226, -0.225677, 2.073042, 0.674240]  # t=203
TRANSPORT_205_JOINTS = [-0.070990, -0.657518, 0.909896, -2.411205, -0.244811, 2.092212, 0.708013]  # t=205
TRANSPORT_207_JOINTS = [-0.072861, -0.648734, 0.923311, -2.415771, -0.255473, 2.104301, 0.731812]  # t=207
TRANSPORT_208_JOINTS = [-0.074105, -0.644270, 0.929596, -2.418069, -0.260742, 2.109838, 0.742913]  # t=208
TRANSPORT_211_JOINTS = [-0.078846, -0.633111, 0.948734, -2.427371, -0.280774, 2.129606, 0.780031]  # t=211
TRANSPORT_214_JOINTS = [-0.085813, -0.625446, 0.973059, -2.441213, -0.311328, 2.159133, 0.831903]  # t=214
TRANSPORT_215_JOINTS = [-0.088789, -0.623435, 0.982337, -2.447908, -0.323628, 2.170909, 0.852477]  # t=215
TRANSPORT_217_JOINTS = [-0.094940, -0.621654, 1.000459, -2.462351, -0.349590, 2.193510, 0.895028]  # t=217
TRANSPORT_218_JOINTS = [-0.097863, -0.622011, 1.008746, -2.469434, -0.362483, 2.203825, 0.915722]  # t=218
PLACE_220_JOINTS = [-0.103748, -0.624477, 1.024596, -2.483477, -0.388604, 2.224329, 0.956875]  # t=220
PLACE_222_JOINTS = [-0.109646, -0.626743, 1.039435, -2.497397, -0.410429, 2.243367, 0.993003]  # t=222
PLACE_224_JOINTS = [-0.116537, -0.626597, 1.052741, -2.510669, -0.427074, 2.262596, 1.022139]  # t=224
PLACE_226_JOINTS = [-0.128192, -0.619848, 1.060374, -2.521414, -0.441571, 2.286879, 1.040318]  # t=226
PLACE_228_JOINTS = [-0.140712, -0.612147, 1.065937, -2.526701, -0.454545, 2.304569, 1.051195]  # t=228
PLACE_230_JOINTS = [-0.153021, -0.604488, 1.070208, -2.527431, -0.466171, 2.316650, 1.058052]  # t=230
PLACE_232_JOINTS = [-0.163841, -0.597374, 1.074548, -2.526037, -0.474964, 2.324453, 1.063388]  # t=232
PLACE_234_JOINTS = [-0.172201, -0.591310, 1.077025, -2.522737, -0.477763, 2.331490, 1.069144]  # t=234
PLACE_236_JOINTS = [-0.174816, -0.588163, 1.076713, -2.519505, -0.467900, 2.339906, 1.077132]  # t=236
PLACE_238_JOINTS = [-0.172682, -0.587564, 1.071292, -2.519130, -0.447188, 2.355953, 1.085458]  # t=238
PLACE_240_JOINTS = [-0.167161, -0.589440, 1.060419, -2.522496, -0.421397, 2.378190, 1.090985]  # t=240
PLACE_242_JOINTS = [-0.160386, -0.592286, 1.047269, -2.530695, -0.396874, 2.404451, 1.093251]  # t=242
PLACE_244_JOINTS = [-0.152947, -0.600961, 1.034861, -2.540145, -0.383419, 2.427170, 1.097420]  # t=244
PLACE_246_JOINTS = [-0.145986, -0.610569, 1.026735, -2.552692, -0.377494, 2.446448, 1.102372]  # t=246
PLACE_248_JOINTS = [-0.141443, -0.615928, 1.020971, -2.560804, -0.375297, 2.457585, 1.100443]  # t=248
PLACE_249_JOINTS = [-0.139838, -0.617516, 1.018872, -2.563011, -0.374691, 2.460623, 1.099283]  # t=249
PLACE_250_JOINTS = [-0.138593, -0.618562, 1.017216, -2.564468, -0.374335, 2.462567, 1.098352]  # t=250
PLACE_252_JOINTS = [-0.136947, -0.619498, 1.014998, -2.565851, -0.374228, 2.464506, 1.097333]  # t=252
PLACE_254_JOINTS = [-0.136083, -0.619567, 1.014021, -2.566265, -0.374234, 2.465006, 1.097220]  # t=254
PLACE_256_JOINTS = [-0.135716, -0.619513, 1.013732, -2.566282, -0.374239, 2.465011, 1.097222]  # t=256
PLACE_258_JOINTS = [-0.135586, -0.619502, 1.013711, -2.566282, -0.374242, 2.465011, 1.097225]  # t=258
PLACE_260_JOINTS = [-0.135076, -0.619572, 1.013382, -2.565982, -0.373520, 2.464154, 1.096658]  # t=260
PLACE_262_JOINTS = [-0.132955, -0.621715, 1.011116, -2.563632, -0.371492, 2.459807, 1.094120]  # t=262
PLACE_264_JOINTS = [-0.128078, -0.627468, 1.005466, -2.558181, -0.366419, 2.449949, 1.087191]  # t=264
PLACE_266_JOINTS = [-0.119609, -0.637860, 0.994583, -2.548154, -0.356706, 2.432235, 1.072290]  # t=266
PLACE_268_JOINTS = [-0.108459, -0.651346, 0.978398, -2.533942, -0.342531, 2.408500, 1.048375]  # t=268
PLACE_270_JOINTS = [-0.097147, -0.663493, 0.959769, -2.518544, -0.325612, 2.383037, 1.017270]  # t=270
PLACE_271_JOINTS = [-0.091839, -0.669166, 0.950085, -2.510276, -0.317445, 2.369732, 1.000389]  # t=271
RELEASE_POSE_271_JOINTS = [-0.091839, -0.669166, 0.950085, -2.510276, -0.317445, 2.369732, 1.000389]  # t=271
RETRACT_274_JOINTS = [-0.078551, -0.683783, 0.923789, -2.486175, -0.296853, 2.333493, 0.954883]  # t=274
RETRACT_276_JOINTS = [-0.071581, -0.691739, 0.909764, -2.472625, -0.285818, 2.314507, 0.932152]  # t=276
RETRACT_277_JOINTS = [-0.068890, -0.695110, 0.903495, -2.466621, -0.281744, 2.306881, 0.922804]  # t=277
RETRACT_280_JOINTS = [-0.062779, -0.703523, 0.887125, -2.449899, -0.272950, 2.286871, 0.898982]  # t=280
RETRACT_283_JOINTS = [-0.057775, -0.712492, 0.871151, -2.430011, -0.267255, 2.263720, 0.875607]  # t=283
RETRACT_286_JOINTS = [-0.052460, -0.723488, 0.853330, -2.403196, -0.261112, 2.231931, 0.847927]  # t=286
RETRACT_289_JOINTS = [-0.038518, -0.750061, 0.830977, -2.375418, -0.242393, 2.174796, 0.813619]  # t=289
RETRACT_292_JOINTS = [-0.003094, -0.815640, 0.801931, -2.375634, -0.198485, 2.086386, 0.771800]  # t=292
RETRACT_295_JOINTS = [0.045813, -0.913109, 0.761616, -2.410279, -0.147035, 2.021803, 0.734068]  # t=295
RETRACT_298_JOINTS = [0.089274, -1.013500, 0.705316, -2.457956, -0.118734, 1.990714, 0.684697]  # t=298
RETRACT_301_JOINTS = [0.117767, -1.094538, 0.635961, -2.487838, -0.112219, 1.972895, 0.617935]  # t=301
RETRACT_304_JOINTS = [0.133056, -1.155699, 0.559823, -2.502669, -0.112126, 1.957805, 0.545690]  # t=304
RETRACT_307_JOINTS = [0.148339, -1.216689, 0.474052, -2.522354, -0.076602, 1.960260, 0.486384]  # t=307
RETRACT_309_JOINTS = [0.156860, -1.256423, 0.422883, -2.540775, -0.050289, 1.969800, 0.448508]  # t=309
APPROACH_000_JOINTS = [-0.047683, -1.052556, 0.009189, -2.296085, 0.029837, 1.549504, 0.700324]  # 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_pregrasp():
    """Coarse approach into the pregrasp corridor."""
    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_015_JOINTS, input_type='joint', steps=5, 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_023_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_025_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_030_JOINTS, input_type='joint', steps=5, 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_048_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_050_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_052_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_055_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_060_JOINTS, input_type='joint', steps=5, 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_075_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_080_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_083_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)

def execute_grasp_approach():
    """Final Cartesian descent into grasp alignment."""
    moveJoint(DESCEND_085_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_087_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_088_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_089_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_091_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_093_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_095_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_097_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_099_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_100_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_101_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(DESCEND_102_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(DESCEND_103_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(DESCEND_105_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(DESCEND_107_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(DESCEND_108_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)

def close_gripper_on_object():
    """Close the gripper and let the grasp settle briefly."""
    grasp(hold_target=GRASP_HOLD_109_JOINTS, input_type='joint', close_steps=1, settle_steps=0, gripper=1.0, require_contact_count=4)
    wait(duration=0.05, hold_target=GRASP_HOLD_109_JOINTS, input_type='joint', gripper=1.0)

def lift_object():
    """Lift the grasped object clear of the counter."""
    moveJoint(LIFT_110_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(LIFT_111_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(LIFT_112_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(LIFT_113_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(LIFT_114_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(LIFT_115_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(LIFT_116_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(LIFT_117_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(LIFT_118_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(LIFT_119_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(LIFT_120_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(LIFT_121_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(LIFT_122_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(LIFT_123_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(LIFT_124_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(LIFT_125_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(LIFT_126_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(LIFT_127_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)

def transport_to_place():
    """Carry the object through the curved transport corridor."""
    moveJoint(TRANSPORT_130_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_131_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_133_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_135_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_136_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_139_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_142_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_143_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_145_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_147_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_148_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_151_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_154_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_155_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_157_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_159_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_160_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_163_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_166_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_167_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_169_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_171_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_172_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_175_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_178_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_179_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_181_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_183_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_184_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_187_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_190_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_191_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_193_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_195_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_196_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_199_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_202_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_203_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_205_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_207_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_208_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_211_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_214_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_215_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_217_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(TRANSPORT_218_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)

def prepare_release():
    """Set the object into the receptacle and stabilize before release."""
    moveJoint(PLACE_220_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_222_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_224_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_226_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_228_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_230_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_232_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_234_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_236_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_238_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_240_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_242_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_244_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_246_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_248_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_249_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PLACE_250_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PLACE_252_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PLACE_254_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PLACE_256_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PLACE_258_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PLACE_260_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PLACE_262_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PLACE_264_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PLACE_266_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PLACE_268_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PLACE_270_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PLACE_271_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    wait(duration=0.05, hold_target=RELEASE_POSE_271_JOINTS, input_type='joint', gripper=-1.0)

def release_object():
    """Open the gripper and hold briefly to avoid disturbing the placement."""
    release(hold_target=RELEASE_POSE_271_JOINTS, input_type='joint', open_steps=1, settle_steps=0, gripper=-1.0)
    wait(duration=0.05, hold_target=RELEASE_POSE_271_JOINTS, input_type='joint', gripper=-1.0)

def retreat_after_release():
    """Retreat away from the placed object without clipping it."""
    moveJoint(RETRACT_274_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_276_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_277_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_280_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_283_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_286_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_289_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_292_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_295_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_298_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_301_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_304_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_307_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_309_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)

move_to_pregrasp()
execute_grasp_approach()
close_gripper_on_object()
lift_object()
transport_to_place()
prepare_release()
release_object()
retreat_after_release()

# 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: PreheatOven
# Episode: episode_000000

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

SCENE_ARTIFACT = '../../../artifacts/20260324/PreheatOven/20260324_205335_preheat-oven_episode_000000_action2code-open-loop-joint_initial-scene.json'
POLICY_METADATA = {
    'policy_kind': 'open_loop_joint',
    'policy_variant': 'open-loop-joint',
    'task_name': 'PreheatOven',
    'episode_id': 'episode_000000',
    'scene_artifact_path': '../../../artifacts/20260324/PreheatOven/20260324_205335_preheat-oven_episode_000000_action2code-open-loop-joint_initial-scene.json',
    'fitting_summary_path': '../../../artifacts/20260324/PreheatOven/20260324_205335_preheat-oven_episode_000000_action2code-open-loop-joint_fitting-summary.json',
    'extracted_pose_metadata_path': '../../../artifacts/20260324/PreheatOven/20260324_205335_preheat-oven_episode_000000_action2code-open-loop-joint_extracted-pose-metadata.json',
    'stable_grasp_contact_t': 158,
    'stable_release_contact_loss_t': 158,
    '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.023101, -1.021632, -0.053028, -2.269831, 0.070872, 1.499142, 0.696212]  # t=2
APPROACH_003_JOINTS = [-0.023584, -1.036834, -0.056010, -2.267821, 0.067839, 1.478095, 0.695476]  # t=3
APPROACH_005_JOINTS = [-0.026401, -1.087699, -0.079965, -2.270066, 0.059151, 1.429997, 0.686604]  # t=5
APPROACH_007_JOINTS = [-0.031136, -1.155250, -0.124132, -2.285396, 0.050896, 1.393721, 0.666989]  # t=7
APPROACH_009_JOINTS = [-0.038878, -1.231946, -0.186617, -2.307681, 0.038259, 1.366903, 0.644603]  # t=9
APPROACH_010_JOINTS = [-0.043829, -1.272384, -0.223674, -2.319696, 0.028833, 1.356379, 0.629002]  # t=10
APPROACH_012_JOINTS = [-0.056144, -1.354842, -0.305030, -2.341982, 0.007837, 1.337044, 0.593696]  # t=12
APPROACH_015_JOINTS = [-0.081989, -1.476777, -0.435117, -2.366966, -0.034840, 1.308176, 0.533631]  # t=15
APPROACH_018_JOINTS = [-0.114355, -1.592052, -0.572503, -2.375087, -0.083227, 1.279067, 0.431576]  # t=18
APPROACH_020_JOINTS = [-0.134748, -1.655044, -0.663109, -2.372880, -0.114339, 1.273657, 0.326064]  # t=20
APPROACH_021_JOINTS = [-0.143471, -1.679512, -0.709089, -2.370365, -0.126787, 1.275124, 0.266461]  # t=21
APPROACH_023_JOINTS = [-0.158214, -1.713525, -0.800281, -2.366061, -0.153575, 1.285831, 0.142628]  # t=23
APPROACH_025_JOINTS = [-0.170355, -1.732794, -0.880371, -2.368468, -0.170936, 1.311038, 0.013055]  # t=25
APPROACH_028_JOINTS = [-0.188667, -1.749100, -0.992127, -2.372847, -0.149169, 1.362335, -0.177502]  # t=28
APPROACH_030_JOINTS = [-0.199650, -1.748361, -1.057082, -2.385388, -0.135870, 1.392508, -0.305126]  # t=30
APPROACH_033_JOINTS = [-0.206203, -1.724349, -1.136908, -2.411333, -0.127873, 1.440888, -0.492358]  # t=33
APPROACH_035_JOINTS = [-0.203668, -1.694457, -1.177397, -2.422860, -0.124252, 1.466773, -0.601575]  # t=35
APPROACH_040_JOINTS = [-0.189446, -1.603958, -1.239859, -2.451875, -0.117599, 1.530393, -0.825006]  # t=40
APPROACH_042_JOINTS = [-0.181639, -1.566571, -1.254880, -2.474205, -0.114341, 1.576332, -0.888869]  # t=42
APPROACH_045_JOINTS = [-0.169080, -1.513559, -1.276985, -2.516060, -0.106361, 1.662067, -0.968624]  # t=45
APPROACH_047_JOINTS = [-0.159658, -1.481917, -1.298155, -2.546152, -0.094538, 1.724306, -1.022263]  # t=47
APPROACH_050_JOINTS = [-0.142562, -1.438442, -1.336868, -2.592065, -0.073117, 1.821900, -1.109988]  # t=50
APPROACH_055_JOINTS = [-0.097132, -1.376110, -1.410897, -2.666586, -0.017050, 1.995094, -1.272728]  # t=55
APPROACH_058_JOINTS = [-0.065913, -1.346900, -1.442013, -2.688860, 0.027158, 2.068319, -1.356611]  # t=58
APPROACH_060_JOINTS = [-0.044088, -1.329442, -1.454719, -2.689241, 0.053104, 2.101629, -1.399178]  # t=60
APPROACH_065_JOINTS = [0.024842, -1.297097, -1.480160, -2.678250, 0.103949, 2.175646, -1.492446]  # t=65
APPROACH_070_JOINTS = [0.101354, -1.273683, -1.518591, -2.677661, 0.113641, 2.255392, -1.570307]  # t=70
APPROACH_075_JOINTS = [0.176964, -1.278153, -1.581884, -2.680219, 0.115449, 2.338881, -1.675477]  # t=75
APPROACH_080_JOINTS = [0.265541, -1.315240, -1.640006, -2.677371, 0.126972, 2.427955, -1.750285]  # t=80
APPROACH_084_JOINTS = [0.316493, -1.367309, -1.681186, -2.660324, 0.133016, 2.458475, -1.818380]  # t=84
PRESS_086_JOINTS = [0.324427, -1.393294, -1.692746, -2.650377, 0.131851, 2.454670, -1.845620]  # t=86
PRESS_088_JOINTS = [0.330299, -1.416254, -1.701339, -2.643620, 0.128084, 2.454315, -1.862779]  # t=88
PRESS_089_JOINTS = [0.332383, -1.427173, -1.705240, -2.640796, 0.125967, 2.454119, -1.870321]  # t=89
PRESS_090_JOINTS = [0.333998, -1.437832, -1.709462, -2.638495, 0.123881, 2.453951, -1.878016]  # t=90
PRESS_092_JOINTS = [0.334996, -1.457126, -1.718774, -2.635341, 0.119275, 2.451732, -1.891649]  # t=92
PRESS_094_JOINTS = [0.333417, -1.472528, -1.729040, -2.634527, 0.113047, 2.447756, -1.901436]  # t=94
PRESS_096_JOINTS = [0.329581, -1.483383, -1.738101, -2.637098, 0.103889, 2.444290, -1.907843]  # t=96
PRESS_097_JOINTS = [0.328092, -1.487154, -1.740917, -2.638343, 0.098848, 2.444813, -1.907130]  # t=97
PRESS_098_JOINTS = [0.327013, -1.490447, -1.742720, -2.639210, 0.094050, 2.445607, -1.905301]  # t=98
PRESS_100_JOINTS = [0.325389, -1.496012, -1.745140, -2.640221, 0.085335, 2.446574, -1.900661]  # t=100
PRESS_101_JOINTS = [0.324397, -1.498727, -1.746225, -2.640901, 0.081559, 2.446247, -1.899882]  # t=101
PRESS_102_JOINTS = [0.322703, -1.502397, -1.747487, -2.642937, 0.078712, 2.444825, -1.903607]  # t=102
PRESS_104_JOINTS = [0.317663, -1.512554, -1.752486, -2.650514, 0.077300, 2.443164, -1.922077]  # t=104
PRESS_106_JOINTS = [0.314119, -1.519887, -1.758136, -2.655355, 0.076544, 2.445935, -1.931941]  # t=106
PRESS_108_JOINTS = [0.312308, -1.524233, -1.760939, -2.657581, 0.074605, 2.447964, -1.934362]  # t=108
PRESS_110_JOINTS = [0.311190, -1.527839, -1.762573, -2.658691, 0.073320, 2.448326, -1.935652]  # t=110
PRESS_112_JOINTS = [0.310428, -1.530678, -1.764006, -2.659206, 0.072262, 2.448393, -1.936632]  # t=112
PRESS_114_JOINTS = [0.310135, -1.532231, -1.764842, -2.659219, 0.070733, 2.448395, -1.936388]  # t=114
PRESS_115_JOINTS = [0.310164, -1.532757, -1.765036, -2.659220, 0.070063, 2.448538, -1.936134]  # t=115
PRESS_116_JOINTS = [0.311081, -1.533480, -1.765123, -2.659310, 0.069500, 2.450022, -1.935860]  # t=116
PRESS_118_JOINTS = [0.316202, -1.535781, -1.765134, -2.659569, 0.068468, 2.457041, -1.935180]  # t=118
PRESS_120_JOINTS = [0.323929, -1.538924, -1.764897, -2.659237, 0.067389, 2.466132, -1.934365]  # t=120
PRESS_122_JOINTS = [0.327409, -1.542120, -1.760204, -2.655977, 0.067420, 2.468154, -1.932652]  # t=122
PRESS_124_JOINTS = [0.330886, -1.545008, -1.754440, -2.652172, 0.066775, 2.470179, -1.929887]  # t=124
PRESS_126_JOINTS = [0.332874, -1.547033, -1.751829, -2.649935, 0.065712, 2.470508, -1.929502]  # t=126
PRESS_128_JOINTS = [0.333198, -1.548409, -1.751354, -2.649431, 0.065101, 2.470617, -1.929578]  # t=128
PRESS_130_JOINTS = [0.331349, -1.551804, -1.753544, -2.651033, 0.070002, 2.473553, -1.929688]  # t=130
PRESS_132_JOINTS = [0.330357, -1.556259, -1.758058, -2.651109, 0.079086, 2.473124, -1.924486]  # t=132
PRESS_133_JOINTS = [0.330138, -1.558630, -1.760635, -2.650737, 0.085462, 2.472458, -1.918280]  # t=133
PRESS_134_JOINTS = [0.329767, -1.561296, -1.763552, -2.650557, 0.093357, 2.472274, -1.910509]  # t=134
PRESS_136_JOINTS = [0.328438, -1.567459, -1.770500, -2.650943, 0.113236, 2.473267, -1.891578]  # t=136
PRESS_138_JOINTS = [0.326419, -1.574405, -1.778458, -2.652272, 0.136997, 2.475800, -1.870084]  # t=138
PRESS_140_JOINTS = [0.323948, -1.582421, -1.787427, -2.654029, 0.163985, 2.478841, -1.848350]  # t=140
PRESS_141_JOINTS = [0.322636, -1.586831, -1.792312, -2.654905, 0.178695, 2.480224, -1.837257]  # t=141
PRESS_142_JOINTS = [0.321253, -1.591300, -1.797319, -2.655894, 0.193954, 2.481734, -1.825775]  # t=142
PRESS_144_JOINTS = [0.318058, -1.600016, -1.807115, -2.658705, 0.225880, 2.486365, -1.801081]  # t=144
PRESS_146_JOINTS = [0.314438, -1.608134, -1.816495, -2.662540, 0.258787, 2.492674, -1.774679]  # t=146
PRESS_148_JOINTS = [0.310722, -1.615918, -1.825450, -2.666768, 0.292948, 2.499790, -1.746490]  # t=148
PRESS_150_JOINTS = [0.306935, -1.623269, -1.833524, -2.671459, 0.328341, 2.508517, -1.716354]  # t=150
PRESS_151_JOINTS = [0.304945, -1.626849, -1.837376, -2.674052, 0.346598, 2.513459, -1.700912]  # t=151
PRESS_152_JOINTS = [0.302878, -1.630349, -1.841054, -2.676834, 0.365282, 2.518865, -1.685099]  # t=152
PRESS_154_JOINTS = [0.298268, -1.636697, -1.847535, -2.683516, 0.403751, 2.532114, -1.651984]  # t=154
PRESS_156_JOINTS = [0.292802, -1.643745, -1.854192, -2.691439, 0.446243, 2.547754, -1.618555]  # t=156
PRESS_158_JOINTS = [0.286377, -1.651705, -1.861257, -2.700631, 0.492495, 2.565227, -1.586933]  # t=158
PRESS_159_JOINTS = [0.282799, -1.656094, -1.864751, -2.705670, 0.517132, 2.574806, -1.572047]  # t=159
PRESS_160_JOINTS = [0.279041, -1.660857, -1.868355, -2.710854, 0.542747, 2.584532, -1.558105]  # t=160
PRESS_162_JOINTS = [0.270999, -1.671176, -1.875481, -2.721733, 0.596717, 2.604709, -1.532685]  # t=162
PRESS_164_JOINTS = [0.261638, -1.681872, -1.881408, -2.734428, 0.655282, 2.627937, -1.509443]  # t=164
PRESS_166_JOINTS = [0.251981, -1.693285, -1.885428, -2.747606, 0.719267, 2.654514, -1.486354]  # t=166
PRESS_167_JOINTS = [0.246940, -1.699519, -1.886611, -2.754468, 0.754721, 2.669688, -1.473968]  # t=167
PRESS_168_JOINTS = [0.241224, -1.706222, -1.887463, -2.761954, 0.793154, 2.685746, -1.462091]  # t=168
PRESS_169_JOINTS = [0.233566, -1.712949, -1.888050, -2.771555, 0.835282, 2.702102, -1.451800]  # t=169
PRESS_170_JOINTS = [0.223238, -1.719064, -1.887670, -2.784374, 0.880638, 2.718734, -1.444970]  # t=170
PRESS_172_JOINTS = [0.198222, -1.731893, -1.884169, -2.814616, 0.973763, 2.752777, -1.464472]  # t=172
PRESS_173_JOINTS = [0.190611, -1.736937, -1.879697, -2.826023, 1.009864, 2.771045, -1.489677]  # t=173
APPROACH_000_JOINTS = [-0.023089, -1.014794, -0.052474, -2.271407, 0.071344, 1.510767, 0.696210]  # 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_003_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_005_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_007_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_009_JOINTS, input_type='joint', steps=2, 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_025_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_028_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_030_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_033_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_035_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_040_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_042_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_045_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_047_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_050_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_055_JOINTS, input_type='joint', steps=5, 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_075_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_080_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_084_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_086_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_088_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_089_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_090_JOINTS, input_type='joint', steps=1, 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_097_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_098_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_100_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_101_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_102_JOINTS, input_type='joint', steps=1, 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_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_115_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_116_JOINTS, input_type='joint', steps=1, 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_133_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_134_JOINTS, input_type='joint', steps=1, 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_141_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_142_JOINTS, input_type='joint', steps=1, 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_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_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_166_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_167_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_168_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_169_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_170_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_172_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_173_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

Preheat the oven by turning the temperature knob.


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

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

SCENE_ARTIFACT = '../../../artifacts/20260324/SlideDishwasherRack/20260324_205336_slide-dishwasher-rack_episode_000000_action2code-open-loop-joint_initial-scene.json'
POLICY_METADATA = {
    'policy_kind': 'open_loop_joint',
    'policy_variant': 'open-loop-joint',
    'task_name': 'SlideDishwasherRack',
    'episode_id': 'episode_000000',
    'scene_artifact_path': '../../../artifacts/20260324/SlideDishwasherRack/20260324_205336_slide-dishwasher-rack_episode_000000_action2code-open-loop-joint_initial-scene.json',
    'fitting_summary_path': '../../../artifacts/20260324/SlideDishwasherRack/20260324_205336_slide-dishwasher-rack_episode_000000_action2code-open-loop-joint_fitting-summary.json',
    'extracted_pose_metadata_path': '../../../artifacts/20260324/SlideDishwasherRack/20260324_205336_slide-dishwasher-rack_episode_000000_action2code-open-loop-joint_extracted-pose-metadata.json',
    'stable_grasp_contact_t': 175,
    'stable_release_contact_loss_t': 175,
    '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_005_JOINTS = [-0.017389, -1.013524, -0.042367, -2.320128, 0.098111, 1.534877, 0.658483]  # t=5
APPROACH_008_JOINTS = [-0.017117, -1.031725, -0.043857, -2.318757, 0.096725, 1.507603, 0.658998]  # t=8
APPROACH_010_JOINTS = [-0.017360, -1.072758, -0.050845, -2.319250, 0.103317, 1.462039, 0.660363]  # t=10
APPROACH_011_JOINTS = [-0.017533, -1.100491, -0.054337, -2.322949, 0.108688, 1.439233, 0.661472]  # t=11
APPROACH_014_JOINTS = [-0.016971, -1.188111, -0.043832, -2.345354, 0.137516, 1.376422, 0.681350]  # t=14
APPROACH_015_JOINTS = [-0.016516, -1.215188, -0.036022, -2.355002, 0.153141, 1.361275, 0.693298]  # t=15
APPROACH_017_JOINTS = [-0.015497, -1.264682, -0.016860, -2.377729, 0.190147, 1.339881, 0.723688]  # t=17
APPROACH_020_JOINTS = [-0.013790, -1.329424, 0.012263, -2.419513, 0.250946, 1.318257, 0.776716]  # t=20
APPROACH_022_JOINTS = [-0.011739, -1.367074, 0.032385, -2.447843, 0.295267, 1.307724, 0.809899]  # t=22
APPROACH_025_JOINTS = [-0.008154, -1.398613, 0.066583, -2.479579, 0.366147, 1.299761, 0.867019]  # t=25
APPROACH_030_JOINTS = [0.003243, -1.425564, 0.147447, -2.511559, 0.461328, 1.277804, 0.946090]  # t=30
APPROACH_035_JOINTS = [0.022793, -1.491919, 0.229761, -2.561354, 0.542615, 1.264385, 1.011049]  # t=35
APPROACH_040_JOINTS = [0.045285, -1.535977, 0.324665, -2.644754, 0.640986, 1.276479, 1.073889]  # t=40
APPROACH_045_JOINTS = [0.069590, -1.549488, 0.388243, -2.713874, 0.712681, 1.286498, 1.123602]  # t=45
APPROACH_046_JOINTS = [0.074283, -1.547994, 0.400579, -2.727295, 0.728722, 1.286904, 1.136834]  # t=46
APPROACH_050_JOINTS = [0.095563, -1.538611, 0.449447, -2.786248, 0.776000, 1.285862, 1.160810]  # t=50
APPROACH_053_JOINTS = [0.116490, -1.532974, 0.505607, -2.818678, 0.789411, 1.287809, 1.157183]  # t=53
APPROACH_055_JOINTS = [0.133396, -1.529519, 0.557326, -2.832052, 0.801624, 1.294625, 1.154279]  # t=55
APPROACH_060_JOINTS = [0.174676, -1.497321, 0.700027, -2.861326, 0.847058, 1.327319, 1.162903]  # t=60
APPROACH_065_JOINTS = [0.205365, -1.422531, 0.829231, -2.875508, 0.904195, 1.382224, 1.195429]  # t=65
APPROACH_070_JOINTS = [0.224638, -1.318971, 0.936307, -2.900375, 0.979231, 1.458576, 1.209921]  # t=70
APPROACH_075_JOINTS = [0.225459, -1.183360, 1.092606, -2.895568, 1.076986, 1.597158, 1.236756]  # t=75
APPROACH_080_JOINTS = [0.204439, -1.050294, 1.227432, -2.873462, 1.135484, 1.738414, 1.268527]  # t=80
APPROACH_083_JOINTS = [0.177964, -0.976709, 1.293403, -2.862264, 1.152657, 1.809402, 1.278455]  # t=83
APPROACH_085_JOINTS = [0.152951, -0.931240, 1.335424, -2.857495, 1.156007, 1.854283, 1.280339]  # t=85
APPROACH_090_JOINTS = [0.057727, -0.824207, 1.479002, -2.841337, 1.180219, 1.977061, 1.279297]  # t=90
APPROACH_091_JOINTS = [0.035045, -0.808578, 1.501063, -2.827316, 1.180928, 1.994670, 1.279135]  # t=91
PRESS_093_JOINTS = [-0.009153, -0.787103, 1.532949, -2.792108, 1.169285, 2.009411, 1.282925]  # t=93
PRESS_095_JOINTS = [-0.051773, -0.776394, 1.561483, -2.759613, 1.152441, 2.007281, 1.286568]  # t=95
PRESS_097_JOINTS = [-0.092135, -0.775723, 1.585532, -2.730756, 1.134846, 1.995004, 1.288707]  # t=97
PRESS_098_JOINTS = [-0.111699, -0.778420, 1.596450, -2.717793, 1.127547, 1.986715, 1.288419]  # t=98
PRESS_099_JOINTS = [-0.131692, -0.783430, 1.607867, -2.707530, 1.121708, 1.980493, 1.287043]  # t=99
PRESS_101_JOINTS = [-0.173869, -0.798390, 1.633704, -2.691679, 1.117473, 1.971255, 1.277409]  # t=101
PRESS_103_JOINTS = [-0.217215, -0.818532, 1.663714, -2.676333, 1.121352, 1.960075, 1.262225]  # t=103
PRESS_105_JOINTS = [-0.260916, -0.844276, 1.698233, -2.660178, 1.132923, 1.947195, 1.244387]  # t=105
PRESS_107_JOINTS = [-0.303991, -0.876555, 1.731885, -2.642691, 1.147043, 1.930597, 1.224917]  # t=107
PRESS_109_JOINTS = [-0.346407, -0.915220, 1.762683, -2.623156, 1.161978, 1.909562, 1.203819]  # t=109
PRESS_111_JOINTS = [-0.387888, -0.958981, 1.791264, -2.601143, 1.180754, 1.885494, 1.180516]  # t=111
PRESS_113_JOINTS = [-0.427290, -1.005777, 1.813090, -2.577434, 1.203898, 1.859464, 1.153380]  # t=113
PRESS_115_JOINTS = [-0.464373, -1.054030, 1.827185, -2.553189, 1.227547, 1.831246, 1.123700]  # t=115
PRESS_117_JOINTS = [-0.500486, -1.103049, 1.837786, -2.528054, 1.251151, 1.803283, 1.094099]  # t=117
PRESS_119_JOINTS = [-0.536297, -1.152034, 1.852434, -2.500889, 1.278149, 1.776699, 1.067067]  # t=119
PRESS_121_JOINTS = [-0.568584, -1.198501, 1.868997, -2.473040, 1.306833, 1.748079, 1.044756]  # t=121
PRESS_122_JOINTS = [-0.582083, -1.220091, 1.876974, -2.458986, 1.321050, 1.732568, 1.036278]  # t=122
PRESS_123_JOINTS = [-0.593844, -1.240959, 1.885040, -2.444605, 1.335448, 1.717978, 1.030108]  # t=123
PRESS_125_JOINTS = [-0.613461, -1.281466, 1.901495, -2.416594, 1.364629, 1.692684, 1.022484]  # t=125
PRESS_127_JOINTS = [-0.629442, -1.320739, 1.918207, -2.388686, 1.395892, 1.671742, 1.020624]  # t=127
PRESS_129_JOINTS = [-0.642912, -1.358902, 1.933604, -2.362398, 1.427847, 1.653021, 1.023189]  # t=129
PRESS_130_JOINTS = [-0.649616, -1.377920, 1.938923, -2.350449, 1.443576, 1.644971, 1.026221]  # t=130
PRESS_131_JOINTS = [-0.657581, -1.397703, 1.943381, -2.338739, 1.459995, 1.638429, 1.030232]  # t=131
PRESS_133_JOINTS = [-0.677284, -1.437986, 1.948743, -2.316471, 1.491264, 1.623234, 1.039038]  # t=133
PRESS_134_JOINTS = [-0.688308, -1.457738, 1.950839, -2.304687, 1.506041, 1.613672, 1.043732]  # t=134
PRESS_135_JOINTS = [-0.698391, -1.475563, 1.950567, -2.293643, 1.519351, 1.602207, 1.047480]  # t=135
PRESS_136_JOINTS = [-0.708532, -1.493494, 1.952960, -2.280695, 1.533391, 1.593110, 1.052826]  # t=136
PRESS_137_JOINTS = [-0.719192, -1.511703, 1.958168, -2.265071, 1.548163, 1.585218, 1.061184]  # t=137
PRESS_139_JOINTS = [-0.740534, -1.547587, 1.970463, -2.230171, 1.576989, 1.571265, 1.083399]  # t=139
PRESS_141_JOINTS = [-0.761343, -1.582468, 1.980539, -2.195070, 1.604208, 1.558434, 1.107979]  # t=141
PRESS_143_JOINTS = [-0.781447, -1.616492, 1.988752, -2.160194, 1.631212, 1.545820, 1.132667]  # t=143
PRESS_144_JOINTS = [-0.790969, -1.632954, 1.991847, -2.143430, 1.644353, 1.539398, 1.144437]  # t=144
PRESS_145_JOINTS = [-0.799510, -1.647972, 1.991128, -2.130083, 1.655580, 1.532314, 1.155619]  # t=145
PRESS_146_JOINTS = [-0.808062, -1.662911, 1.990199, -2.117314, 1.666650, 1.526119, 1.165712]  # t=146
PRESS_147_JOINTS = [-0.817220, -1.677714, 1.988377, -2.105513, 1.676931, 1.519349, 1.175676]  # t=147
PRESS_149_JOINTS = [-0.836423, -1.704007, 1.978633, -2.088366, 1.693988, 1.499944, 1.195621]  # t=149
PRESS_151_JOINTS = [-0.857854, -1.726367, 1.966152, -2.076028, 1.712635, 1.478011, 1.218445]  # t=151
PRESS_152_JOINTS = [-0.869477, -1.736272, 1.960257, -2.070421, 1.722540, 1.467271, 1.231512]  # t=152
PRESS_153_JOINTS = [-0.881101, -1.744792, 1.954180, -2.063891, 1.732308, 1.456751, 1.246542]  # t=153
PRESS_155_JOINTS = [-0.905542, -1.759351, 1.943694, -2.052760, 1.751574, 1.437629, 1.280690]  # t=155
PRESS_157_JOINTS = [-0.932609, -1.763047, 1.936695, -2.043207, 1.766857, 1.428508, 1.317614]  # t=157
PRESS_158_JOINTS = [-0.947295, -1.762855, 1.934730, -2.037918, 1.772960, 1.428208, 1.336101]  # t=158
PRESS_159_JOINTS = [-0.961615, -1.762828, 1.932525, -2.030019, 1.779593, 1.427762, 1.355845]  # t=159
PRESS_161_JOINTS = [-0.991020, -1.762835, 1.927799, -2.016046, 1.793831, 1.427683, 1.399690]  # t=161
PRESS_162_JOINTS = [-1.005461, -1.762836, 1.925361, -2.008742, 1.801828, 1.428379, 1.423217]  # t=162
PRESS_163_JOINTS = [-1.019812, -1.762840, 1.922864, -2.001157, 1.810731, 1.430656, 1.449074]  # t=163
PRESS_165_JOINTS = [-1.050993, -1.762884, 1.918904, -1.981193, 1.830863, 1.443294, 1.510024]  # t=165
PRESS_167_JOINTS = [-1.087779, -1.762892, 1.916669, -1.949213, 1.849136, 1.470325, 1.584209]  # t=167
PRESS_169_JOINTS = [-1.127998, -1.762904, 1.914951, -1.912210, 1.861187, 1.496695, 1.664018]  # t=169
PRESS_171_JOINTS = [-1.170044, -1.762923, 1.912852, -1.869887, 1.869717, 1.521355, 1.747590]  # t=171
PRESS_173_JOINTS = [-1.212636, -1.762942, 1.910830, -1.821981, 1.874359, 1.548546, 1.835084]  # t=173
PRESS_175_JOINTS = [-1.239331, -1.762943, 1.919599, -1.784083, 1.882648, 1.595111, 1.925636]  # t=175
PRESS_177_JOINTS = [-1.263043, -1.762996, 1.927110, -1.741964, 1.885437, 1.648463, 2.023369]  # t=177
PRESS_178_JOINTS = [-1.273987, -1.762745, 1.931584, -1.718964, 1.883489, 1.677457, 2.075767]  # t=178
PRESS_179_JOINTS = [-1.270753, -1.762703, 1.935694, -1.710988, 1.881883, 1.699863, 2.128648]  # t=179
PRESS_180_JOINTS = [-1.263091, -1.763226, 1.942042, -1.705993, 1.884516, 1.729024, 2.182593]  # t=180
PRESS_181_JOINTS = [-1.257387, -1.763077, 1.951857, -1.698074, 1.886076, 1.770241, 2.236486]  # t=181
PRESS_183_JOINTS = [-1.251529, -1.763076, 1.975227, -1.674393, 1.881978, 1.867013, 2.345582]  # t=183
PRESS_185_JOINTS = [-1.254940, -1.763114, 1.998403, -1.641893, 1.864532, 1.963161, 2.455954]  # t=185
PRESS_186_JOINTS = [-1.258619, -1.763122, 2.008974, -1.624422, 1.851503, 2.006504, 2.511520]  # t=186
RETREAT_187_JOINTS = [-1.261874, -1.763103, 2.017327, -1.608189, 1.835938, 2.042734, 2.566176]  # t=187
RETREAT_188_JOINTS = [-1.263338, -1.763083, 2.021739, -1.595522, 1.818873, 2.069564, 2.618568]  # t=188
RETREAT_189_JOINTS = [-1.261510, -1.763048, 2.022706, -1.587718, 1.802950, 2.086146, 2.667926]  # t=189
RETREAT_190_JOINTS = [-1.256194, -1.763035, 2.020820, -1.584586, 1.790417, 2.095184, 2.714018]  # t=190
APPROACH_000_JOINTS = [-0.018353, -1.010615, -0.042065, -2.318150, 0.098307, 1.531062, 0.658620]  # 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_008_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_010_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_011_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_014_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_015_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_017_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_020_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_022_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_025_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_030_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_035_JOINTS, input_type='joint', steps=5, 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_046_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_050_JOINTS, input_type='joint', steps=4, 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_060_JOINTS, input_type='joint', steps=5, 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_075_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_080_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_083_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_085_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_090_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_091_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_093_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_095_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_097_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_098_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_099_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_101_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_103_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_105_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_107_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_109_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_111_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_113_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_115_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_117_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_119_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_121_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_122_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_123_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_125_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_127_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_129_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_130_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_131_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_133_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_134_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_135_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_136_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_137_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_139_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_141_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_143_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_144_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_145_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_146_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_147_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_149_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_151_JOINTS, input_type='joint', steps=2, 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_155_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_157_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_158_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_159_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_161_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_162_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_163_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_165_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_167_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_169_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_171_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_173_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_175_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_177_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_178_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_179_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_180_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_181_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_183_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_185_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_186_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_187_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_188_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_189_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_190_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


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

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

SCENE_ARTIFACT = '../../../artifacts/20260324/SlideOvenRack/20260324_205337_slide-oven-rack_episode_000000_action2code-open-loop-joint_initial-scene.json'
POLICY_METADATA = {
    'policy_kind': 'open_loop_joint',
    'policy_variant': 'open-loop-joint',
    'task_name': 'SlideOvenRack',
    'episode_id': 'episode_000000',
    'scene_artifact_path': '../../../artifacts/20260324/SlideOvenRack/20260324_205337_slide-oven-rack_episode_000000_action2code-open-loop-joint_initial-scene.json',
    'fitting_summary_path': '../../../artifacts/20260324/SlideOvenRack/20260324_205337_slide-oven-rack_episode_000000_action2code-open-loop-joint_fitting-summary.json',
    'extracted_pose_metadata_path': '../../../artifacts/20260324/SlideOvenRack/20260324_205337_slide-oven-rack_episode_000000_action2code-open-loop-joint_extracted-pose-metadata.json',
    'stable_grasp_contact_t': 232,
    'stable_release_contact_loss_t': 232,
    '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_004_JOINTS = [0.012755, -1.044313, -0.014626, -2.276543, 0.043884, 1.474689, 0.677100]  # t=4
APPROACH_005_JOINTS = [0.012569, -1.050911, -0.003490, -2.278665, 0.053386, 1.464872, 0.682444]  # t=5
APPROACH_007_JOINTS = [0.013084, -1.071959, 0.032222, -2.290329, 0.079868, 1.444352, 0.705138]  # t=7
APPROACH_010_JOINTS = [0.016985, -1.132155, 0.108501, -2.325186, 0.135236, 1.409268, 0.758238]  # t=10
APPROACH_013_JOINTS = [0.025995, -1.219960, 0.195506, -2.376508, 0.208290, 1.383876, 0.822655]  # t=13
APPROACH_015_JOINTS = [0.034887, -1.281938, 0.251806, -2.413711, 0.261404, 1.368087, 0.865168]  # t=15
APPROACH_016_JOINTS = [0.040447, -1.313234, 0.278358, -2.431044, 0.288186, 1.358405, 0.883932]  # t=16
APPROACH_019_JOINTS = [0.062584, -1.407497, 0.352029, -2.477301, 0.370195, 1.325762, 0.921438]  # t=19
APPROACH_020_JOINTS = [0.070997, -1.436477, 0.375697, -2.491273, 0.398810, 1.319186, 0.929886]  # t=20
APPROACH_024_JOINTS = [0.104772, -1.517386, 0.472104, -2.530929, 0.519156, 1.303442, 0.949813]  # t=24
APPROACH_025_JOINTS = [0.112267, -1.525332, 0.493049, -2.537905, 0.548795, 1.299227, 0.946357]  # t=25
APPROACH_027_JOINTS = [0.122977, -1.522981, 0.534827, -2.550390, 0.610032, 1.298942, 0.940820]  # t=27
APPROACH_030_JOINTS = [0.128504, -1.478758, 0.600508, -2.556924, 0.703659, 1.313525, 0.933687]  # t=30
APPROACH_031_JOINTS = [0.128842, -1.458851, 0.623301, -2.555631, 0.732398, 1.323125, 0.931582]  # t=31
APPROACH_035_JOINTS = [0.127900, -1.373395, 0.733218, -2.542885, 0.838737, 1.390592, 0.932080]  # t=35
APPROACH_039_JOINTS = [0.122624, -1.285547, 0.879827, -2.524608, 0.944103, 1.511081, 0.951544]  # t=39
APPROACH_040_JOINTS = [0.119599, -1.262094, 0.918895, -2.519427, 0.970172, 1.545356, 0.958824]  # t=40
APPROACH_043_JOINTS = [0.103181, -1.186747, 1.041736, -2.504772, 1.045799, 1.654833, 0.982242]  # t=43
APPROACH_045_JOINTS = [0.085607, -1.134465, 1.124291, -2.496326, 1.089793, 1.726865, 0.994821]  # t=45
APPROACH_046_JOINTS = [0.074725, -1.108989, 1.165545, -2.492058, 1.107412, 1.762456, 0.999440]  # t=46
APPROACH_050_JOINTS = [0.019005, -1.020718, 1.328798, -2.474288, 1.163591, 1.906647, 1.015611]  # t=50
APPROACH_055_JOINTS = [-0.101243, -0.953225, 1.574010, -2.438412, 1.265828, 2.093367, 1.026464]  # t=55
APPROACH_057_JOINTS = [-0.164325, -0.953387, 1.673683, -2.413427, 1.320515, 2.144152, 1.023181]  # t=57
APPROACH_059_JOINTS = [-0.225465, -0.972245, 1.755225, -2.384812, 1.380364, 2.164201, 1.011303]  # t=59
APPROACH_060_JOINTS = [-0.248745, -0.986096, 1.780007, -2.372913, 1.404830, 2.161455, 1.002631]  # t=60
APPROACH_062_JOINTS = [-0.269015, -1.011508, 1.784882, -2.361677, 1.430178, 2.129779, 0.983944]  # t=62
APPROACH_065_JOINTS = [-0.273148, -1.055573, 1.764692, -2.353800, 1.452574, 2.072916, 0.968095]  # t=65
APPROACH_068_JOINTS = [-0.271854, -1.100849, 1.751041, -2.348003, 1.475050, 2.024987, 0.962720]  # t=68
APPROACH_070_JOINTS = [-0.287787, -1.135819, 1.774974, -2.334871, 1.503192, 1.995843, 0.962793]  # t=70
APPROACH_075_JOINTS = [-0.379207, -1.253405, 1.877063, -2.238299, 1.563581, 1.933322, 1.008289]  # t=75
APPROACH_077_JOINTS = [-0.414558, -1.303792, 1.901797, -2.188167, 1.579464, 1.905142, 1.046853]  # t=77
APPROACH_080_JOINTS = [-0.458165, -1.377751, 1.926036, -2.116643, 1.599715, 1.859137, 1.109901]  # t=80
APPROACH_085_JOINTS = [-0.501885, -1.475658, 1.928838, -2.031127, 1.637382, 1.782990, 1.207756]  # t=85
APPROACH_090_JOINTS = [-0.521127, -1.543071, 1.923821, -1.984175, 1.678040, 1.744816, 1.287456]  # t=90
APPROACH_095_JOINTS = [-0.515897, -1.608195, 1.948325, -1.945129, 1.685879, 1.808328, 1.400094]  # t=95
APPROACH_100_JOINTS = [-0.492653, -1.660548, 1.981257, -1.912741, 1.681505, 1.887855, 1.569117]  # t=100
APPROACH_105_JOINTS = [-0.475596, -1.678351, 1.978737, -1.911884, 1.691991, 1.882214, 1.681354]  # t=105
APPROACH_109_JOINTS = [-0.472872, -1.687923, 1.974466, -1.911832, 1.700608, 1.871727, 1.741322]  # t=109
APPROACH_110_JOINTS = [-0.473410, -1.690335, 1.973501, -1.911929, 1.702001, 1.870338, 1.754507]  # t=110
APPROACH_115_JOINTS = [-0.467171, -1.707642, 1.969652, -1.909893, 1.665012, 1.901210, 1.855464]  # t=115
APPROACH_120_JOINTS = [-0.439868, -1.723646, 1.976159, -1.900045, 1.583729, 1.962253, 2.014504]  # t=120
APPROACH_125_JOINTS = [-0.427324, -1.748652, 1.984782, -1.890724, 1.519664, 2.014230, 2.163314]  # t=125
APPROACH_130_JOINTS = [-0.432550, -1.762870, 1.995153, -1.885121, 1.456893, 2.067393, 2.302735]  # t=130
APPROACH_132_JOINTS = [-0.437758, -1.762857, 2.001701, -1.884056, 1.434737, 2.087867, 2.353798]  # t=132
APPROACH_135_JOINTS = [-0.457348, -1.762897, 2.012402, -1.878913, 1.419970, 2.105288, 2.408099]  # t=135
APPROACH_140_JOINTS = [-0.532471, -1.762948, 2.037768, -1.849720, 1.424102, 2.145791, 2.433723]  # t=140
APPROACH_145_JOINTS = [-0.610718, -1.762970, 2.051894, -1.810871, 1.434546, 2.177125, 2.424417]  # t=145
APPROACH_148_JOINTS = [-0.654004, -1.762971, 2.060503, -1.782143, 1.440722, 2.197697, 2.412773]  # t=148
PRESS_150_JOINTS = [-0.681977, -1.763002, 2.058708, -1.771842, 1.445463, 2.201639, 2.386838]  # t=150
PRESS_152_JOINTS = [-0.711498, -1.763016, 2.056973, -1.760683, 1.454591, 2.205182, 2.355730]  # t=152
PRESS_154_JOINTS = [-0.741570, -1.763021, 2.054795, -1.748860, 1.465050, 2.207446, 2.323542]  # t=154
PRESS_156_JOINTS = [-0.771601, -1.763035, 2.052346, -1.736406, 1.475927, 2.208672, 2.291835]  # t=156
PRESS_157_JOINTS = [-0.786732, -1.763036, 2.051075, -1.729787, 1.481410, 2.209024, 2.276034]  # t=157
PRESS_158_JOINTS = [-0.802533, -1.763055, 2.049884, -1.722580, 1.486764, 2.209914, 2.259863]  # t=158
PRESS_160_JOINTS = [-0.836653, -1.763055, 2.047157, -1.706072, 1.496886, 2.210846, 2.225500]  # t=160
PRESS_161_JOINTS = [-0.853547, -1.763052, 2.045372, -1.696920, 1.501580, 2.208938, 2.208291]  # t=161
PRESS_162_JOINTS = [-0.868784, -1.763031, 2.043078, -1.687852, 1.505763, 2.203884, 2.192041]  # t=162
PRESS_163_JOINTS = [-0.881975, -1.763033, 2.040598, -1.679237, 1.509532, 2.196826, 2.177413]  # t=163
PRESS_164_JOINTS = [-0.892678, -1.763028, 2.038103, -1.670884, 1.511164, 2.188022, 2.165062]  # t=164
PRESS_165_JOINTS = [-0.900860, -1.763020, 2.035667, -1.663260, 1.511710, 2.177760, 2.155097]  # t=165
PRESS_166_JOINTS = [-0.906863, -1.763021, 2.033353, -1.656676, 1.512010, 2.167007, 2.146686]  # t=166
PRESS_167_JOINTS = [-0.910443, -1.763031, 2.031609, -1.651095, 1.509773, 2.158024, 2.141288]  # t=167
PRESS_168_JOINTS = [-0.911923, -1.763030, 2.030521, -1.646077, 1.505036, 2.150419, 2.138780]  # t=168
PRESS_170_JOINTS = [-0.912054, -1.763034, 2.029374, -1.636799, 1.490815, 2.138832, 2.138297]  # t=170
PRESS_172_JOINTS = [-0.911483, -1.763070, 2.030132, -1.626711, 1.466150, 2.136173, 2.144337]  # t=172
PRESS_174_JOINTS = [-0.909633, -1.763064, 2.032769, -1.615593, 1.429716, 2.139835, 2.159814]  # t=174
PRESS_176_JOINTS = [-0.906300, -1.763032, 2.034865, -1.605079, 1.396387, 2.138633, 2.174809]  # t=176
PRESS_178_JOINTS = [-0.902996, -1.763036, 2.034197, -1.597845, 1.379813, 2.129274, 2.184498]  # t=178
PRESS_180_JOINTS = [-0.898660, -1.763033, 2.033560, -1.594663, 1.376400, 2.123535, 2.195074]  # t=180
PRESS_182_JOINTS = [-0.892886, -1.763027, 2.032951, -1.593524, 1.380511, 2.119194, 2.204301]  # t=182
PRESS_184_JOINTS = [-0.886145, -1.763025, 2.032505, -1.593846, 1.387878, 2.115697, 2.211785]  # t=184
PRESS_186_JOINTS = [-0.878496, -1.763017, 2.032269, -1.595577, 1.397107, 2.112797, 2.217131]  # t=186
PRESS_188_JOINTS = [-0.869610, -1.763001, 2.032015, -1.599494, 1.411234, 2.110003, 2.218909]  # t=188
PRESS_190_JOINTS = [-0.860883, -1.762993, 2.029932, -1.604830, 1.435918, 2.101072, 2.213332]  # t=190
PRESS_191_JOINTS = [-0.857170, -1.763013, 2.029111, -1.607431, 1.448612, 2.098065, 2.210350]  # t=191
PRESS_192_JOINTS = [-0.853560, -1.763014, 2.028912, -1.609948, 1.459121, 2.096994, 2.208394]  # t=192
PRESS_194_JOINTS = [-0.846466, -1.763013, 2.029082, -1.613782, 1.473594, 2.095872, 2.207026]  # t=194
PRESS_196_JOINTS = [-0.840222, -1.762997, 2.028749, -1.615911, 1.484883, 2.092461, 2.207045]  # t=196
PRESS_198_JOINTS = [-0.836206, -1.762958, 2.025532, -1.615957, 1.503140, 2.079063, 2.203880]  # t=198
PRESS_199_JOINTS = [-0.835807, -1.762955, 2.021649, -1.614706, 1.519806, 2.065850, 2.198321]  # t=199
PRESS_200_JOINTS = [-0.836803, -1.762958, 2.016773, -1.611273, 1.540109, 2.050441, 2.191315]  # t=200
PRESS_201_JOINTS = [-0.839259, -1.762965, 2.011255, -1.606177, 1.561962, 2.032818, 2.183188]  # t=201
PRESS_202_JOINTS = [-0.843233, -1.762980, 2.005628, -1.597866, 1.583980, 2.015452, 2.175249]  # t=202
PRESS_203_JOINTS = [-0.848500, -1.762986, 2.000161, -1.586114, 1.604243, 1.998535, 2.169345]  # t=203
PRESS_204_JOINTS = [-0.854923, -1.762988, 1.994790, -1.571830, 1.622348, 1.980988, 2.165739]  # t=204
PRESS_205_JOINTS = [-0.862510, -1.762986, 1.989547, -1.555289, 1.639186, 1.962032, 2.163845]  # t=205
PRESS_206_JOINTS = [-0.870009, -1.762968, 1.984793, -1.547228, 1.652406, 1.935904, 2.159231]  # t=206
PRESS_208_JOINTS = [-0.886037, -1.762979, 1.975538, -1.537382, 1.681661, 1.886403, 2.139312]  # t=208
PRESS_210_JOINTS = [-0.902315, -1.762986, 1.968258, -1.525151, 1.704468, 1.843028, 2.121178]  # t=210
PRESS_211_JOINTS = [-0.910048, -1.762986, 1.965228, -1.517892, 1.711686, 1.823630, 2.115035]  # t=211
PRESS_212_JOINTS = [-0.917290, -1.762991, 1.962402, -1.509959, 1.715565, 1.806152, 2.112026]  # t=212
PRESS_214_JOINTS = [-0.929663, -1.762995, 1.958037, -1.491835, 1.712733, 1.778898, 2.116665]  # t=214
PRESS_215_JOINTS = [-0.934880, -1.762993, 1.956179, -1.481979, 1.708675, 1.766452, 2.122390]  # t=215
PRESS_216_JOINTS = [-0.939675, -1.762999, 1.954423, -1.471471, 1.702984, 1.754361, 2.130202]  # t=216
PRESS_218_JOINTS = [-0.947617, -1.763015, 1.951672, -1.448425, 1.683920, 1.734836, 2.150988]  # t=218
PRESS_220_JOINTS = [-0.952957, -1.763018, 1.949835, -1.423106, 1.656985, 1.719256, 2.176969]  # t=220
PRESS_221_JOINTS = [-0.955175, -1.763025, 1.948567, -1.409543, 1.643082, 1.709169, 2.189174]  # t=221
PRESS_222_JOINTS = [-0.957489, -1.763044, 1.947047, -1.395121, 1.629916, 1.696453, 2.201230]  # t=222
PRESS_224_JOINTS = [-0.963672, -1.763092, 1.943345, -1.361815, 1.606801, 1.661273, 2.226746]  # t=224
PRESS_226_JOINTS = [-0.973588, -1.763143, 1.939324, -1.320253, 1.590114, 1.611604, 2.254494]  # t=226
PRESS_228_JOINTS = [-0.988361, -1.763179, 1.936339, -1.267931, 1.580553, 1.550533, 2.284929]  # t=228
PRESS_229_JOINTS = [-0.997610, -1.763194, 1.935548, -1.236783, 1.578904, 1.519248, 2.302030]  # t=229
PRESS_230_JOINTS = [-1.007109, -1.763152, 1.933098, -1.206180, 1.577862, 1.487466, 2.323894]  # t=230
PRESS_232_JOINTS = [-1.023255, -1.763175, 1.923936, -1.150116, 1.584248, 1.423993, 2.377499]  # t=232
PRESS_233_JOINTS = [-1.030330, -1.763184, 1.920537, -1.120834, 1.590310, 1.395118, 2.404976]  # t=233
PRESS_234_JOINTS = [-1.039588, -1.763216, 1.918282, -1.091153, 1.595428, 1.386589, 2.428784]  # t=234
PRESS_235_JOINTS = [-1.050359, -1.763186, 1.920748, -1.062000, 1.595691, 1.392226, 2.447630]  # t=235
PRESS_236_JOINTS = [-1.061683, -1.763174, 1.925220, -1.034104, 1.593524, 1.400630, 2.463991]  # t=236
RETREAT_247_JOINTS = [-1.112305, -1.763197, 2.007871, -0.814548, 1.607050, 1.572780, 2.613757]  # t=247
APPROACH_000_JOINTS = [0.015714, -1.034627, -0.021152, -2.276251, 0.036749, 1.494713, 0.676051]  # 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_004_JOINTS, input_type='joint', steps=3, 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_010_JOINTS, input_type='joint', steps=3, 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_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_027_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_030_JOINTS, input_type='joint', steps=3, 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_039_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_040_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_043_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_045_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_046_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_050_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_055_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_057_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_059_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_060_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_062_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_065_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_068_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_070_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_075_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_077_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_080_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_085_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_090_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_095_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_100_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_105_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_109_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_110_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_115_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_120_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_125_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_130_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_132_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_135_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_140_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_145_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_148_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_150_JOINTS, input_type='joint', steps=2, 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_157_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_158_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_160_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_161_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_162_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_163_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_164_JOINTS, input_type='joint', steps=1, 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_167_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_168_JOINTS, input_type='joint', steps=1, 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_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_194_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_196_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_198_JOINTS, input_type='joint', steps=2, 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)
    moveJoint(PRESS_201_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_202_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_203_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_204_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_205_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_206_JOINTS, input_type='joint', steps=1, 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_211_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_212_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_214_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_215_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_216_JOINTS, input_type='joint', steps=1, 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_221_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_222_JOINTS, input_type='joint', steps=1, 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_229_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_230_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_232_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_233_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_234_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_235_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_236_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_247_JOINTS, input_type='joint', steps=11, 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