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

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

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

OBJ_POSE_T0 = pose(x=2.925240, y=-3.337099, z=0.948000, qw=0.995681, qx=-0.043014, qy=-0.078565, qz=-0.024412)
GOAL_RECEPTACLE_POSE = pose(x=2.733786, y=-3.103936, z=0.944357, qw=0.937151, qx=-0.062491, qy=0.068873, qz=-0.336303)

APPROACH_005_JOINTS = [-0.019891, -1.024731, -0.053783, -2.274713, 0.061069, 1.453361, 0.699126]  # t=5
APPROACH_010_JOINTS = [-0.032322, -1.074667, -0.134811, -2.297602, 0.039763, 1.418623, 0.716398]  # t=10
APPROACH_015_JOINTS = [-0.044777, -1.118505, -0.204537, -2.335072, 0.022942, 1.417267, 0.734074]  # t=15
APPROACH_020_JOINTS = [-0.057539, -1.135014, -0.281051, -2.377871, -0.003829, 1.450273, 0.739314]  # t=20
APPROACH_023_JOINTS = [-0.068643, -1.138085, -0.312373, -2.408437, -0.064540, 1.502007, 0.756018]  # t=23
APPROACH_025_JOINTS = [-0.070044, -1.116205, -0.300871, -2.424112, -0.125493, 1.568959, 0.762726]  # t=25
APPROACH_030_JOINTS = [-0.065031, -0.965803, -0.266090, -2.426456, -0.300401, 1.757262, 0.813476]  # t=30
APPROACH_032_JOINTS = [-0.064427, -0.881025, -0.262272, -2.406958, -0.372933, 1.819931, 0.850956]  # t=32
APPROACH_035_JOINTS = [-0.064472, -0.740095, -0.304731, -2.350216, -0.424770, 1.888100, 0.888540]  # t=35
APPROACH_040_JOINTS = [-0.059267, -0.546390, -0.447730, -2.214307, -0.329852, 1.929120, 0.854513]  # t=40
APPROACH_045_JOINTS = [-0.050392, -0.374355, -0.604900, -2.070046, -0.192882, 1.917885, 0.740054]  # t=45
APPROACH_050_JOINTS = [-0.056437, -0.285662, -0.753473, -1.970997, -0.114721, 1.866768, 0.520689]  # t=50
APPROACH_055_JOINTS = [-0.052213, -0.210454, -0.842797, -1.904568, -0.009754, 1.846318, 0.344958]  # t=55
APPROACH_059_JOINTS = [-0.050607, -0.137625, -0.869852, -1.852720, 0.047500, 1.823694, 0.298466]  # t=59
APPROACH_060_JOINTS = [-0.052766, -0.123300, -0.873627, -1.844699, 0.056904, 1.819114, 0.289329]  # t=60
APPROACH_065_JOINTS = [-0.074379, -0.069422, -0.867210, -1.858968, 0.060301, 1.871151, 0.245325]  # t=65
APPROACH_070_JOINTS = [-0.103037, -0.053470, -0.829390, -1.900578, 0.018761, 1.939918, 0.167502]  # t=70
APPROACH_075_JOINTS = [-0.123947, 0.000116, -0.766174, -1.946156, -0.063566, 2.025409, 0.111975]  # t=75
APPROACH_079_JOINTS = [-0.142835, 0.074819, -0.712851, -1.943651, -0.089875, 2.058256, 0.077255]  # t=79
APPROACH_080_JOINTS = [-0.148333, 0.098650, -0.698180, -1.934721, -0.095414, 2.058572, 0.074380]  # t=80
APPROACH_084_JOINTS = [-0.177743, 0.177685, -0.646901, -1.883794, -0.105809, 2.032872, 0.071340]  # t=84
APPROACH_085_JOINTS = [-0.187570, 0.190052, -0.639093, -1.871173, -0.102529, 2.027592, 0.069676]  # t=85
APPROACH_090_JOINTS = [-0.249655, 0.266013, -0.623308, -1.808600, -0.066936, 2.048938, 0.022979]  # t=90
APPROACH_092_JOINTS = [-0.278396, 0.304130, -0.620407, -1.778287, -0.043401, 2.061724, -0.007005]  # t=92
APPROACH_095_JOINTS = [-0.325278, 0.373556, -0.608420, -1.722511, 0.011550, 2.074439, -0.058207]  # t=95
APPROACH_096_JOINTS = [-0.342231, 0.399888, -0.602867, -1.699310, 0.032678, 2.075612, -0.075726]  # t=96
DESCEND_098_JOINTS = [-0.378302, 0.452879, -0.590867, -1.645250, 0.076603, 2.067007, -0.111898]  # t=98
DESCEND_100_JOINTS = [-0.417894, 0.500556, -0.580535, -1.582839, 0.123174, 2.034256, -0.153389]  # t=100
DESCEND_102_JOINTS = [-0.459749, 0.544559, -0.570595, -1.514363, 0.168545, 1.988586, -0.195236]  # t=102
DESCEND_104_JOINTS = [-0.500460, 0.586386, -0.559692, -1.443064, 0.200307, 1.939881, -0.226636]  # t=104
DESCEND_106_JOINTS = [-0.539660, 0.628166, -0.547013, -1.371621, 0.221472, 1.897105, -0.247440]  # t=106
DESCEND_108_JOINTS = [-0.575306, 0.664848, -0.532524, -1.307274, 0.231870, 1.854625, -0.258915]  # t=108
DESCEND_110_JOINTS = [-0.606604, 0.697771, -0.515071, -1.261250, 0.235995, 1.820655, -0.264628]  # t=110
DESCEND_112_JOINTS = [-0.633999, 0.730680, -0.495195, -1.231466, 0.238351, 1.806531, -0.267520]  # t=112
DESCEND_114_JOINTS = [-0.656978, 0.760086, -0.474702, -1.210829, 0.240848, 1.804844, -0.268266]  # t=114
DESCEND_116_JOINTS = [-0.676685, 0.784193, -0.456635, -1.198161, 0.245825, 1.808992, -0.269873]  # t=116
DESCEND_117_JOINTS = [-0.685777, 0.794355, -0.449015, -1.195482, 0.250264, 1.813387, -0.272385]  # t=117
DESCEND_118_JOINTS = [-0.694249, 0.798577, -0.444090, -1.189580, 0.255342, 1.817804, -0.276156]  # t=118
DESCEND_120_JOINTS = [-0.710244, 0.800571, -0.435660, -1.183358, 0.275611, 1.824026, -0.288962]  # t=120
DESCEND_122_JOINTS = [-0.724920, 0.798335, -0.428969, -1.186013, 0.305527, 1.834744, -0.308382]  # t=122
DESCEND_124_JOINTS = [-0.736755, 0.794042, -0.424020, -1.193927, 0.336233, 1.848920, -0.328771]  # t=124
DESCEND_126_JOINTS = [-0.745248, 0.788254, -0.420643, -1.204442, 0.363557, 1.862544, -0.347201]  # t=126
DESCEND_128_JOINTS = [-0.748307, 0.781828, -0.419470, -1.213823, 0.374100, 1.868730, -0.357573]  # t=128
DESCEND_129_JOINTS = [-0.748413, 0.779533, -0.419392, -1.217400, 0.374896, 1.870786, -0.359648]  # t=129
DESCEND_130_JOINTS = [-0.748210, 0.777562, -0.419516, -1.220558, 0.374967, 1.872385, -0.360774]  # t=130
DESCEND_131_JOINTS = [-0.747961, 0.775765, -0.420055, -1.223612, 0.374868, 1.873490, -0.361664]  # t=131
DESCEND_132_JOINTS = [-0.747618, 0.773579, -0.420887, -1.227075, 0.374782, 1.873324, -0.362657]  # t=132
DESCEND_134_JOINTS = [-0.746536, 0.768229, -0.422999, -1.235034, 0.374727, 1.872582, -0.364412]  # t=134
DESCEND_136_JOINTS = [-0.744893, 0.761967, -0.425271, -1.244343, 0.374707, 1.871802, -0.365499]  # t=136
DESCEND_138_JOINTS = [-0.742620, 0.755081, -0.427479, -1.254768, 0.374594, 1.872109, -0.366213]  # t=138
GRASP_142_JOINTS = [-0.738769, 0.744559, -0.433343, -1.273270, 0.374213, 1.877484, -0.370353]  # t=142
GRASP_143_JOINTS = [-0.738736, 0.740532, -0.437402, -1.279751, 0.372898, 1.875723, -0.373507]  # t=143
GRASP_145_JOINTS = [-0.740755, 0.727676, -0.450514, -1.299544, 0.370898, 1.868905, -0.387298]  # t=145
GRASP_HOLD_145_JOINTS = [-0.740755, 0.727676, -0.450514, -1.299544, 0.370898, 1.868905, -0.387298]  # t=145
LIFT_146_JOINTS = [-0.742503, 0.719262, -0.458648, -1.312609, 0.370257, 1.866182, -0.398804]  # t=146
LIFT_147_JOINTS = [-0.744557, 0.709582, -0.467630, -1.327872, 0.369101, 1.864270, -0.414255]  # t=147
LIFT_148_JOINTS = [-0.746898, 0.698745, -0.477282, -1.345399, 0.367735, 1.862869, -0.433441]  # t=148
LIFT_149_JOINTS = [-0.749579, 0.686786, -0.487800, -1.365053, 0.366131, 1.861913, -0.455949]  # t=149
LIFT_150_JOINTS = [-0.752446, 0.673680, -0.499014, -1.386165, 0.364301, 1.861666, -0.481346]  # t=150
LIFT_151_JOINTS = [-0.755280, 0.659477, -0.510627, -1.407970, 0.361971, 1.861953, -0.509364]  # t=151
PLACE_153_JOINTS = [-0.760469, 0.627769, -0.535103, -1.451623, 0.354929, 1.862444, -0.570711]  # t=153
PLACE_155_JOINTS = [-0.764644, 0.593400, -0.560516, -1.493196, 0.344739, 1.862696, -0.635756]  # t=155
PLACE_157_JOINTS = [-0.768158, 0.562112, -0.585618, -1.533512, 0.333226, 1.869028, -0.700908]  # t=157
PLACE_159_JOINTS = [-0.771227, 0.535162, -0.609745, -1.575202, 0.322003, 1.882453, -0.767034]  # t=159
PLACE_161_JOINTS = [-0.770158, 0.499064, -0.632715, -1.619703, 0.305944, 1.888738, -0.830276]  # t=161
PLACE_163_JOINTS = [-0.759983, 0.444361, -0.652719, -1.667592, 0.278102, 1.890166, -0.878977]  # t=163
PLACE_165_JOINTS = [-0.740111, 0.376981, -0.671016, -1.720211, 0.231009, 1.902205, -0.910154]  # t=165
PLACE_167_JOINTS = [-0.712207, 0.304435, -0.691523, -1.778143, 0.155619, 1.933152, -0.926380]  # t=167
PLACE_169_JOINTS = [-0.679759, 0.232126, -0.714806, -1.841740, 0.068017, 1.981295, -0.937898]  # t=169
PLACE_171_JOINTS = [-0.646596, 0.167941, -0.741630, -1.912794, -0.014826, 2.045112, -0.959077]  # t=171
PLACE_173_JOINTS = [-0.614198, 0.110847, -0.772807, -1.988464, -0.082244, 2.117424, -0.994114]  # t=173
PLACE_175_JOINTS = [-0.582853, 0.061106, -0.807873, -2.068890, -0.128186, 2.193784, -1.037377]  # t=175
PLACE_177_JOINTS = [-0.551486, 0.018796, -0.843794, -2.144982, -0.163146, 2.264761, -1.080083]  # t=177
PLACE_179_JOINTS = [-0.519682, -0.020685, -0.878769, -2.205798, -0.195010, 2.319442, -1.119180]  # t=179
PLACE_181_JOINTS = [-0.487777, -0.057465, -0.912761, -2.253381, -0.226176, 2.359970, -1.157190]  # t=181
PLACE_183_JOINTS = [-0.457224, -0.095658, -0.949083, -2.294378, -0.261191, 2.390581, -1.200509]  # t=183
PLACE_185_JOINTS = [-0.427764, -0.140220, -0.984910, -2.332829, -0.302633, 2.413541, -1.245210]  # t=185
PLACE_187_JOINTS = [-0.398169, -0.188364, -1.017463, -2.364738, -0.344898, 2.426252, -1.283883]  # t=187
PLACE_189_JOINTS = [-0.367834, -0.233582, -1.050408, -2.390330, -0.384628, 2.429681, -1.317805]  # t=189
PLACE_191_JOINTS = [-0.333153, -0.265583, -1.089245, -2.410002, -0.405347, 2.425548, -1.355048]  # t=191
PLACE_193_JOINTS = [-0.294604, -0.287618, -1.131081, -2.415783, -0.411663, 2.409960, -1.392168]  # t=193
PLACE_195_JOINTS = [-0.254279, -0.303491, -1.169816, -2.413527, -0.418344, 2.393361, -1.414614]  # t=195
PLACE_197_JOINTS = [-0.215562, -0.320478, -1.202531, -2.409758, -0.430533, 2.371298, -1.420198]  # t=197
PLACE_199_JOINTS = [-0.180585, -0.342223, -1.228389, -2.406153, -0.450940, 2.342445, -1.412894]  # t=199
PLACE_201_JOINTS = [-0.152176, -0.371955, -1.244197, -2.400018, -0.481417, 2.299222, -1.392165]  # t=201
PLACE_203_JOINTS = [-0.130514, -0.409299, -1.251220, -2.390750, -0.520498, 2.247480, -1.359933]  # t=203
PLACE_205_JOINTS = [-0.112179, -0.442222, -1.251615, -2.382176, -0.580622, 2.195343, -1.313969]  # t=205
PLACE_207_JOINTS = [-0.091319, -0.463648, -1.253234, -2.379785, -0.655608, 2.154012, -1.257785]  # t=207
PLACE_209_JOINTS = [-0.067146, -0.477634, -1.257801, -2.380088, -0.725800, 2.117219, -1.198239]  # t=209
PLACE_211_JOINTS = [-0.040983, -0.486723, -1.265480, -2.380369, -0.785970, 2.081238, -1.136435]  # t=211
PLACE_213_JOINTS = [-0.011208, -0.488062, -1.282167, -2.385202, -0.842246, 2.054293, -1.074686]  # t=213
PLACE_215_JOINTS = [0.022657, -0.483675, -1.309702, -2.394010, -0.891277, 2.038817, -1.012632]  # t=215
PLACE_217_JOINTS = [0.058134, -0.480502, -1.336901, -2.398341, -0.921464, 2.017168, -0.955113]  # t=217
PLACE_219_JOINTS = [0.094984, -0.480099, -1.364601, -2.396852, -0.937417, 1.990887, -0.906074]  # t=219
PLACE_221_JOINTS = [0.133514, -0.482390, -1.394481, -2.393175, -0.948326, 1.966511, -0.861891]  # t=221
PLACE_223_JOINTS = [0.170766, -0.489655, -1.416672, -2.386886, -0.956333, 1.932356, -0.818194]  # t=223
PLACE_225_JOINTS = [0.205739, -0.502335, -1.432415, -2.380528, -0.967591, 1.891677, -0.779930]  # t=225
PLACE_227_JOINTS = [0.243048, -0.514005, -1.455755, -2.386556, -1.006541, 1.859010, -0.740289]  # t=227
PLACE_229_JOINTS = [0.284867, -0.525301, -1.487326, -2.405460, -1.067272, 1.836548, -0.682129]  # t=229
PLACE_231_JOINTS = [0.329028, -0.542409, -1.520395, -2.427418, -1.128068, 1.811712, -0.616829]  # t=231
PLACE_233_JOINTS = [0.372261, -0.568325, -1.543578, -2.420149, -1.173080, 1.768002, -0.575170]  # t=233
PLACE_235_JOINTS = [0.407858, -0.604370, -1.557807, -2.404099, -1.193781, 1.705323, -0.555493]  # t=235
PLACE_237_JOINTS = [0.430852, -0.646471, -1.569826, -2.385527, -1.215201, 1.640736, -0.546306]  # t=237
PLACE_239_JOINTS = [0.443129, -0.691498, -1.578185, -2.369088, -1.241532, 1.581438, -0.542611]  # t=239
PLACE_241_JOINTS = [0.445637, -0.736369, -1.582365, -2.356909, -1.270443, 1.526579, -0.542171]  # t=241
PLACE_243_JOINTS = [0.440184, -0.779106, -1.581374, -2.349443, -1.299505, 1.479468, -0.543909]  # t=243
PLACE_245_JOINTS = [0.432893, -0.818450, -1.573064, -2.346971, -1.323482, 1.444578, -0.544242]  # t=245
PLACE_247_JOINTS = [0.427689, -0.852360, -1.570267, -2.348164, -1.351835, 1.419603, -0.542082]  # t=247
PLACE_249_JOINTS = [0.427994, -0.876579, -1.566657, -2.356204, -1.387875, 1.391457, -0.526390]  # t=249
PLACE_251_JOINTS = [0.431096, -0.892799, -1.560679, -2.369860, -1.421886, 1.361599, -0.498022]  # t=251
PLACE_253_JOINTS = [0.430596, -0.903736, -1.540714, -2.382444, -1.427446, 1.327942, -0.475300]  # t=253
PLACE_255_JOINTS = [0.420659, -0.906631, -1.486698, -2.378877, -1.398554, 1.279764, -0.474442]  # t=255
PLACE_257_JOINTS = [0.400491, -0.907104, -1.421960, -2.362624, -1.348891, 1.242522, -0.496499]  # t=257
PLACE_259_JOINTS = [0.376002, -0.907903, -1.375070, -2.350687, -1.300016, 1.234751, -0.527943]  # t=259
PLACE_261_JOINTS = [0.354350, -0.905632, -1.350194, -2.353180, -1.270741, 1.253054, -0.544271]  # t=261
PLACE_263_JOINTS = [0.337551, -0.897360, -1.335450, -2.365262, -1.254876, 1.275461, -0.545869]  # t=263
PLACE_265_JOINTS = [0.324247, -0.887942, -1.331124, -2.383219, -1.239569, 1.308800, -0.539881]  # t=265
PLACE_267_JOINTS = [0.313792, -0.879782, -1.346430, -2.408097, -1.232890, 1.361761, -0.528114]  # t=267
PLACE_269_JOINTS = [0.303965, -0.875428, -1.375137, -2.427632, -1.226763, 1.425080, -0.525572]  # t=269
PLACE_271_JOINTS = [0.294832, -0.875681, -1.412899, -2.440242, -1.220777, 1.490794, -0.537558]  # t=271
PLACE_273_JOINTS = [0.289095, -0.879812, -1.459263, -2.451060, -1.219615, 1.555810, -0.555936]  # t=273
PLACE_275_JOINTS = [0.287900, -0.887791, -1.510043, -2.460014, -1.225906, 1.615739, -0.573472]  # t=275
PLACE_277_JOINTS = [0.289974, -0.900133, -1.556758, -2.465466, -1.235540, 1.663133, -0.588323]  # t=277
PLACE_279_JOINTS = [0.293349, -0.917712, -1.595583, -2.466394, -1.242569, 1.696230, -0.603064]  # t=279
PLACE_281_JOINTS = [0.296185, -0.938276, -1.617711, -2.462304, -1.242544, 1.709654, -0.616238]  # t=281
PLACE_283_JOINTS = [0.297658, -0.956268, -1.613553, -2.454835, -1.234718, 1.694878, -0.621048]  # t=283
PLACE_285_JOINTS = [0.298659, -0.972543, -1.609961, -2.451366, -1.239207, 1.678050, -0.619552]  # t=285
RELEASE_POSE_285_JOINTS = [0.298659, -0.972543, -1.609961, -2.451366, -1.239207, 1.678050, -0.619552]  # t=285
RETRACT_287_JOINTS = [0.299250, -0.987709, -1.607130, -2.449153, -1.246033, 1.664139, -0.616809]  # t=287
RETRACT_289_JOINTS = [0.299509, -1.001166, -1.604862, -2.447675, -1.252596, 1.652366, -0.614255]  # t=289
RETRACT_291_JOINTS = [0.299250, -1.012410, -1.601420, -2.446538, -1.257580, 1.641442, -0.612067]  # t=291
RETRACT_293_JOINTS = [0.296411, -1.020332, -1.586457, -2.444107, -1.252887, 1.624298, -0.611658]  # t=293
RETRACT_294_JOINTS = [0.292462, -1.022865, -1.570188, -2.441451, -1.242829, 1.611552, -0.613406]  # t=294
RETRACT_295_JOINTS = [0.286414, -1.024201, -1.547607, -2.437591, -1.227667, 1.595218, -0.616971]  # t=295
RETRACT_297_JOINTS = [0.267913, -1.023969, -1.485278, -2.426208, -1.182916, 1.554497, -0.629979]  # t=297
RETRACT_299_JOINTS = [0.242697, -1.022796, -1.414900, -2.412210, -1.123713, 1.512695, -0.651383]  # t=299
RETRACT_301_JOINTS = [0.215451, -1.020718, -1.351584, -2.389794, -1.057126, 1.473308, -0.673163]  # t=301
RETRACT_303_JOINTS = [0.189109, -1.017297, -1.295219, -2.358362, -0.981297, 1.434234, -0.679681]  # t=303
RETRACT_304_JOINTS = [0.175473, -1.015261, -1.265200, -2.343703, -0.941420, 1.412334, -0.673999]  # t=304
RETRACT_305_JOINTS = [0.160255, -1.013962, -1.231109, -2.332961, -0.900165, 1.387914, -0.660877]  # t=305
RETRACT_307_JOINTS = [0.123525, -1.017741, -1.151759, -2.325200, -0.808688, 1.339621, -0.611031]  # t=307
RETRACT_309_JOINTS = [0.078271, -1.033574, -1.071286, -2.328253, -0.714834, 1.302269, -0.537218]  # t=309
RETRACT_311_JOINTS = [0.027022, -1.062634, -0.994901, -2.341291, -0.630668, 1.278593, -0.452563]  # t=311
RETRACT_313_JOINTS = [-0.026572, -1.103637, -0.919983, -2.367281, -0.559656, 1.266689, -0.358997]  # t=313
RETRACT_315_JOINTS = [-0.079750, -1.155420, -0.846562, -2.401083, -0.494069, 1.261975, -0.258207]  # t=315
RETRACT_317_JOINTS = [-0.130210, -1.216551, -0.774877, -2.439482, -0.431841, 1.262624, -0.153610]  # t=317
RETRACT_319_JOINTS = [-0.175965, -1.284968, -0.704014, -2.480717, -0.373865, 1.265443, -0.049349]  # t=319
RETRACT_320_JOINTS = [-0.196575, -1.320822, -0.668873, -2.503874, -0.349251, 1.267220, 0.002180]  # t=320
APPROACH_000_JOINTS = [-0.013887, -1.007802, -0.019230, -2.272712, 0.080397, 1.477041, 0.683963]  # 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_020_JOINTS, input_type='joint', steps=5, 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_032_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_035_JOINTS, input_type='joint', steps=3, 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_050_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_055_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_059_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_060_JOINTS, input_type='joint', steps=1, 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_079_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_080_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_084_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_085_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_090_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_092_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_095_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_096_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)

def execute_grasp_approach():
    """Final Cartesian descent into grasp alignment."""
    moveJoint(DESCEND_098_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_100_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_102_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_104_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_106_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_108_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_110_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_112_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_114_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_116_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_117_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_118_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_120_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_122_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_124_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_126_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_128_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_129_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_130_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(DESCEND_131_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(DESCEND_132_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(DESCEND_134_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(DESCEND_136_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(DESCEND_138_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)

def close_gripper_on_object():
    """Close the gripper and let the grasp settle briefly."""
    moveJoint(GRASP_142_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=1.000)
    moveJoint(GRASP_143_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(GRASP_145_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    wait(duration=0.05, hold_target=GRASP_HOLD_145_JOINTS, input_type='joint', gripper=-0.3)
    grasp(hold_target=GRASP_HOLD_145_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_145_JOINTS, input_type='joint', gripper=1.0)

def lift_object():
    """Lift the grasped object clear of the counter."""
    moveJoint(LIFT_146_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(LIFT_147_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(LIFT_148_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(LIFT_149_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(LIFT_150_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(LIFT_151_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_153_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_155_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_157_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_159_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_161_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_163_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_165_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_167_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_169_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_171_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_173_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_175_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_177_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_179_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_181_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_183_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_185_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_187_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_189_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_191_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_193_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_195_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_197_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_199_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_201_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_203_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_205_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_207_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_209_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_211_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_213_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_215_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_217_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_219_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_221_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_223_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_225_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_227_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_229_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_231_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_233_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_235_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_237_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_239_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_241_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_243_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_245_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_247_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_249_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_251_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_253_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_255_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_257_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_259_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_261_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_263_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_265_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_267_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_269_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_271_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_273_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_275_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_277_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_279_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_281_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_283_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PLACE_285_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    wait(duration=0.05, hold_target=RELEASE_POSE_285_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_285_JOINTS, input_type='joint', open_steps=1, settle_steps=0, gripper=-1.0)
    wait(duration=0.05, hold_target=RELEASE_POSE_285_JOINTS, input_type='joint', gripper=-1.0)

def retreat_after_release():
    """Retreat away from the placed object without clipping it."""
    moveJoint(RETRACT_287_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_289_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_291_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_293_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_294_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_295_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_297_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_299_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_301_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_303_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_304_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_305_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_307_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_309_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_311_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_313_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_315_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_317_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_319_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_320_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)

move_to_pregrasp()
execute_grasp_approach()
close_gripper_on_object()
lift_object()
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

Pick the ladle from the counter and place it in the drawer.

distr

all steak meat food in_container oven_ready


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

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

SCENE_ARTIFACT = '../../../artifacts/20260324/PickPlaceCounterToMicrowave/20260324_205321_pick-place-counter-to-microwave_episode_000000_action2code-open-loop-joint_initial-scene.json'
POLICY_METADATA = {
    'policy_kind': 'open_loop_joint',
    'policy_variant': 'open-loop-joint',
    'task_name': 'PickPlaceCounterToMicrowave',
    'episode_id': 'episode_000000',
    'scene_artifact_path': '../../../artifacts/20260324/PickPlaceCounterToMicrowave/20260324_205321_pick-place-counter-to-microwave_episode_000000_action2code-open-loop-joint_initial-scene.json',
    'fitting_summary_path': '../../../artifacts/20260324/PickPlaceCounterToMicrowave/20260324_205321_pick-place-counter-to-microwave_episode_000000_action2code-open-loop-joint_fitting-summary.json',
    'extracted_pose_metadata_path': '../../../artifacts/20260324/PickPlaceCounterToMicrowave/20260324_205321_pick-place-counter-to-microwave_episode_000000_action2code-open-loop-joint_extracted-pose-metadata.json',
    'stable_grasp_contact_t': 102,
    'stable_release_contact_loss_t': 254,
    'uses_moveC': False,
    'controller_mode': 'whole_body_ik',
}

OBJ_POSE_T0 = pose(x=5.296058, y=-4.057625, z=0.953693, qw=0.949761, qx=0.004641, qy=-0.000584, qz=-0.312941)
GOAL_RECEPTACLE_POSE = pose(x=5.295939, y=-4.060427, z=0.929162, qw=0.723819, qx=-0.000466, qy=0.001940, qz=-0.689987)

APPROACH_003_JOINTS = [-0.007745, -1.043038, -0.044796, -2.259154, -0.002859, 1.547567, 0.669778]  # t=3
APPROACH_006_JOINTS = [-0.016189, -1.071147, -0.082225, -2.286114, -0.037395, 1.522008, 0.654707]  # t=6
APPROACH_008_JOINTS = [-0.026888, -1.108952, -0.124084, -2.313083, -0.077544, 1.501579, 0.657366]  # t=8
APPROACH_009_JOINTS = [-0.033000, -1.128570, -0.146862, -2.329304, -0.101041, 1.497526, 0.660502]  # t=9
APPROACH_012_JOINTS = [-0.049529, -1.177300, -0.221363, -2.383149, -0.173315, 1.514259, 0.642929]  # t=12
APPROACH_015_JOINTS = [-0.062259, -1.192132, -0.306846, -2.440126, -0.249087, 1.552979, 0.591214]  # t=15
APPROACH_018_JOINTS = [-0.072711, -1.178274, -0.393141, -2.472074, -0.330813, 1.591804, 0.525742]  # t=18
APPROACH_021_JOINTS = [-0.073253, -1.126874, -0.478281, -2.485427, -0.406577, 1.658773, 0.436934]  # t=21
APPROACH_023_JOINTS = [-0.064015, -1.058825, -0.534188, -2.480208, -0.445833, 1.715948, 0.377672]  # t=23
APPROACH_024_JOINTS = [-0.057415, -1.019126, -0.561772, -2.469868, -0.460376, 1.740846, 0.346484]  # t=24
APPROACH_027_JOINTS = [-0.029362, -0.878925, -0.642201, -2.423018, -0.493801, 1.804403, 0.248691]  # t=27
APPROACH_030_JOINTS = [0.012949, -0.706561, -0.707646, -2.359669, -0.508965, 1.864187, 0.167579]  # t=30
APPROACH_033_JOINTS = [0.060958, -0.519061, -0.767587, -2.278472, -0.488544, 1.914734, 0.089100]  # t=33
APPROACH_036_JOINTS = [0.094876, -0.357643, -0.821978, -2.193089, -0.426639, 1.939717, -0.010876]  # t=36
APPROACH_039_JOINTS = [0.101064, -0.243722, -0.876235, -2.120789, -0.353061, 1.958718, -0.153329]  # t=39
APPROACH_042_JOINTS = [0.089931, -0.140821, -0.916632, -2.070287, -0.272000, 1.998319, -0.297469]  # t=42
APPROACH_045_JOINTS = [0.063544, -0.037636, -0.932308, -2.027580, -0.164506, 2.055427, -0.438926]  # t=45
APPROACH_048_JOINTS = [0.018478, 0.063149, -0.914579, -1.994905, -0.037544, 2.105990, -0.567833]  # t=48
APPROACH_051_JOINTS = [-0.043397, 0.140449, -0.860439, -1.967994, 0.084184, 2.142523, -0.672081]  # t=51
APPROACH_053_JOINTS = [-0.090896, 0.181778, -0.815208, -1.951779, 0.147151, 2.156903, -0.727187]  # t=53
DESCEND_054_JOINTS = [-0.115257, 0.199664, -0.791703, -1.943732, 0.172390, 2.160720, -0.750556]  # t=54
DESCEND_055_JOINTS = [-0.139547, 0.216185, -0.768164, -1.935890, 0.194246, 2.162999, -0.771120]  # t=55
DESCEND_056_JOINTS = [-0.163311, 0.232797, -0.744361, -1.927584, 0.212320, 2.165763, -0.787860]  # t=56
DESCEND_057_JOINTS = [-0.186139, 0.249190, -0.720482, -1.918277, 0.226348, 2.168700, -0.800212]  # t=57
DESCEND_058_JOINTS = [-0.207876, 0.264942, -0.697006, -1.908206, 0.236960, 2.171611, -0.808387]  # t=58
DESCEND_059_JOINTS = [-0.228517, 0.280155, -0.674221, -1.897940, 0.245264, 2.174620, -0.813667]  # t=59
DESCEND_060_JOINTS = [-0.248264, 0.297181, -0.651705, -1.887341, 0.253158, 2.180859, -0.817391]  # t=60
DESCEND_061_JOINTS = [-0.267099, 0.316575, -0.628936, -1.875649, 0.261930, 2.190022, -0.820413]  # t=61
DESCEND_062_JOINTS = [-0.284872, 0.335691, -0.606804, -1.862451, 0.270333, 2.197670, -0.822537]  # t=62
GRASP_064_JOINTS = [-0.314808, 0.355518, -0.568607, -1.832870, 0.275501, 2.184772, -0.817064]  # t=64
GRASP_066_JOINTS = [-0.339085, 0.365195, -0.539061, -1.806857, 0.269795, 2.161572, -0.805505]  # t=66
GRASP_072_JOINTS = [-0.390639, 0.382237, -0.491170, -1.764052, 0.255946, 2.113836, -0.797301]  # t=72
GRASP_077_JOINTS = [-0.414967, 0.375846, -0.485304, -1.772075, 0.247873, 2.085659, -0.809713]  # t=77
GRASP_079_JOINTS = [-0.419857, 0.368927, -0.483786, -1.784592, 0.247583, 2.086228, -0.815145]  # t=79
GRASP_081_JOINTS = [-0.421317, 0.367649, -0.477672, -1.792297, 0.248682, 2.092193, -0.813197]  # t=81
GRASP_086_JOINTS = [-0.420428, 0.375940, -0.464045, -1.791546, 0.249298, 2.097330, -0.797619]  # t=86
GRASP_091_JOINTS = [-0.423042, 0.380002, -0.466912, -1.787660, 0.249213, 2.079495, -0.799537]  # t=91
GRASP_100_JOINTS = [-0.425996, 0.367167, -0.479463, -1.832185, 0.246602, 2.093302, -0.816335]  # t=100
GRASP_102_JOINTS = [-0.426176, 0.370650, -0.478962, -1.828817, 0.248644, 2.097824, -0.817088]  # t=102
GRASP_HOLD_102_JOINTS = [-0.426176, 0.370650, -0.478962, -1.828817, 0.248644, 2.097824, -0.817088]  # t=102
LIFT_103_JOINTS = [-0.426356, 0.372321, -0.478982, -1.826281, 0.249039, 2.097336, -0.817038]  # t=103
LIFT_104_JOINTS = [-0.426558, 0.373495, -0.479067, -1.823695, 0.249182, 2.095628, -0.816935]  # t=104
LIFT_105_JOINTS = [-0.426699, 0.373632, -0.479231, -1.821457, 0.249055, 2.092537, -0.816722]  # t=105
LIFT_106_JOINTS = [-0.426877, 0.373794, -0.479417, -1.819534, 0.248959, 2.090256, -0.816584]  # t=106
LIFT_107_JOINTS = [-0.427185, 0.373746, -0.479869, -1.817770, 0.248975, 2.087887, -0.816580]  # t=107
LIFT_108_JOINTS = [-0.427582, 0.372720, -0.480850, -1.817164, 0.248640, 2.083982, -0.816916]  # t=108
LIFT_109_JOINTS = [-0.428111, 0.371282, -0.482418, -1.817802, 0.247786, 2.079787, -0.817827]  # t=109
LIFT_110_JOINTS = [-0.428896, 0.368914, -0.484895, -1.819920, 0.246929, 2.074261, -0.819847]  # t=110
LIFT_111_JOINTS = [-0.430104, 0.364753, -0.488839, -1.824013, 0.246620, 2.066955, -0.823940]  # t=111
LIFT_112_JOINTS = [-0.431714, 0.358961, -0.494168, -1.830097, 0.246795, 2.058802, -0.830349]  # t=112
LIFT_113_JOINTS = [-0.433567, 0.352036, -0.500537, -1.837816, 0.247136, 2.050835, -0.838566]  # t=113
LIFT_114_JOINTS = [-0.435571, 0.344117, -0.507811, -1.847108, 0.247563, 2.042924, -0.848230]  # t=114
LIFT_115_JOINTS = [-0.437615, 0.335801, -0.515354, -1.857419, 0.249054, 2.035140, -0.859166]  # t=115
LIFT_116_JOINTS = [-0.439643, 0.325851, -0.523746, -1.867637, 0.250632, 2.025288, -0.870885]  # t=116
LIFT_117_JOINTS = [-0.441549, 0.312839, -0.533286, -1.876773, 0.252290, 2.012282, -0.883393]  # t=117
LIFT_118_JOINTS = [-0.443145, 0.295514, -0.543979, -1.883651, 0.254219, 1.994759, -0.896460]  # t=118
LIFT_119_JOINTS = [-0.444096, 0.273847, -0.555805, -1.887010, 0.253927, 1.970268, -0.908084]  # t=119
PLACE_121_JOINTS = [-0.444440, 0.224654, -0.583208, -1.885506, 0.247389, 1.907276, -0.923389]  # t=121
PLACE_123_JOINTS = [-0.443818, 0.171323, -0.617740, -1.881624, 0.237132, 1.841278, -0.936330]  # t=123
PLACE_125_JOINTS = [-0.441559, 0.111320, -0.658579, -1.879891, 0.226149, 1.776554, -0.951771]  # t=125
PLACE_127_JOINTS = [-0.434962, 0.040524, -0.700331, -1.882511, 0.211306, 1.713644, -0.958653]  # t=127
PLACE_129_JOINTS = [-0.421957, -0.045835, -0.737570, -1.890987, 0.191144, 1.648600, -0.945850]  # t=129
PLACE_131_JOINTS = [-0.402564, -0.149685, -0.767540, -1.904984, 0.162251, 1.582384, -0.908095]  # t=131
PLACE_133_JOINTS = [-0.377376, -0.266121, -0.784678, -1.921147, 0.122565, 1.522092, -0.840359]  # t=133
PLACE_135_JOINTS = [-0.346120, -0.384406, -0.780333, -1.937774, 0.083656, 1.477401, -0.743559]  # t=135
PLACE_137_JOINTS = [-0.312085, -0.501418, -0.758162, -1.953896, 0.055424, 1.444848, -0.631120]  # t=137
PLACE_139_JOINTS = [-0.279387, -0.614873, -0.723573, -1.968755, 0.030766, 1.419228, -0.513929]  # t=139
PLACE_141_JOINTS = [-0.250385, -0.722382, -0.678828, -1.981118, 0.006678, 1.394705, -0.394358]  # t=141
PLACE_143_JOINTS = [-0.225568, -0.821760, -0.627924, -1.990387, -0.010625, 1.371151, -0.274572]  # t=143
PLACE_145_JOINTS = [-0.203386, -0.908191, -0.572741, -2.000867, -0.016925, 1.358548, -0.156146]  # t=145
PLACE_147_JOINTS = [-0.182519, -0.979045, -0.514285, -2.009520, -0.011194, 1.357429, -0.040022]  # t=147
PLACE_149_JOINTS = [-0.163131, -1.035634, -0.454296, -2.010956, 0.000520, 1.359983, 0.070373]  # t=149
PLACE_151_JOINTS = [-0.145172, -1.078856, -0.393692, -2.003199, 0.016439, 1.367767, 0.175989]  # t=151
PLACE_153_JOINTS = [-0.129087, -1.109581, -0.332637, -1.987049, 0.032041, 1.381045, 0.281043]  # t=153
PLACE_155_JOINTS = [-0.116036, -1.130431, -0.270501, -1.965636, 0.041501, 1.401598, 0.391780]  # t=155
PLACE_157_JOINTS = [-0.107148, -1.143015, -0.205156, -1.944564, 0.037483, 1.425341, 0.513110]  # t=157
PLACE_159_JOINTS = [-0.101588, -1.145127, -0.135774, -1.929092, 0.022767, 1.456709, 0.640618]  # t=159
PLACE_161_JOINTS = [-0.097873, -1.132620, -0.065376, -1.924476, 0.004945, 1.498177, 0.768486]  # t=161
PLACE_163_JOINTS = [-0.095397, -1.106920, 0.001828, -1.921438, -0.009834, 1.544178, 0.893101]  # t=163
PLACE_165_JOINTS = [-0.093124, -1.074545, 0.055887, -1.919261, -0.019813, 1.578579, 0.998580]  # t=165
PLACE_167_JOINTS = [-0.090466, -1.039525, 0.091778, -1.917709, -0.025378, 1.609532, 1.074807]  # t=167
PLACE_169_JOINTS = [-0.086931, -0.997739, 0.111872, -1.915935, -0.021255, 1.653409, 1.123401]  # t=169
PLACE_171_JOINTS = [-0.083552, -0.950135, 0.116731, -1.914193, -0.011162, 1.709160, 1.154985]  # t=171
PLACE_173_JOINTS = [-0.080594, -0.898990, 0.113964, -1.904704, 0.000797, 1.773275, 1.174014]  # t=173
PLACE_175_JOINTS = [-0.077560, -0.844128, 0.113684, -1.882740, 0.013576, 1.836242, 1.182408]  # t=175
PLACE_177_JOINTS = [-0.074840, -0.788780, 0.120340, -1.843962, 0.022421, 1.873892, 1.188876]  # t=177
PLACE_179_JOINTS = [-0.073014, -0.735422, 0.136131, -1.796064, 0.023657, 1.886974, 1.201606]  # t=179
PLACE_181_JOINTS = [-0.072721, -0.680700, 0.162378, -1.754377, 0.016300, 1.905792, 1.226194]  # t=181
PLACE_183_JOINTS = [-0.073812, -0.629394, 0.190313, -1.721425, 0.000506, 1.943033, 1.256639]  # t=183
PLACE_185_JOINTS = [-0.075870, -0.579515, 0.213082, -1.696420, -0.019228, 1.989221, 1.283908]  # t=185
PLACE_187_JOINTS = [-0.078203, -0.529316, 0.233355, -1.674374, -0.040273, 2.037984, 1.308456]  # t=187
PLACE_189_JOINTS = [-0.080844, -0.479001, 0.248827, -1.651877, -0.063240, 2.086325, 1.329452]  # t=189
PLACE_191_JOINTS = [-0.082777, -0.430011, 0.259588, -1.627940, -0.084600, 2.135684, 1.343490]  # t=191
PLACE_193_JOINTS = [-0.083277, -0.381600, 0.266959, -1.600180, -0.101427, 2.178814, 1.349866]  # t=193
PLACE_195_JOINTS = [-0.082512, -0.336088, 0.272402, -1.571602, -0.116009, 2.206072, 1.354100]  # t=195
PLACE_197_JOINTS = [-0.080695, -0.292558, 0.274094, -1.541009, -0.128251, 2.222256, 1.355277]  # t=197
PLACE_199_JOINTS = [-0.077794, -0.248585, 0.274367, -1.506114, -0.141187, 2.234420, 1.356774]  # t=199
PLACE_201_JOINTS = [-0.073437, -0.207755, 0.274352, -1.469730, -0.154847, 2.236361, 1.360028]  # t=201
PLACE_203_JOINTS = [-0.067470, -0.171612, 0.273689, -1.433237, -0.165578, 2.225175, 1.362401]  # t=203
PLACE_205_JOINTS = [-0.060396, -0.134843, 0.271928, -1.393603, -0.175548, 2.212649, 1.363556]  # t=205
PLACE_207_JOINTS = [-0.052342, -0.097707, 0.269239, -1.352387, -0.186472, 2.202749, 1.364515]  # t=207
PLACE_209_JOINTS = [-0.043251, -0.062415, 0.265810, -1.311613, -0.197344, 2.192134, 1.365500]  # t=209
PLACE_211_JOINTS = [-0.033326, -0.026927, 0.261401, -1.271005, -0.208426, 2.185255, 1.366413]  # t=211
PLACE_213_JOINTS = [-0.022676, 0.011589, 0.255924, -1.229245, -0.219787, 2.182983, 1.366962]  # t=213
PLACE_215_JOINTS = [-0.011151, 0.045770, 0.249861, -1.188359, -0.229796, 2.174554, 1.367144]  # t=215
PLACE_217_JOINTS = [0.001031, 0.070093, 0.243491, -1.151922, -0.237227, 2.155866, 1.367154]  # t=217
PLACE_219_JOINTS = [0.013197, 0.094632, 0.236045, -1.118218, -0.243687, 2.143819, 1.367149]  # t=219
PLACE_221_JOINTS = [0.025213, 0.116176, 0.228289, -1.087777, -0.248921, 2.129840, 1.367141]  # t=221
PLACE_223_JOINTS = [0.036864, 0.128300, 0.220925, -1.065407, -0.252138, 2.107239, 1.367157]  # t=223
PLACE_225_JOINTS = [0.047545, 0.135078, 0.213520, -1.053470, -0.253475, 2.084832, 1.367431]  # t=225
PLACE_227_JOINTS = [0.056867, 0.138290, 0.206177, -1.050680, -0.253442, 2.066221, 1.368134]  # t=227
PLACE_229_JOINTS = [0.064782, 0.138197, 0.199461, -1.056092, -0.253050, 2.052482, 1.369691]  # t=229
PLACE_231_JOINTS = [0.071092, 0.134783, 0.193167, -1.068585, -0.252622, 2.044703, 1.372162]  # t=231
PLACE_233_JOINTS = [0.074928, 0.129637, 0.185169, -1.077028, -0.250772, 2.047666, 1.373383]  # t=233
PLACE_235_JOINTS = [0.077702, 0.125681, 0.179040, -1.083415, -0.247295, 2.051782, 1.373359]  # t=235
PLACE_237_JOINTS = [0.079655, 0.122484, 0.174474, -1.088489, -0.244476, 2.055001, 1.373346]  # t=237
PLACE_239_JOINTS = [0.081162, 0.120566, 0.171709, -1.091534, -0.242682, 2.058401, 1.373345]  # t=239
PLACE_241_JOINTS = [0.082292, 0.120030, 0.170116, -1.092558, -0.242009, 2.060713, 1.373342]  # t=241
RELEASE_POSE_241_JOINTS = [0.082292, 0.120030, 0.170116, -1.092558, -0.242009, 2.060713, 1.373342]  # t=241
RETRACT_254_JOINTS = [0.085335, 0.097750, 0.169980, -1.101929, -0.242083, 2.039489, 1.374392]  # t=254
RETRACT_257_JOINTS = [0.084887, 0.064583, 0.171189, -1.128623, -0.244265, 2.033831, 1.378200]  # t=257
RETRACT_260_JOINTS = [0.081463, 0.023402, 0.170389, -1.168551, -0.244059, 2.038713, 1.380847]  # t=260
RETRACT_263_JOINTS = [0.077018, -0.071641, 0.175062, -1.241431, -0.234668, 2.005105, 1.388167]  # t=263
RETRACT_265_JOINTS = [0.071864, -0.147611, 0.177601, -1.308707, -0.224237, 1.992669, 1.391632]  # t=265
RETRACT_266_JOINTS = [0.068631, -0.187661, 0.178832, -1.346752, -0.218896, 1.991255, 1.392924]  # t=266
RETRACT_269_JOINTS = [0.056663, -0.316257, 0.180648, -1.475600, -0.199899, 2.006591, 1.396678]  # t=269
RETRACT_272_JOINTS = [0.042576, -0.459531, 0.177099, -1.627676, -0.175859, 2.054557, 1.398414]  # t=272
RETRACT_275_JOINTS = [0.029175, -0.619308, 0.169957, -1.806401, -0.149608, 2.137574, 1.401080]  # t=275
RETRACT_277_JOINTS = [0.021614, -0.732599, 0.157693, -1.932524, -0.127084, 2.211076, 1.400671]  # t=277
RETRACT_278_JOINTS = [0.018640, -0.787732, 0.150138, -1.992762, -0.112933, 2.244686, 1.397177]  # t=278
RETRACT_281_JOINTS = [0.013961, -0.937438, 0.131484, -2.142867, -0.064157, 2.296717, 1.357740]  # t=281
RETRACT_284_JOINTS = [0.017337, -1.065744, 0.121667, -2.242929, 0.002931, 2.275431, 1.291165]  # t=284
RETRACT_287_JOINTS = [0.025123, -1.167809, 0.104241, -2.285768, 0.074175, 2.169729, 1.197415]  # t=287
RETRACT_290_JOINTS = [0.033403, -1.237803, 0.081962, -2.274767, 0.136044, 1.994899, 1.089390]  # t=290
RETRACT_292_JOINTS = [0.036861, -1.265304, 0.067061, -2.242780, 0.166354, 1.855407, 1.023918]  # t=292
APPROACH_000_JOINTS = [-0.006388, -1.041770, -0.042877, -2.252211, -0.000331, 1.551260, 0.671262]  # 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_003_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_006_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_008_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_009_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_012_JOINTS, input_type='joint', steps=3, 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_021_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_023_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_024_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_027_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_030_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_033_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_036_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_039_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_042_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_045_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_048_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_051_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_053_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)

def execute_grasp_approach():
    """Final Cartesian descent into grasp alignment."""
    moveJoint(DESCEND_054_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_055_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_056_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_057_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_058_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_059_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_060_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_061_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(DESCEND_062_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."""
    moveJoint(GRASP_064_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(GRASP_066_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(GRASP_072_JOINTS, input_type='joint', steps=6, settle_steps=0, gripper=-1.000)
    moveJoint(GRASP_077_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(GRASP_079_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(GRASP_081_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(GRASP_086_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(GRASP_091_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(GRASP_100_JOINTS, input_type='joint', steps=9, settle_steps=0, gripper=-1.000)
    moveJoint(GRASP_102_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    wait(duration=0.05, hold_target=GRASP_HOLD_102_JOINTS, input_type='joint', gripper=-0.3)
    grasp(hold_target=GRASP_HOLD_102_JOINTS, input_type='joint', close_steps=2, settle_steps=0, gripper=1.0, require_contact_count=4)
    wait(duration=0.05, hold_target=GRASP_HOLD_102_JOINTS, input_type='joint', gripper=1.0)

def lift_object():
    """Lift the grasped object clear of the counter."""
    moveJoint(LIFT_103_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(LIFT_104_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(LIFT_105_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(LIFT_106_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(LIFT_107_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(LIFT_108_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(LIFT_109_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    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)

def prepare_release():
    """Set the object into the receptacle and stabilize before release."""
    moveJoint(PLACE_121_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_123_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_125_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_127_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_129_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_131_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_133_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_135_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_137_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_139_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_141_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_143_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_145_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_147_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_149_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_151_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_153_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_155_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_157_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_159_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_161_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_163_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_165_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_167_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_169_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_171_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_173_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_175_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_177_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_179_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_181_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_183_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_185_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_187_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_189_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_191_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_193_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_195_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_197_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_199_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_201_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_203_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_205_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_207_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_209_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_211_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_213_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_215_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_217_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_219_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_221_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_223_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_225_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_227_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_229_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_231_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_233_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_235_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_237_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_239_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PLACE_241_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    wait(duration=0.05, hold_target=RELEASE_POSE_241_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_241_JOINTS, input_type='joint', open_steps=1, settle_steps=0, gripper=-1.0)
    wait(duration=0.05, hold_target=RELEASE_POSE_241_JOINTS, input_type='joint', gripper=-1.0)

def retreat_after_release():
    """Retreat away from the placed object without clipping it."""
    moveJoint(RETRACT_254_JOINTS, input_type='joint', steps=13, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_257_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_260_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_263_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_265_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_266_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_269_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_272_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_275_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_277_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_278_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_281_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_284_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_287_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_290_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(RETRACT_292_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)

move_to_pregrasp()
execute_grasp_approach()
close_gripper_on_object()
lift_object()
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

Pick the hot dog from the counter and place it in the microwave.

all plate receptacle container container_set2