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

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

SCENE_ARTIFACT = '../../../artifacts/20260324/TurnOnElectricKettle/20260324_205344_turn-on-electric-kettle_episode_000000_action2code-open-loop-joint_initial-scene.json'
POLICY_METADATA = {
    'policy_kind': 'open_loop_joint',
    'policy_variant': 'open-loop-joint',
    'task_name': 'TurnOnElectricKettle',
    'episode_id': 'episode_000000',
    'scene_artifact_path': '../../../artifacts/20260324/TurnOnElectricKettle/20260324_205344_turn-on-electric-kettle_episode_000000_action2code-open-loop-joint_initial-scene.json',
    'fitting_summary_path': '../../../artifacts/20260324/TurnOnElectricKettle/20260324_205344_turn-on-electric-kettle_episode_000000_action2code-open-loop-joint_fitting-summary.json',
    'extracted_pose_metadata_path': '../../../artifacts/20260324/TurnOnElectricKettle/20260324_205344_turn-on-electric-kettle_episode_000000_action2code-open-loop-joint_extracted-pose-metadata.json',
    'stable_grasp_contact_t': 89,
    'stable_release_contact_loss_t': 89,
    '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.019777, -1.039842, -0.038106, -2.288964, 0.053154, 1.494928, 0.715918]  # t=2
APPROACH_005_JOINTS = [-0.021486, -1.075029, -0.046278, -2.290116, 0.044039, 1.435200, 0.715234]  # t=5
APPROACH_007_JOINTS = [-0.024396, -1.105983, -0.066566, -2.296961, 0.024496, 1.406716, 0.704327]  # t=7
APPROACH_008_JOINTS = [-0.026114, -1.118966, -0.081356, -2.301712, 0.011373, 1.399652, 0.693924]  # t=8
APPROACH_009_JOINTS = [-0.027793, -1.129686, -0.097697, -2.308327, -0.002432, 1.396654, 0.680995]  # t=9
APPROACH_010_JOINTS = [-0.029483, -1.138028, -0.115920, -2.315902, -0.017648, 1.397738, 0.665284]  # t=10
APPROACH_013_JOINTS = [-0.034651, -1.155192, -0.188868, -2.329384, -0.071353, 1.401608, 0.588993]  # t=13
APPROACH_015_JOINTS = [-0.036779, -1.159753, -0.249320, -2.332085, -0.103307, 1.407469, 0.511173]  # t=15
APPROACH_019_JOINTS = [-0.039269, -1.163047, -0.380587, -2.321791, -0.149569, 1.445362, 0.326891]  # t=19
APPROACH_020_JOINTS = [-0.040149, -1.165898, -0.415519, -2.319638, -0.157880, 1.455707, 0.277023]  # t=20
APPROACH_025_JOINTS = [-0.035848, -1.167285, -0.608205, -2.314792, -0.145687, 1.527278, 0.000493]  # t=25
APPROACH_026_JOINTS = [-0.032824, -1.167515, -0.645103, -2.316383, -0.129038, 1.537344, -0.062306]  # t=26
APPROACH_030_JOINTS = [-0.014162, -1.157205, -0.776293, -2.322352, -0.049101, 1.532114, -0.293288]  # t=30
APPROACH_032_JOINTS = [0.004254, -1.134578, -0.837078, -2.318411, -0.009464, 1.507202, -0.392603]  # t=32
APPROACH_035_JOINTS = [0.046245, -1.078102, -0.920297, -2.306909, 0.056801, 1.442397, -0.503603]  # t=35
APPROACH_038_JOINTS = [0.096263, -1.018235, -1.001231, -2.282140, 0.098694, 1.370259, -0.625558]  # t=38
APPROACH_040_JOINTS = [0.130973, -0.983081, -1.053462, -2.269001, 0.118051, 1.345845, -0.710057]  # t=40
APPROACH_041_JOINTS = [0.146226, -0.969575, -1.076457, -2.261104, 0.125987, 1.340177, -0.747088]  # t=41
APPROACH_043_JOINTS = [0.170103, -0.951767, -1.104420, -2.258189, 0.138805, 1.338658, -0.796563]  # t=43
APPROACH_045_JOINTS = [0.187333, -0.941781, -1.112347, -2.278091, 0.150046, 1.354614, -0.815034]  # t=45
APPROACH_048_JOINTS = [0.202438, -0.934316, -1.107724, -2.338786, 0.163180, 1.417428, -0.810924]  # t=48
APPROACH_050_JOINTS = [0.203520, -0.933591, -1.111665, -2.383868, 0.160572, 1.467504, -0.811003]  # t=50
APPROACH_051_JOINTS = [0.203085, -0.933075, -1.115713, -2.405344, 0.158367, 1.494983, -0.812894]  # t=51
APPROACH_055_JOINTS = [0.199687, -0.927090, -1.143062, -2.473101, 0.145602, 1.592197, -0.829275]  # t=55
APPROACH_060_JOINTS = [0.204644, -0.909954, -1.172865, -2.531152, 0.145157, 1.698391, -0.847475]  # t=60
APPROACH_065_JOINTS = [0.219449, -0.887410, -1.200846, -2.572495, 0.151152, 1.784051, -0.868675]  # t=65
APPROACH_070_JOINTS = [0.256684, -0.856388, -1.220875, -2.602796, 0.171852, 1.878151, -0.892943]  # t=70
APPROACH_073_JOINTS = [0.296931, -0.828377, -1.233667, -2.612453, 0.195867, 1.940428, -0.907589]  # t=73
APPROACH_075_JOINTS = [0.325552, -0.808282, -1.249843, -2.603174, 0.209547, 1.969113, -0.919906]  # t=75
APPROACH_079_JOINTS = [0.393315, -0.765897, -1.302705, -2.579791, 0.230218, 2.016074, -0.951390]  # t=79
APPROACH_080_JOINTS = [0.411669, -0.758154, -1.315774, -2.570335, 0.235645, 2.020058, -0.957450]  # t=80
APPROACH_082_JOINTS = [0.448600, -0.745388, -1.343781, -2.557936, 0.240940, 2.029516, -0.965869]  # t=82
PRESS_083_JOINTS = [0.467534, -0.741055, -1.358937, -2.553155, 0.242452, 2.036483, -0.970181]  # t=83
PRESS_084_JOINTS = [0.487547, -0.738016, -1.373994, -2.547450, 0.243818, 2.046744, -0.973080]  # t=84
PRESS_085_JOINTS = [0.509793, -0.735772, -1.389613, -2.538917, 0.244771, 2.060635, -0.974162]  # t=85
PRESS_086_JOINTS = [0.533720, -0.734462, -1.407133, -2.529303, 0.244384, 2.072920, -0.973164]  # t=86
PRESS_087_JOINTS = [0.557896, -0.734697, -1.425402, -2.517633, 0.241885, 2.078353, -0.968057]  # t=87
PRESS_088_JOINTS = [0.582011, -0.736724, -1.443995, -2.505418, 0.236871, 2.080189, -0.959648]  # t=88
PRESS_089_JOINTS = [0.605019, -0.741326, -1.462246, -2.493186, 0.229106, 2.078353, -0.949469]  # t=89
PRESS_090_JOINTS = [0.622494, -0.749843, -1.482512, -2.481626, 0.215808, 2.068558, -0.944044]  # t=90
PRESS_091_JOINTS = [0.632092, -0.764119, -1.506295, -2.471313, 0.198258, 2.054955, -0.951500]  # t=91
PRESS_092_JOINTS = [0.634958, -0.785859, -1.529636, -2.464977, 0.181890, 2.045481, -0.975136]  # t=92
PRESS_093_JOINTS = [0.631799, -0.814603, -1.547354, -2.463942, 0.170422, 2.042395, -1.009674]  # t=93
PRESS_094_JOINTS = [0.622116, -0.847977, -1.559565, -2.469134, 0.161994, 2.046406, -1.050117]  # t=94
RETREAT_095_JOINTS = [0.605640, -0.883080, -1.567723, -2.480895, 0.153098, 2.055434, -1.092213]  # t=95
RETREAT_096_JOINTS = [0.582384, -0.915698, -1.589130, -2.499527, 0.132679, 2.069018, -1.139393]  # t=96
RETREAT_097_JOINTS = [0.552530, -0.947835, -1.606564, -2.513766, 0.114303, 2.068411, -1.177345]  # t=97
RETREAT_098_JOINTS = [0.518161, -0.976805, -1.610391, -2.520324, 0.098170, 2.053021, -1.192828]  # t=98
RETREAT_099_JOINTS = [0.485249, -1.002755, -1.596537, -2.522939, 0.086900, 2.038637, -1.184989]  # t=99
RETREAT_100_JOINTS = [0.454415, -1.025822, -1.569430, -2.525881, 0.078713, 2.023338, -1.161940]  # t=100
RETREAT_101_JOINTS = [0.426067, -1.044923, -1.536051, -2.530196, 0.070605, 2.010404, -1.127669]  # t=101
RETREAT_102_JOINTS = [0.400193, -1.060438, -1.498657, -2.534840, 0.062970, 2.000081, -1.086397]  # t=102
RETREAT_103_JOINTS = [0.375577, -1.072568, -1.459086, -2.538584, 0.055850, 1.988482, -1.040122]  # t=103
RETREAT_104_JOINTS = [0.352494, -1.082126, -1.418028, -2.541073, 0.050681, 1.975858, -0.992100]  # t=104
APPROACH_000_JOINTS = [-0.019734, -1.036441, -0.037933, -2.289733, 0.053327, 1.501895, 0.715914]  # 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_005_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_007_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_008_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_009_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_010_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_013_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_015_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_019_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_020_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_025_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_026_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_030_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_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_038_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_040_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_041_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_043_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_045_JOINTS, input_type='joint', steps=2, 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_051_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_055_JOINTS, input_type='joint', steps=4, 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_073_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_075_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_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_082_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)

def press_control():
    """Execute the short interaction path that actuates the control."""
    moveJoint(PRESS_083_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_084_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_085_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_086_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_087_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_088_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_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_091_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_092_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_093_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_094_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_095_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(RETREAT_096_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(RETREAT_097_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(RETREAT_098_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(RETREAT_099_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(RETREAT_100_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(RETREAT_101_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(RETREAT_102_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(RETREAT_103_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(RETREAT_104_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

Press down the lever to turn on the electric kettle.


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

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

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

OBJ_POSE_T0 = pose(x=1.330252, y=-0.726002, z=1.194722, qw=0.973673, qx=-0.000035, qy=0.003808, qz=0.227917)
GOAL_RECEPTACLE_POSE = pose(x=1.330108, y=-0.726906, z=1.175510, qw=0.954542, qx=-0.000098, qy=-0.000027, qz=0.298076)

APPROACH_001_JOINTS = [-0.006224, -1.023313, -0.069334, -2.283308, 0.036919, 1.558925, 0.675367]  # t=1
APPROACH_003_JOINTS = [-0.009519, -1.023917, -0.086871, -2.307856, 0.024945, 1.567439, 0.664972]  # t=3
APPROACH_004_JOINTS = [-0.012069, -1.032502, -0.101126, -2.323002, 0.016364, 1.583045, 0.652695]  # t=4
APPROACH_005_JOINTS = [-0.014916, -1.048491, -0.110689, -2.334956, 0.000916, 1.606525, 0.636731]  # t=5
APPROACH_007_JOINTS = [-0.020864, -1.105284, -0.097587, -2.359885, -0.049955, 1.657888, 0.609992]  # t=7
APPROACH_008_JOINTS = [-0.024272, -1.145014, -0.083041, -2.377748, -0.079334, 1.684664, 0.601480]  # t=8
APPROACH_009_JOINTS = [-0.027747, -1.189154, -0.067936, -2.400008, -0.108286, 1.711309, 0.594838]  # t=9
APPROACH_011_JOINTS = [-0.035738, -1.282324, -0.055083, -2.453492, -0.170327, 1.766539, 0.578160]  # t=11
APPROACH_012_JOINTS = [-0.040088, -1.329095, -0.059162, -2.482872, -0.204189, 1.795455, 0.564936]  # t=12
APPROACH_016_JOINTS = [-0.060105, -1.507417, -0.129691, -2.600647, -0.349675, 1.911373, 0.494235]  # t=16
APPROACH_017_JOINTS = [-0.066374, -1.547878, -0.159280, -2.626390, -0.385491, 1.937801, 0.478146]  # t=17
APPROACH_019_JOINTS = [-0.078553, -1.616986, -0.230035, -2.671809, -0.442562, 1.986342, 0.447767]  # t=19
APPROACH_020_JOINTS = [-0.084094, -1.637192, -0.268103, -2.693039, -0.469795, 2.013722, 0.432401]  # t=20
APPROACH_023_JOINTS = [-0.100226, -1.658183, -0.378874, -2.732048, -0.542113, 2.090216, 0.382181]  # t=23
APPROACH_024_JOINTS = [-0.105002, -1.658730, -0.413027, -2.737982, -0.557746, 2.113214, 0.361037]  # t=24
APPROACH_028_JOINTS = [-0.118733, -1.643799, -0.536381, -2.740768, -0.574489, 2.192672, 0.244689]  # t=28
APPROACH_030_JOINTS = [-0.121875, -1.632179, -0.588951, -2.734314, -0.555516, 2.225862, 0.169325]  # t=30
APPROACH_032_JOINTS = [-0.118737, -1.615515, -0.640594, -2.728489, -0.517793, 2.271284, 0.081946]  # t=32
APPROACH_036_JOINTS = [-0.101684, -1.599324, -0.752464, -2.717528, -0.381981, 2.362981, -0.149979]  # t=36
APPROACH_038_JOINTS = [-0.090911, -1.595255, -0.810093, -2.707999, -0.303229, 2.391747, -0.281515]  # t=38
APPROACH_040_JOINTS = [-0.081270, -1.588387, -0.867924, -2.695329, -0.230321, 2.404085, -0.408551]  # t=40
APPROACH_041_JOINTS = [-0.078105, -1.580728, -0.893138, -2.689160, -0.202641, 2.404563, -0.462665]  # t=41
APPROACH_044_JOINTS = [-0.063606, -1.541014, -0.950457, -2.676642, -0.138838, 2.405096, -0.602197]  # t=44
APPROACH_045_JOINTS = [-0.056925, -1.526302, -0.965634, -2.673477, -0.119224, 2.406032, -0.645717]  # t=45
APPROACH_048_JOINTS = [-0.029613, -1.481810, -0.996314, -2.667085, -0.056975, 2.411171, -0.764425]  # t=48
APPROACH_052_JOINTS = [0.013364, -1.426060, -1.007699, -2.643389, 0.024094, 2.405342, -0.887150]  # t=52
APPROACH_056_JOINTS = [0.051333, -1.371364, -1.015344, -2.616212, 0.080695, 2.400771, -0.974253]  # t=56
APPROACH_060_JOINTS = [0.074399, -1.327509, -1.023688, -2.600190, 0.112122, 2.409697, -1.035130]  # t=60
APPROACH_064_JOINTS = [0.107122, -1.280027, -1.030990, -2.601127, 0.136740, 2.459589, -1.087136]  # t=64
APPROACH_068_JOINTS = [0.144499, -1.238053, -1.042650, -2.605289, 0.159922, 2.515812, -1.135575]  # t=68
APPROACH_072_JOINTS = [0.195166, -1.193435, -1.052920, -2.606190, 0.181809, 2.585452, -1.179951]  # t=72
PRESS_073_JOINTS = [0.202700, -1.189196, -1.053766, -2.602824, 0.185429, 2.594502, -1.190136]  # t=73
PRESS_074_JOINTS = [0.203939, -1.189007, -1.054115, -2.602046, 0.184886, 2.595037, -1.198246]  # t=74
PRESS_075_JOINTS = [0.203415, -1.189393, -1.053872, -2.602651, 0.182465, 2.595289, -1.204956]  # t=75
PRESS_076_JOINTS = [0.202474, -1.189719, -1.053224, -2.603898, 0.179133, 2.596628, -1.210961]  # t=76
PRESS_077_JOINTS = [0.201607, -1.189905, -1.052383, -2.605442, 0.175541, 2.599077, -1.216479]  # t=77
PRESS_078_JOINTS = [0.200086, -1.190723, -1.051631, -2.607429, 0.171813, 2.600996, -1.221397]  # t=78
PRESS_079_JOINTS = [0.197706, -1.192193, -1.050972, -2.609943, 0.167708, 2.602106, -1.225787]  # t=79
PRESS_080_JOINTS = [0.196169, -1.192855, -1.050122, -2.612223, 0.163575, 2.604935, -1.229978]  # t=80
PRESS_081_JOINTS = [0.193657, -1.194424, -1.049583, -2.614717, 0.159343, 2.606066, -1.233653]  # t=81
PRESS_082_JOINTS = [0.182020, -1.202880, -1.051603, -2.617404, 0.152686, 2.596567, -1.234823]  # t=82
PRESS_083_JOINTS = [0.157083, -1.222882, -1.054919, -2.620401, 0.142803, 2.571841, -1.235418]  # t=83
PRESS_084_JOINTS = [0.126196, -1.247855, -1.059081, -2.623302, 0.131296, 2.542604, -1.236676]  # t=84
PRESS_085_JOINTS = [0.095436, -1.273491, -1.064903, -2.625436, 0.121732, 2.515259, -1.239020]  # t=85
RETREAT_087_JOINTS = [0.038057, -1.324908, -1.081710, -2.626953, 0.112028, 2.463045, -1.247384]  # t=87
RETREAT_089_JOINTS = [-0.016570, -1.373537, -1.099864, -2.624540, 0.107519, 2.407635, -1.254307]  # t=89
RETREAT_091_JOINTS = [-0.071115, -1.417986, -1.114756, -2.618791, 0.102427, 2.344391, -1.256138]  # t=91
RETREAT_093_JOINTS = [-0.125148, -1.461943, -1.121393, -2.609077, 0.103151, 2.277645, -1.255141]  # t=93
RETREAT_095_JOINTS = [-0.176080, -1.508637, -1.121577, -2.596459, 0.116281, 2.215793, -1.258693]  # t=95
RETREAT_097_JOINTS = [-0.222223, -1.555064, -1.120038, -2.581542, 0.138369, 2.161888, -1.266982]  # t=97
RETREAT_099_JOINTS = [-0.266241, -1.601441, -1.112695, -2.565810, 0.166848, 2.102033, -1.269801]  # t=99
RETREAT_101_JOINTS = [-0.306036, -1.644905, -1.096413, -2.546791, 0.199314, 2.044025, -1.265096]  # t=101
RETREAT_103_JOINTS = [-0.339638, -1.684543, -1.076812, -2.524214, 0.233497, 1.993706, -1.257272]  # t=103
RETREAT_105_JOINTS = [-0.369200, -1.715538, -1.064171, -2.498555, 0.249685, 1.946503, -1.237055]  # t=105
RETREAT_107_JOINTS = [-0.394912, -1.742430, -1.050353, -2.470658, 0.257422, 1.900217, -1.208667]  # t=107
RETREAT_108_JOINTS = [-0.404859, -1.754748, -1.041852, -2.458439, 0.262620, 1.880193, -1.194893]  # t=108

# 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_001_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_003_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_004_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_005_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_007_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_008_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_009_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_011_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_012_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_016_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_017_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_019_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_020_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_023_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_024_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_028_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_030_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_032_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_036_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_038_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_040_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_041_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_044_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_045_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_048_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_052_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_056_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_060_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_064_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_068_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_072_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_073_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_074_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_075_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_076_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_077_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_078_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_079_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_080_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_081_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_082_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_083_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_084_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_085_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_087_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(RETREAT_089_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(RETREAT_091_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(RETREAT_093_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(RETREAT_095_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(RETREAT_097_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(RETREAT_099_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(RETREAT_101_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(RETREAT_103_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(RETREAT_105_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(RETREAT_107_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(RETREAT_108_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

Press the start button on the microwave.

all plate receptacle container container_set2


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

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

SCENE_ARTIFACT = '../../../artifacts/20260324/TurnOnSinkFaucet/20260324_205346_turn-on-sink-faucet_episode_000000_action2code-open-loop-joint_initial-scene.json'
POLICY_METADATA = {
    'policy_kind': 'open_loop_joint',
    'policy_variant': 'open-loop-joint',
    'task_name': 'TurnOnSinkFaucet',
    'episode_id': 'episode_000000',
    'scene_artifact_path': '../../../artifacts/20260324/TurnOnSinkFaucet/20260324_205346_turn-on-sink-faucet_episode_000000_action2code-open-loop-joint_initial-scene.json',
    'fitting_summary_path': '../../../artifacts/20260324/TurnOnSinkFaucet/20260324_205346_turn-on-sink-faucet_episode_000000_action2code-open-loop-joint_fitting-summary.json',
    'extracted_pose_metadata_path': '../../../artifacts/20260324/TurnOnSinkFaucet/20260324_205346_turn-on-sink-faucet_episode_000000_action2code-open-loop-joint_extracted-pose-metadata.json',
    'stable_grasp_contact_t': 124,
    'stable_release_contact_loss_t': 124,
    '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=1.903311, y=-0.450940, z=0.944829, qw=0.986689, qx=-0.004480, qy=0.007653, qz=0.162379)

APPROACH_002_JOINTS = [-0.010615, -1.042052, -0.036832, -2.285549, 0.053868, 1.551092, 0.706573]  # t=2
APPROACH_005_JOINTS = [-0.011609, -1.085802, -0.038313, -2.303132, 0.058433, 1.602427, 0.697918]  # t=5
APPROACH_007_JOINTS = [-0.011015, -1.130461, -0.045297, -2.336416, 0.076732, 1.671127, 0.677027]  # t=7
APPROACH_009_JOINTS = [-0.010536, -1.177327, -0.059084, -2.386805, 0.097252, 1.749940, 0.647908]  # t=9
APPROACH_010_JOINTS = [-0.010426, -1.198638, -0.066898, -2.419758, 0.104950, 1.794083, 0.628974]  # t=10
APPROACH_012_JOINTS = [-0.011384, -1.242780, -0.088281, -2.492252, 0.114863, 1.885185, 0.587763]  # t=12
APPROACH_015_JOINTS = [-0.014217, -1.302657, -0.122939, -2.605021, 0.122805, 2.022591, 0.522587]  # t=15
APPROACH_016_JOINTS = [-0.015261, -1.318214, -0.133657, -2.641615, 0.125202, 2.067509, 0.502047]  # t=16
APPROACH_019_JOINTS = [-0.020907, -1.381874, -0.167281, -2.752832, 0.132957, 2.182123, 0.440900]  # t=19
APPROACH_020_JOINTS = [-0.022814, -1.403737, -0.174627, -2.790520, 0.137411, 2.221639, 0.424244]  # t=20
APPROACH_022_JOINTS = [-0.024539, -1.432291, -0.179618, -2.860563, 0.149619, 2.311489, 0.400093]  # t=22
APPROACH_025_JOINTS = [-0.018146, -1.431266, -0.176372, -2.944311, 0.179395, 2.466927, 0.365535]  # t=25
APPROACH_028_JOINTS = [-0.000037, -1.375764, -0.173404, -2.997758, 0.219760, 2.621173, 0.332677]  # t=28
APPROACH_030_JOINTS = [0.016836, -1.325251, -0.190016, -3.012921, 0.252469, 2.702231, 0.298482]  # t=30
APPROACH_035_JOINTS = [0.095956, -1.154025, -0.243815, -2.994682, 0.354403, 2.873540, 0.187836]  # t=35
APPROACH_040_JOINTS = [0.198938, -1.005830, -0.298362, -2.942434, 0.445502, 2.993787, 0.098300]  # t=40
APPROACH_045_JOINTS = [0.329040, -0.849271, -0.373814, -2.865595, 0.514175, 3.103396, 0.026923]  # t=45
APPROACH_050_JOINTS = [0.510897, -0.788587, -0.517607, -2.846142, 0.547271, 3.241694, -0.060227]  # t=50
APPROACH_055_JOINTS = [0.737061, -0.720771, -0.742755, -2.793670, 0.388880, 3.377499, -0.000855]  # t=55
APPROACH_057_JOINTS = [0.821001, -0.705936, -0.849385, -2.795312, 0.263100, 3.445487, 0.070661]  # t=57
APPROACH_060_JOINTS = [0.934163, -0.677363, -1.031639, -2.815191, 0.030701, 3.561157, 0.201606]  # t=60
APPROACH_064_JOINTS = [1.094474, -0.608262, -1.290965, -2.792716, -0.265748, 3.699659, 0.377559]  # t=64
APPROACH_065_JOINTS = [1.140358, -0.593713, -1.351638, -2.775895, -0.317463, 3.723571, 0.415466]  # t=65
APPROACH_066_JOINTS = [1.188178, -0.584264, -1.408747, -2.757234, -0.355906, 3.742862, 0.444876]  # t=66
APPROACH_070_JOINTS = [1.380875, -0.619210, -1.580102, -2.665122, -0.365053, 3.752548, 0.414801]  # t=70
APPROACH_071_JOINTS = [1.422367, -0.646749, -1.607463, -2.648675, -0.337059, 3.752628, 0.370073]  # t=71
APPROACH_075_JOINTS = [1.553746, -0.792047, -1.657046, -2.593992, -0.165770, 3.752688, 0.116213]  # t=75
APPROACH_078_JOINTS = [1.627696, -0.898572, -1.657499, -2.543708, -0.030457, 3.752560, -0.073804]  # t=78
APPROACH_080_JOINTS = [1.674470, -0.955759, -1.654558, -2.502577, 0.046186, 3.752592, -0.178216]  # t=80
APPROACH_085_JOINTS = [1.770665, -1.045637, -1.649961, -2.405278, 0.174293, 3.751600, -0.349474]  # t=85
APPROACH_090_JOINTS = [1.863910, -1.087520, -1.660087, -2.317065, 0.242559, 3.752713, -0.433512]  # t=90
APPROACH_095_JOINTS = [1.922787, -1.102489, -1.664648, -2.257261, 0.291288, 3.752617, -0.480307]  # t=95
APPROACH_100_JOINTS = [1.954989, -1.112017, -1.666222, -2.216487, 0.323391, 3.751228, -0.508324]  # t=100
APPROACH_101_JOINTS = [1.960150, -1.114507, -1.667375, -2.208601, 0.327295, 3.749435, -0.512787]  # t=101
APPROACH_105_JOINTS = [1.967909, -1.126259, -1.670327, -2.196151, 0.335931, 3.751875, -0.525577]  # t=105
APPROACH_110_JOINTS = [1.941567, -1.146964, -1.665117, -2.194677, 0.331015, 3.750140, -0.517457]  # t=110
APPROACH_111_JOINTS = [1.930981, -1.152598, -1.663076, -2.194789, 0.326855, 3.743907, -0.511932]  # t=111
PRESS_113_JOINTS = [1.914705, -1.165278, -1.658984, -2.198459, 0.313177, 3.712613, -0.499173]  # t=113
PRESS_115_JOINTS = [1.891921, -1.175833, -1.655909, -2.203545, 0.295850, 3.665662, -0.480665]  # t=115
PRESS_117_JOINTS = [1.859625, -1.188040, -1.654032, -2.208188, 0.268821, 3.591935, -0.456130]  # t=117
PRESS_119_JOINTS = [1.819294, -1.205080, -1.653917, -2.208650, 0.230087, 3.488072, -0.428691]  # t=119
PRESS_121_JOINTS = [1.775059, -1.226384, -1.656251, -2.200040, 0.184664, 3.353485, -0.402956]  # t=121
PRESS_122_JOINTS = [1.753326, -1.240758, -1.658259, -2.190959, 0.160066, 3.276700, -0.391789]  # t=122
PRESS_123_JOINTS = [1.732264, -1.258113, -1.660184, -2.178709, 0.134796, 3.195899, -0.383052]  # t=123
PRESS_124_JOINTS = [1.711890, -1.278399, -1.662097, -2.163893, 0.109579, 3.113291, -0.377677]  # t=124
PRESS_125_JOINTS = [1.693929, -1.300949, -1.663211, -2.146824, 0.085000, 3.031405, -0.375490]  # t=125
PRESS_127_JOINTS = [1.672274, -1.344879, -1.660283, -2.108487, 0.038866, 2.866499, -0.371842]  # t=127
PRESS_128_JOINTS = [1.665451, -1.368522, -1.659270, -2.085166, 0.018744, 2.785326, -0.373446]  # t=128
RETREAT_129_JOINTS = [1.661297, -1.392756, -1.658459, -2.059933, 0.000219, 2.707764, -0.376574]  # t=129
RETREAT_130_JOINTS = [1.659210, -1.416182, -1.657936, -2.033636, -0.017880, 2.635860, -0.380034]  # t=130
RETREAT_131_JOINTS = [1.658441, -1.437443, -1.657629, -2.002488, -0.036357, 2.576667, -0.380954]  # t=131
RETREAT_132_JOINTS = [1.660955, -1.455878, -1.656496, -1.972639, -0.055490, 2.536479, -0.376626]  # t=132
RETREAT_133_JOINTS = [1.665132, -1.471929, -1.654248, -1.948860, -0.075063, 2.506438, -0.368841]  # t=133
RETREAT_134_JOINTS = [1.669154, -1.486315, -1.650956, -1.929788, -0.094149, 2.482946, -0.359447]  # t=134
RETREAT_135_JOINTS = [1.672591, -1.499408, -1.647080, -1.914414, -0.112367, 2.464140, -0.349519]  # t=135
RETREAT_136_JOINTS = [1.675428, -1.511397, -1.642964, -1.901994, -0.129491, 2.448914, -0.339700]  # t=136
RETREAT_137_JOINTS = [1.677738, -1.522369, -1.638842, -1.891955, -0.145377, 2.436514, -0.330356]  # t=137
RETREAT_138_JOINTS = [1.679603, -1.532361, -1.634869, -1.883846, -0.159943, 2.426384, -0.321685]  # t=138
RETREAT_139_JOINTS = [1.681096, -1.541396, -1.631142, -1.877309, -0.173151, 2.418099, -0.313787]  # t=139
APPROACH_000_JOINTS = [-0.010394, -1.037892, -0.036730, -2.285708, 0.053729, 1.548874, 0.707248]  # 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_005_JOINTS, input_type='joint', steps=3, 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_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_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_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_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_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_057_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_060_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_064_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_065_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_066_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_070_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_071_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_075_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_078_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_080_JOINTS, input_type='joint', steps=2, 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_101_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_105_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_110_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_111_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_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_124_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_125_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_127_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_128_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_129_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_130_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_131_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_132_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_133_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_134_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_135_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_136_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_137_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_138_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_139_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

all donut sweets pastry food in_container


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

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

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

OBJ_POSE_T0 = pose(x=0.212436, y=-1.698780, z=1.045979, qw=0.974578, qx=-0.000095, qy=-0.000050, qz=0.224047)
GOAL_RECEPTACLE_POSE = pose(x=0.212478, y=-1.698753, z=1.046006, qw=0.974787, qx=-0.000005, qy=0.000015, qz=0.223138)

APPROACH_BODY_004 = pose(x=0.456683, y=-0.001890, z=1.290182, qx=-0.678675, qy=-0.717932, qz=-0.133967, qw=-0.077625)  # body-frame t=4
APPROACH_BODY_006 = pose(x=0.456929, y=-0.001895, z=1.290042, qx=-0.678716, qy=-0.717948, qz=-0.133790, qw=-0.077434)  # body-frame t=6
APPROACH_BODY_008 = pose(x=0.457966, y=-0.001912, z=1.289904, qx=-0.678875, qy=-0.718055, qz=-0.132919, qw=-0.076534)  # body-frame t=8
APPROACH_BODY_012 = pose(x=0.457454, y=-0.001906, z=1.291032, qx=-0.678833, qy=-0.718174, qz=-0.132646, qw=-0.076267)  # body-frame t=12
APPROACH_BODY_014 = pose(x=0.457179, y=-0.001900, z=1.290999, qx=-0.678786, qy=-0.718137, qz=-0.132925, qw=-0.076551)  # body-frame t=14
APPROACH_BODY_015 = pose(x=0.456229, y=-0.001863, z=1.291309, qx=-0.678627, qy=-0.718079, qz=-0.133621, qw=-0.077290)  # body-frame t=15
APPROACH_BODY_016 = pose(x=0.455662, y=-0.001710, z=1.291072, qx=-0.678437, qy=-0.718069, qz=-0.134242, qw=-0.077968)  # body-frame t=16
APPROACH_BODY_018 = pose(x=0.455653, y=-0.001033, z=1.290082, qx=-0.678227, qy=-0.718057, qz=-0.134761, qw=-0.078996)  # body-frame t=18
APPROACH_BODY_020 = pose(x=0.455869, y=0.000273, z=1.289522, qx=-0.678460, qy=-0.717821, qz=-0.134191, qw=-0.080109)  # body-frame t=20
APPROACH_BODY_022 = pose(x=0.456038, y=0.001409, z=1.289405, qx=-0.678870, qy=-0.717520, qz=-0.133263, qw=-0.080879)  # body-frame t=22
APPROACH_BODY_024 = pose(x=0.456216, y=0.001989, z=1.289456, qx=-0.679278, qy=-0.717194, qz=-0.132888, qw=-0.080967)  # body-frame t=24
APPROACH_BODY_027 = pose(x=0.456390, y=0.000459, z=1.289643, qx=-0.679484, qy=-0.716979, qz=-0.133912, qw=-0.079434)  # body-frame t=27
APPROACH_BODY_028 = pose(x=0.456453, y=-0.001623, z=1.289679, qx=-0.679349, qy=-0.717029, qz=-0.135140, qw=-0.078052)  # body-frame t=28
APPROACH_BODY_029 = pose(x=0.456537, y=-0.004080, z=1.289692, qx=-0.678939, qy=-0.717323, qz=-0.136543, qw=-0.076453)  # body-frame t=29
APPROACH_BODY_030 = pose(x=0.456627, y=-0.005191, z=1.289735, qx=-0.678211, qy=-0.717993, qz=-0.137164, qw=-0.075517)  # body-frame t=30
APPROACH_BODY_032 = pose(x=0.456759, y=-0.004628, z=1.289934, qx=-0.677492, qy=-0.718800, qz=-0.136424, qw=-0.075630)  # body-frame t=32
APPROACH_BODY_036 = pose(x=0.456797, y=-0.002553, z=1.290142, qx=-0.678202, qy=-0.718335, qz=-0.134546, qw=-0.077035)  # body-frame t=36
APPROACH_BODY_040 = pose(x=0.456772, y=-0.002006, z=1.290171, qx=-0.678484, qy=-0.718111, qz=-0.134043, qw=-0.077512)  # body-frame t=40
APPROACH_BODY_042 = pose(x=0.456767, y=-0.002052, z=1.290175, qx=-0.678562, qy=-0.718037, qz=-0.134025, qw=-0.077545)  # body-frame t=42
APPROACH_BODY_043 = pose(x=0.456876, y=0.001165, z=1.288797, qx=-0.677553, qy=-0.719250, qz=-0.133612, qw=-0.075819)  # body-frame t=43
APPROACH_BODY_044 = pose(x=0.457167, y=0.008471, z=1.286443, qx=-0.676139, qy=-0.720912, qz=-0.133165, qw=-0.073410)  # body-frame t=44
APPROACH_BODY_045 = pose(x=0.457471, y=0.019056, z=1.283436, qx=-0.674898, qy=-0.722405, qz=-0.132639, qw=-0.071063)  # body-frame t=45
APPROACH_BODY_048 = pose(x=0.458075, y=0.056802, z=1.269692, qx=-0.673969, qy=-0.724244, qz=-0.129667, qw=-0.066511)  # body-frame t=48
APPROACH_BODY_052 = pose(x=0.457918, y=0.107685, z=1.242017, qx=-0.673618, qy=-0.725758, qz=-0.120194, qw=-0.071189)  # body-frame t=52
APPROACH_BODY_055 = pose(x=0.455694, y=0.145537, z=1.214000, qx=-0.672973, qy=-0.727267, qz=-0.102301, qw=-0.087882)  # body-frame t=55
APPROACH_BODY_056 = pose(x=0.452638, y=0.158284, z=1.204318, qx=-0.672009, qy=-0.728362, qz=-0.095434, qw=-0.093729)  # body-frame t=56
APPROACH_BODY_059 = pose(x=0.440644, y=0.196262, z=1.175495, qx=-0.668186, qy=-0.730647, qz=-0.078046, qw=-0.116586)  # body-frame t=59
APPROACH_BODY_060 = pose(x=0.435413, y=0.208977, z=1.166755, qx=-0.666427, qy=-0.731080, qz=-0.073967, qw=-0.126197)  # body-frame t=60
APPROACH_BODY_061 = pose(x=0.429144, y=0.221837, z=1.159433, qx=-0.664291, qy=-0.731063, qz=-0.071588, qw=-0.138347)  # body-frame t=61
APPROACH_BODY_062 = pose(x=0.421055, y=0.235062, z=1.154914, qx=-0.661687, qy=-0.730114, qz=-0.072150, qw=-0.154589)  # body-frame t=62
APPROACH_BODY_064 = pose(x=0.401722, y=0.261713, z=1.149434, qx=-0.656160, qy=-0.724941, qz=-0.081747, qw=-0.192958)  # body-frame t=64
APPROACH_BODY_066 = pose(x=0.381318, y=0.287643, z=1.146591, qx=-0.649655, qy=-0.715437, qz=-0.101774, qw=-0.236093)  # body-frame t=66
APPROACH_BODY_068 = pose(x=0.363946, y=0.308930, z=1.137406, qx=-0.643390, qy=-0.708235, qz=-0.116965, qw=-0.266030)  # body-frame t=68
APPROACH_BODY_070 = pose(x=0.358645, y=0.313695, z=1.131863, qx=-0.643556, qy=-0.703962, qz=-0.122176, qw=-0.274493)  # body-frame t=70
APPROACH_BODY_072 = pose(x=0.357684, y=0.313484, z=1.130694, qx=-0.645204, qy=-0.702059, qz=-0.126822, qw=-0.273389)  # body-frame t=72
APPROACH_BODY_074 = pose(x=0.356235, y=0.314166, z=1.129215, qx=-0.644237, qy=-0.701498, qz=-0.130340, qw=-0.275447)  # body-frame t=74
APPROACH_BODY_076 = pose(x=0.354972, y=0.321721, z=1.125478, qx=-0.641828, qy=-0.695392, qz=-0.146170, qw=-0.288307)  # body-frame t=76
APPROACH_BODY_077 = pose(x=0.353587, y=0.327157, z=1.122632, qx=-0.640852, qy=-0.689605, qz=-0.158438, qw=-0.297744)  # body-frame t=77
APPROACH_BODY_080 = pose(x=0.344836, y=0.347336, z=1.110027, qx=-0.633875, qy=-0.667060, qz=-0.204182, qw=-0.333981)  # body-frame t=80
APPROACH_BODY_082 = pose(x=0.335219, y=0.361138, z=1.101408, qx=-0.625481, qy=-0.644724, qz=-0.242480, qw=-0.366481)  # body-frame t=82
APPROACH_BODY_084 = pose(x=0.326099, y=0.371117, z=1.092422, qx=-0.616052, qy=-0.615374, qz=-0.285663, qw=-0.400239)  # body-frame t=84
APPROACH_BODY_085 = pose(x=0.321971, y=0.374922, z=1.088189, qx=-0.609505, qy=-0.597936, qz=-0.310176, qw=-0.418052)  # body-frame t=85
APPROACH_BODY_088 = pose(x=0.310020, y=0.384325, z=1.069945, qx=-0.580099, qy=-0.541928, qz=-0.387185, qw=-0.468921)  # body-frame t=88
APPROACH_BODY_090 = pose(x=0.307426, y=0.390444, z=1.050701, qx=-0.560247, qy=-0.516064, qz=-0.427645, qw=-0.486745)  # body-frame t=90
APPROACH_BODY_092 = pose(x=0.309404, y=0.394893, z=1.031223, qx=-0.543879, qy=-0.501132, qz=-0.453511, qw=-0.497383)  # body-frame t=92
APPROACH_BODY_096 = pose(x=0.312290, y=0.400058, z=1.002252, qx=-0.524519, qy=-0.485534, qz=-0.479070, qw=-0.509538)  # body-frame t=96
APPROACH_BODY_100 = pose(x=0.312160, y=0.402566, z=0.991254, qx=-0.523439, qy=-0.479238, qz=-0.483491, qw=-0.512425)  # body-frame t=100
APPROACH_BODY_104 = pose(x=0.311663, y=0.403411, z=0.986190, qx=-0.523919, qy=-0.479275, qz=-0.482354, qw=-0.512971)  # body-frame t=104
APPROACH_BODY_106 = pose(x=0.311799, y=0.403347, z=0.979765, qx=-0.523774, qy=-0.480360, qz=-0.481939, qw=-0.512494)  # body-frame t=106
APPROACH_BODY_108 = pose(x=0.313987, y=0.403028, z=0.971083, qx=-0.523533, qy=-0.481714, qz=-0.481711, qw=-0.511682)  # body-frame t=108
APPROACH_BODY_112 = pose(x=0.322921, y=0.403013, z=0.951437, qx=-0.522740, qy=-0.484329, qz=-0.482229, qw=-0.509532)  # body-frame t=112
APPROACH_BODY_116 = pose(x=0.334201, y=0.407987, z=0.931247, qx=-0.521099, qy=-0.488569, qz=-0.483998, qw=-0.505472)  # body-frame t=116
APPROACH_BODY_120 = pose(x=0.347274, y=0.418871, z=0.911406, qx=-0.519270, qy=-0.492583, qz=-0.485798, qw=-0.501718)  # body-frame t=120
APPROACH_BODY_124 = pose(x=0.356643, y=0.429781, z=0.896491, qx=-0.519214, qy=-0.492115, qz=-0.485620, qw=-0.502407)  # body-frame t=124
APPROACH_BODY_128 = pose(x=0.366104, y=0.438832, z=0.881803, qx=-0.519329, qy=-0.491568, qz=-0.485217, qw=-0.503212)  # body-frame t=128
APPROACH_BODY_132 = pose(x=0.375602, y=0.445309, z=0.870816, qx=-0.520032, qy=-0.489738, qz=-0.484666, qw=-0.504799)  # body-frame t=132
APPROACH_BODY_136 = pose(x=0.387852, y=0.447095, z=0.860734, qx=-0.521562, qy=-0.486912, qz=-0.484530, qw=-0.506083)  # body-frame t=136
APPROACH_BODY_140 = pose(x=0.403157, y=0.447375, z=0.851032, qx=-0.523444, qy=-0.484678, qz=-0.486026, qw=-0.504849)  # body-frame t=140
APPROACH_BODY_144 = pose(x=0.419055, y=0.447573, z=0.839582, qx=-0.523495, qy=-0.485049, qz=-0.486764, qw=-0.503726)  # body-frame t=144
APPROACH_BODY_145 = pose(x=0.423128, y=0.448221, z=0.835871, qx=-0.523238, qy=-0.485717, qz=-0.487018, qw=-0.503105)  # body-frame t=145
APPROACH_BODY_148 = pose(x=0.433532, y=0.452027, z=0.823082, qx=-0.522499, qy=-0.487970, qz=-0.487852, qw=-0.500880)  # body-frame t=148
APPROACH_BODY_152 = pose(x=0.444966, y=0.459688, z=0.805216, qx=-0.521790, qy=-0.489816, qz=-0.488939, qw=-0.498752)  # body-frame t=152
APPROACH_BODY_156 = pose(x=0.454771, y=0.466166, z=0.791108, qx=-0.522729, qy=-0.489057, qz=-0.488620, qw=-0.498827)  # body-frame t=156
APPROACH_BODY_158 = pose(x=0.457337, y=0.470413, z=0.789684, qx=-0.525722, qy=-0.490791, qz=-0.486887, qw=-0.495663)  # body-frame t=158
PRESS_160_JOINTS = [-0.383287, -1.762868, 2.001922, -2.251688, 0.128110, 2.661778, 2.742780]  # t=160
PRESS_161_JOINTS = [-0.388463, -1.762859, 1.998757, -2.244602, 0.130855, 2.661857, 2.740366]  # t=161
PRESS_162_JOINTS = [-0.392314, -1.762858, 1.996427, -2.239008, 0.134446, 2.661418, 2.739215]  # t=162
PRESS_164_JOINTS = [-0.395158, -1.762850, 1.994588, -2.233386, 0.143725, 2.658795, 2.739572]  # t=164
PRESS_166_JOINTS = [-0.394588, -1.762856, 1.994466, -2.232700, 0.154021, 2.658525, 2.740217]  # t=166
PRESS_168_JOINTS = [-0.392954, -1.762841, 1.994728, -2.234029, 0.164763, 2.658077, 2.738797]  # t=168
PRESS_169_JOINTS = [-0.391837, -1.762838, 1.995350, -2.235076, 0.170593, 2.656957, 2.737322]  # t=169
PRESS_170_JOINTS = [-0.390458, -1.762827, 1.995914, -2.235875, 0.176733, 2.654199, 2.734627]  # t=170
PRESS_172_JOINTS = [-0.387166, -1.762830, 1.995677, -2.236477, 0.189403, 2.645253, 2.726230]  # t=172
PRESS_174_JOINTS = [-0.383674, -1.762834, 1.996512, -2.238483, 0.198636, 2.639349, 2.714867]  # t=174
PRESS_176_JOINTS = [-0.379784, -1.762829, 1.997606, -2.242362, 0.205841, 2.637073, 2.703058]  # t=176
PRESS_178_JOINTS = [-0.375964, -1.762826, 1.998761, -2.246750, 0.212436, 2.636456, 2.691725]  # t=178
PRESS_179_JOINTS = [-0.374181, -1.762825, 1.999288, -2.248880, 0.215541, 2.636405, 2.686259]  # t=179
PRESS_180_JOINTS = [-0.372439, -1.762822, 1.999219, -2.250826, 0.218414, 2.636320, 2.680878]  # t=180
PRESS_182_JOINTS = [-0.369169, -1.762811, 1.997907, -2.254204, 0.224328, 2.635338, 2.669470]  # t=182
PRESS_184_JOINTS = [-0.365184, -1.762737, 1.994982, -2.257123, 0.231004, 2.629054, 2.655646]  # t=184
PRESS_185_JOINTS = [-0.362953, -1.762594, 1.992889, -2.258325, 0.234512, 2.624370, 2.647948]  # t=185
PRESS_186_JOINTS = [-0.360484, -1.762220, 1.990212, -2.259781, 0.237842, 2.619183, 2.639857]  # t=186
PRESS_187_JOINTS = [-0.357745, -1.761516, 1.986816, -2.261686, 0.240819, 2.613799, 2.631348]  # t=187
PRESS_188_JOINTS = [-0.354823, -1.760480, 1.982216, -2.264239, 0.243497, 2.608995, 2.622749]  # t=188
PRESS_189_JOINTS = [-0.350822, -1.758242, 1.974394, -2.268553, 0.245644, 2.604012, 2.613543]  # t=189
PRESS_190_JOINTS = [-0.347013, -1.755158, 1.965812, -2.273512, 0.247874, 2.600035, 2.603183]  # t=190
PRESS_191_JOINTS = [-0.344666, -1.752450, 1.958977, -2.277644, 0.250434, 2.598479, 2.593275]  # t=191
PRESS_192_JOINTS = [-0.343567, -1.750528, 1.954607, -2.280580, 0.253007, 2.598613, 2.585332]  # t=192
PRESS_194_JOINTS = [-0.343228, -1.748584, 1.952140, -2.283210, 0.257487, 2.600255, 2.576538]  # t=194
PRESS_196_JOINTS = [-0.341476, -1.746938, 1.953328, -2.286474, 0.259626, 2.599221, 2.574068]  # t=196
PRESS_198_JOINTS = [-0.340847, -1.740774, 1.954312, -2.291729, 0.266073, 2.600595, 2.565818]  # t=198
PRESS_200_JOINTS = [-0.345300, -1.731443, 1.952700, -2.293959, 0.278869, 2.608108, 2.548686]  # t=200
PRESS_202_JOINTS = [-0.349783, -1.722803, 1.951063, -2.295269, 0.291113, 2.614147, 2.532811]  # t=202
PRESS_204_JOINTS = [-0.353537, -1.716236, 1.949712, -2.295777, 0.301010, 2.618373, 2.519869]  # t=204
PRESS_205_JOINTS = [-0.354480, -1.714637, 1.949403, -2.295908, 0.303778, 2.619296, 2.516342]  # t=205
PRESS_206_JOINTS = [-0.354839, -1.713581, 1.949313, -2.296286, 0.305735, 2.619797, 2.513991]  # t=206
PRESS_208_JOINTS = [-0.354710, -1.710862, 1.949558, -2.298510, 0.310026, 2.621240, 2.509256]  # t=208
PRESS_210_JOINTS = [-0.353767, -1.709501, 1.950178, -2.300988, 0.312419, 2.622641, 2.506998]  # t=210
PRESS_212_JOINTS = [-0.352252, -1.709167, 1.951096, -2.303287, 0.312671, 2.622977, 2.505290]  # t=212
PRESS_214_JOINTS = [-0.352005, -1.709626, 1.951801, -2.303511, 0.309361, 2.623712, 2.494768]  # t=214
PRESS_216_JOINTS = [-0.349533, -1.709450, 1.954249, -2.306996, 0.299309, 2.625949, 2.469871]  # t=216
PRESS_218_JOINTS = [-0.345892, -1.706656, 1.957567, -2.313884, 0.286194, 2.630189, 2.430428]  # t=218
PRESS_220_JOINTS = [-0.346257, -1.693765, 1.958862, -2.322012, 0.281230, 2.636016, 2.366063]  # t=220
PRESS_222_JOINTS = [-0.353327, -1.672066, 1.956703, -2.325673, 0.284127, 2.638348, 2.277938]  # t=222
PRESS_224_JOINTS = [-0.366271, -1.644139, 1.951641, -2.322893, 0.292745, 2.632024, 2.173064]  # t=224
PRESS_225_JOINTS = [-0.374587, -1.628903, 1.948341, -2.318780, 0.298608, 2.624869, 2.116518]  # t=225
PRESS_226_JOINTS = [-0.384007, -1.613473, 1.944629, -2.312491, 0.305097, 2.614092, 2.058311]  # t=226
PRESS_227_JOINTS = [-0.394574, -1.598001, 1.940622, -2.303959, 0.312174, 2.599837, 1.998360]  # t=227
PRESS_228_JOINTS = [-0.406742, -1.583181, 1.936533, -2.292188, 0.319285, 2.582008, 1.936848]  # t=228
PRESS_230_JOINTS = [-0.434165, -1.558395, 1.928508, -2.258792, 0.331156, 2.531639, 1.814906]  # t=230
PRESS_232_JOINTS = [-0.462226, -1.544839, 1.921428, -2.215281, 0.335920, 2.463127, 1.704803]  # t=232
PRESS_234_JOINTS = [-0.487825, -1.544774, 1.916886, -2.168201, 0.332044, 2.390517, 1.611040]  # t=234
PRESS_236_JOINTS = [-0.505770, -1.556530, 1.913984, -2.126690, 0.319388, 2.323680, 1.541636]  # t=236
PRESS_238_JOINTS = [-0.517208, -1.575457, 1.913777, -2.092898, 0.305100, 2.273817, 1.491333]  # t=238
PRESS_240_JOINTS = [-0.524408, -1.595945, 1.914664, -2.066544, 0.296295, 2.238834, 1.452037]  # t=240
APPROACH_000_JOINTS = [-0.016587, -1.032450, -0.033487, -2.302095, 0.069495, 1.565082, 0.702389]  # 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)
    moveWholeBodyPath(body_waypoints=[APPROACH_BODY_004, APPROACH_BODY_006, APPROACH_BODY_008, APPROACH_BODY_012, APPROACH_BODY_014, APPROACH_BODY_015, APPROACH_BODY_016, APPROACH_BODY_018, APPROACH_BODY_020, APPROACH_BODY_022, APPROACH_BODY_024, APPROACH_BODY_027, APPROACH_BODY_028, APPROACH_BODY_029, APPROACH_BODY_030, APPROACH_BODY_032, APPROACH_BODY_036, APPROACH_BODY_040, APPROACH_BODY_042, APPROACH_BODY_043, APPROACH_BODY_044, APPROACH_BODY_045, APPROACH_BODY_048, APPROACH_BODY_052, APPROACH_BODY_055, APPROACH_BODY_056, APPROACH_BODY_059, APPROACH_BODY_060, APPROACH_BODY_061, APPROACH_BODY_062, APPROACH_BODY_064, APPROACH_BODY_066, APPROACH_BODY_068, APPROACH_BODY_070, APPROACH_BODY_072, APPROACH_BODY_074, APPROACH_BODY_076, APPROACH_BODY_077, APPROACH_BODY_080, APPROACH_BODY_082, APPROACH_BODY_084, APPROACH_BODY_085, APPROACH_BODY_088, APPROACH_BODY_090, APPROACH_BODY_092, APPROACH_BODY_096, APPROACH_BODY_100, APPROACH_BODY_104, APPROACH_BODY_106, APPROACH_BODY_108, APPROACH_BODY_112, APPROACH_BODY_116, APPROACH_BODY_120, APPROACH_BODY_124, APPROACH_BODY_128, APPROACH_BODY_132, APPROACH_BODY_136, APPROACH_BODY_140, APPROACH_BODY_144, APPROACH_BODY_145, APPROACH_BODY_148, APPROACH_BODY_152, APPROACH_BODY_156, APPROACH_BODY_158], base_waypoints=[[1.0838842695314497, -1.4135611365537692, -3.141592760828131], [1.0860430010955984, -1.4135502459172615, -3.1415911193703647], [1.1013247138504572, -1.4132257821481629, -3.1415771873714604], [1.140786337249323, -1.411838784384919, -3.141567085401685], [1.1595451263390952, -1.4110222878332144, -3.1415666548333987], [1.1626322699043912, -1.4106333043849162, -3.1417587579841184], [1.162698200573213, -1.410360945402292, -3.1427347623638076], [1.1625617888946775, -1.4075632351368215, -3.1448015739483077], [1.1621957352458787, -1.3922026047099432, -3.145335335909144], [1.1619592585195049, -1.3585116851096255, -3.144849253518386], [1.1619001867054606, -1.309780342975943, -3.144440714322822], [1.1618949508609984, -1.2297670623047454, -3.144655720974213], [1.1618513672122763, -1.2148321751058238, -3.1452293098581223], [1.1618252711546793, -1.2107009690911976, -3.145842826096414], [1.1618216771031888, -1.2105907437232486, -3.1459165578507435], [1.1618213864755211, -1.2105816565036855, -3.1459257330278256], [1.1618210355732201, -1.2105810112515971, -3.1459100193705853], [1.1618210413294991, -1.2105823116122008, -3.145903258880584], [1.1617830323917309, -1.2112666307242463, -3.145927525123555], [1.1617914302193477, -1.2109199824172303, -3.1459756513671553], [1.1617900930012472, -1.210842472411403, -3.145982379182223], [1.1617898090650915, -1.2108434284643557, -3.1459743577468027], [1.1617896466341646, -1.210853858914744, -3.145929018819685], [1.1617901395699946, -1.210851681163665, -3.145931310885829], [1.1617862035631212, -1.2108546911810947, -3.145942271149553], [1.1617870918140358, -1.2108549310898338, -3.1459357891367214], [1.16178787063042, -1.2108550581137012, -3.1459356648466743], [1.1617867441872602, -1.2108552137426383, -3.1459398079896634], [1.1617841026908697, -1.2108548088478137, -3.1459540906223524], [1.161779874573425, -1.2108556437373965, -3.1459750585949195], [1.161787863852819, -1.2108575084368838, -3.145931460934494], [1.1617907712410416, -1.2108573085589545, -3.145925071627995], [1.1618014305155553, -1.2108682672304596, -3.1458139980096145], [1.161795070147136, -1.2108639233819005, -3.1458769407079115], [1.1617910918481662, -1.2108559440323934, -3.145917030792638], [1.1617901478596777, -1.2108488750833457, -3.1459342761183864], [1.1617866492989724, -1.2108518646369395, -3.1459569058192063], [1.1617876642234046, -1.2108545521260634, -3.1459496954625186], [1.1617868473310198, -1.2108548762228473, -3.145966210310273], [1.161789785298185, -1.2108592710015673, -3.145932815404523], [1.161791411024057, -1.2108598560845831, -3.1459203873920885], [1.1617904355133732, -1.2108592270473897, -3.145935871520401], [1.1617936010481382, -1.210853777880093, -3.1459044137301855], [1.1617941250629698, -1.2108517534163847, -3.1458762788220405], [1.1617907887761527, -1.210854810425163, -3.145912577181026], [1.1617901683579572, -1.2108537882552028, -3.145915973144532], [1.1617901948622416, -1.2108569178570803, -3.1459236737948437], [1.1617901715904633, -1.2108563330870172, -3.1459197955132923], [1.1617902071569493, -1.21085502704688, -3.1459170062937885], [1.1617912273563105, -1.210854608718723, -3.1459027684674403], [1.1617902416731074, -1.2108545689813994, -3.145917381384402], [1.1617908701368216, -1.2108527653607795, -3.1459094973621973], [1.161789518414828, -1.2108559161964827, -3.145933008109794], [1.1617902517679133, -1.210857885956448, -3.145920606772542], [1.1617895808196115, -1.210857148231259, -3.1459324524129344], [1.1617903021136782, -1.2108580662625765, -3.145919124917402], [1.1617904203338152, -1.2108565123818011, -3.1459193194346353], [1.1617904286101617, -1.2108560642491624, -3.1459194689077954], [1.1617909222715073, -1.2108536679001922, -3.1459162209348133], [1.1617904492546072, -1.2108549871207615, -3.14592047641823], [1.1617895053092173, -1.2108561480979054, -3.1459301939474678], [1.1617902217769467, -1.2108553625792793, -3.1459236898719207], [1.1617872361207946, -1.2108560729165612, -3.1459284395306946], [1.1618142570554306, -1.210843839324468, -3.145773376622165]], base_modes=[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], torso_targets=[6.693231757825495e-08, -2.3166662129924537e-07, -4.6624591877530027e-07, 2.444329923636973e-06, 2.9369019055672328e-06, 4.808867745588956e-06, 5.151836295751346e-06, 3.913518293540486e-06, 2.5628522420539613e-06, 1.9973942908528465e-06, 2.132445695710552e-06, 2.78693141968409e-06, 2.8786647545240126e-06, 2.8008617004150823e-06, 2.6469295671500415e-06, 2.751070245153e-06, 3.304356063821438e-06, 3.3250184834829394e-06, 3.327519480869258e-06, 7.112717270683344e-06, 8.80319281573559e-06, 1.0653267205231131e-05, 1.5437633536327537e-05, 1.9278262305121035e-05, 2.0420016507180132e-05, 2.0822199964186826e-05, 1.9496258405738648e-05, 1.834556879491861e-05, 1.7543711925786198e-05, 1.6070492957039e-05, 1.5165182660805922e-05, 1.2565011724349779e-05, -1.2685443386074132e-07, -6.518082213250151e-06, -3.3263314998918065e-06, 2.6896928330335302e-06, 1.5056649772966113e-05, 2.0125180902434184e-05, 3.244011438146267e-05, 3.804864833988697e-05, 4.214585967767543e-05, 4.559736635290749e-05, 4.978525627538609e-05, 3.648714450899743e-05, 2.148948742774423e-05, 4.2797967051286985e-06, -3.1671378217093867e-06, 4.987826767649156e-06, 9.193653245262999e-06, 1.307116404953851e-05, 1.7640795012335773e-05, 2.1875388534655488e-05, 2.3744723996683133e-05, 2.206833931238197e-05, 2.0961757509281035e-05, 1.9974174071396443e-05, 1.833017786269768e-05, 1.9594347490781273e-05, 2.2305243727110093e-05, 2.3262854833228985e-05, 2.4546060520618463e-05, 2.4803577322624554e-05, 1.0620138409573587e-05, 9.291227402420832e-06], segment_steps=[4, 2, 2, 4, 2, 1, 1, 2, 2, 2, 2, 3, 1, 1, 1, 2, 4, 4, 2, 1, 1, 1, 3, 4, 3, 1, 3, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 3, 2, 2, 1, 3, 2, 2, 4, 4, 4, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 3, 4, 4, 3], settle_steps=0, gripper=-1.000, gripper_cmds=[], body_motion_priority=1.000000, base_xy_priority=1.000000, base_yaw_priority=0.012624, base_position_gain=5.500000, base_yaw_gain=3.417674, base_position_ff_gain=24.000000, base_yaw_ff_gain=6.227239, base_ee_anchor_mix=0.350000)

def press_control():
    """Execute the short interaction path that actuates the control."""
    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_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_168_JOINTS, input_type='joint', steps=2, 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_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_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_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_185_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_186_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_187_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_188_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_189_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_190_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_191_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_192_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_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_200_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_202_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_204_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_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_212_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_214_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_216_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_218_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_220_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_222_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_224_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_225_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_226_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_227_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_228_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_230_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_232_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_234_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_236_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_238_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_240_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)

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

Turn on the rear left burner of the stove.

cookware

all kettle_non_electric receptacle kettle cookware


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

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

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

OBJ_POSE_T0 = pose(x=6.930101, y=-0.209445, z=1.117933, qw=1.000000, qx=-0.000000, qy=0.000000, qz=0.000000)
GOAL_RECEPTACLE_POSE = pose(x=6.930101, y=-0.209445, z=1.051701, qw=1.000000, qx=-0.000000, qy=-0.000000, qz=-0.000000)

APPROACH_003_JOINTS = [-0.016565, -1.024730, -0.023129, -2.297984, 0.041003, 1.505004, 0.691322]  # t=3
APPROACH_006_JOINTS = [-0.018975, -1.027304, -0.043491, -2.314203, 0.023382, 1.512081, 0.676968]  # t=6
APPROACH_009_JOINTS = [-0.023251, -1.032600, -0.089368, -2.339756, -0.005683, 1.528036, 0.634759]  # t=9
APPROACH_012_JOINTS = [-0.028249, -1.041908, -0.142169, -2.371178, -0.034189, 1.554899, 0.585988]  # t=12
APPROACH_014_JOINTS = [-0.031284, -1.048215, -0.167827, -2.391989, -0.049918, 1.571164, 0.564998]  # t=14
APPROACH_015_JOINTS = [-0.032810, -1.050083, -0.180173, -2.402744, -0.057400, 1.580714, 0.556161]  # t=15
APPROACH_016_JOINTS = [-0.034353, -1.050145, -0.193185, -2.414374, -0.065619, 1.593589, 0.547264]  # t=16
APPROACH_018_JOINTS = [-0.037086, -1.042760, -0.221062, -2.442983, -0.084167, 1.633312, 0.528397]  # t=18
APPROACH_019_JOINTS = [-0.037776, -1.036351, -0.232888, -2.457889, -0.090882, 1.657222, 0.520114]  # t=19
APPROACH_021_JOINTS = [-0.037771, -1.023574, -0.246558, -2.483313, -0.095991, 1.699337, 0.510198]  # t=21
APPROACH_024_JOINTS = [-0.036051, -1.003558, -0.252911, -2.507119, -0.090059, 1.749956, 0.507900]  # t=24
APPROACH_026_JOINTS = [-0.034784, -0.984948, -0.262155, -2.515176, -0.080864, 1.780201, 0.505196]  # t=26
APPROACH_027_JOINTS = [-0.034519, -0.974277, -0.270974, -2.517955, -0.076257, 1.793970, 0.500800]  # t=27
APPROACH_030_JOINTS = [-0.035505, -0.947173, -0.303777, -2.523512, -0.067684, 1.820468, 0.479477]  # t=30
APPROACH_032_JOINTS = [-0.035648, -0.927755, -0.324647, -2.526698, -0.063840, 1.841991, 0.463370]  # t=32
APPROACH_033_JOINTS = [-0.035215, -0.916068, -0.333566, -2.528706, -0.062210, 1.855955, 0.456013]  # t=33
APPROACH_035_JOINTS = [-0.033101, -0.888748, -0.348645, -2.533557, -0.057486, 1.888846, 0.442733]  # t=35
APPROACH_036_JOINTS = [-0.031196, -0.873753, -0.353755, -2.536072, -0.053058, 1.906579, 0.437363]  # t=36
APPROACH_039_JOINTS = [-0.022537, -0.821951, -0.360948, -2.541057, -0.033466, 1.966679, 0.426845]  # t=39
APPROACH_042_JOINTS = [-0.012433, -0.763430, -0.364937, -2.536921, -0.008327, 2.014303, 0.419108]  # t=42
APPROACH_045_JOINTS = [-0.003817, -0.705047, -0.369900, -2.522129, 0.017102, 2.032558, 0.411340]  # t=45
APPROACH_048_JOINTS = [0.001404, -0.656228, -0.375665, -2.505647, 0.038387, 2.035244, 0.401320]  # t=48
APPROACH_049_JOINTS = [0.003120, -0.640287, -0.377773, -2.501013, 0.047416, 2.038595, 0.396786]  # t=49
PRESS_051_JOINTS = [0.001780, -0.635648, -0.379134, -2.494832, 0.061621, 2.027812, 0.398740]  # t=51
PRESS_053_JOINTS = [-0.000151, -0.634698, -0.379843, -2.494226, 0.072571, 2.026540, 0.397606]  # t=53
PRESS_055_JOINTS = [-0.001719, -0.631261, -0.383200, -2.496928, 0.083280, 2.028508, 0.391035]  # t=55
PRESS_057_JOINTS = [-0.003070, -0.627671, -0.387627, -2.500358, 0.093940, 2.029958, 0.382834]  # t=57
PRESS_059_JOINTS = [-0.005543, -0.627691, -0.394725, -2.508559, 0.101479, 2.027748, 0.373178]  # t=59
PRESS_061_JOINTS = [-0.009618, -0.632401, -0.403444, -2.524739, 0.102494, 2.028055, 0.362799]  # t=61
PRESS_063_JOINTS = [-0.010780, -0.628352, -0.407261, -2.543813, 0.104846, 2.051905, 0.352671]  # t=63
PRESS_065_JOINTS = [-0.010989, -0.618141, -0.412377, -2.568394, 0.107274, 2.084511, 0.341927]  # t=65
PRESS_067_JOINTS = [-0.010869, -0.606098, -0.418551, -2.593806, 0.111997, 2.119837, 0.329936]  # t=67
PRESS_068_JOINTS = [-0.010840, -0.599043, -0.422067, -2.605848, 0.114175, 2.139378, 0.323530]  # t=68
PRESS_069_JOINTS = [-0.011021, -0.595841, -0.423759, -2.610997, 0.115593, 2.154799, 0.317338]  # t=69
PRESS_071_JOINTS = [-0.012804, -0.598339, -0.421465, -2.621429, 0.110761, 2.183638, 0.312665]  # t=71
PRESS_073_JOINTS = [-0.014890, -0.600330, -0.418200, -2.631557, 0.103293, 2.211774, 0.313210]  # t=73
PRESS_075_JOINTS = [-0.016900, -0.601928, -0.415677, -2.641133, 0.097302, 2.237573, 0.314621]  # t=75
PRESS_077_JOINTS = [-0.018237, -0.603308, -0.413387, -2.648742, 0.095497, 2.258866, 0.316938]  # t=77
PRESS_079_JOINTS = [-0.019845, -0.603354, -0.415269, -2.651334, 0.095289, 2.267662, 0.316928]  # t=79
PRESS_081_JOINTS = [-0.020376, -0.602560, -0.419739, -2.647873, 0.100269, 2.266066, 0.311529]  # t=81
PRESS_082_JOINTS = [-0.020094, -0.603180, -0.421768, -2.644608, 0.106026, 2.261053, 0.308079]  # t=82
APPROACH_000_JOINTS = [-0.016331, -1.025097, -0.021432, -2.290728, 0.043016, 1.505365, 0.691966]  # t=1

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

def move_to_control_panel():
    """Approach the appliance control region."""
    moveJoint(APPROACH_000_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_003_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_006_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_009_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_012_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_014_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_015_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_016_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_018_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_019_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_021_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_024_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_026_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_027_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_030_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_032_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_033_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_035_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_036_JOINTS, input_type='joint', steps=1, 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_049_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_051_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_053_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_055_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_057_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_059_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_061_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_063_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_065_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_067_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_068_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_069_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_071_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_073_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_075_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_077_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_079_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_081_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_082_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

Push down the lever of the toaster to turn it on.