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

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

SCENE_ARTIFACT = '../../../artifacts/20260324/SlideToasterOvenRack/20260324_205338_slide-toaster-oven-rack_episode_000000_action2code-open-loop-joint_initial-scene.json'
POLICY_METADATA = {
    'policy_kind': 'open_loop_joint',
    'policy_variant': 'open-loop-joint',
    'task_name': 'SlideToasterOvenRack',
    'episode_id': 'episode_000000',
    'scene_artifact_path': '../../../artifacts/20260324/SlideToasterOvenRack/20260324_205338_slide-toaster-oven-rack_episode_000000_action2code-open-loop-joint_initial-scene.json',
    'fitting_summary_path': '../../../artifacts/20260324/SlideToasterOvenRack/20260324_205338_slide-toaster-oven-rack_episode_000000_action2code-open-loop-joint_fitting-summary.json',
    'extracted_pose_metadata_path': '../../../artifacts/20260324/SlideToasterOvenRack/20260324_205338_slide-toaster-oven-rack_episode_000000_action2code-open-loop-joint_extracted-pose-metadata.json',
    'stable_grasp_contact_t': 92,
    'stable_release_contact_loss_t': 92,
    '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.018310, -1.066318, -0.038208, -2.259889, 0.014578, 1.510757, 0.707621]  # t=2
APPROACH_003_JOINTS = [-0.018537, -1.072299, -0.039852, -2.265157, 0.021217, 1.503298, 0.712612]  # t=3
APPROACH_004_JOINTS = [-0.018483, -1.079103, -0.039946, -2.278356, 0.030403, 1.500383, 0.717944]  # t=4
APPROACH_006_JOINTS = [-0.018372, -1.100761, -0.041601, -2.324280, 0.053462, 1.503538, 0.727067]  # t=6
APPROACH_009_JOINTS = [-0.019111, -1.176738, -0.030842, -2.408603, 0.076365, 1.508501, 0.744690]  # t=9
APPROACH_011_JOINTS = [-0.020314, -1.246201, -0.014297, -2.477201, 0.085939, 1.534421, 0.766971]  # t=11
APPROACH_012_JOINTS = [-0.020563, -1.280639, -0.004207, -2.517263, 0.092328, 1.560492, 0.777946]  # t=12
APPROACH_014_JOINTS = [-0.021034, -1.348775, 0.014091, -2.598420, 0.101684, 1.619359, 0.799544]  # t=14
APPROACH_015_JOINTS = [-0.021220, -1.386782, 0.021529, -2.636837, 0.104290, 1.643986, 0.810261]  # t=15
APPROACH_018_JOINTS = [-0.018805, -1.495652, 0.047891, -2.754547, 0.120023, 1.723313, 0.836344]  # t=18
APPROACH_020_JOINTS = [-0.015274, -1.566563, 0.064919, -2.827532, 0.131174, 1.774388, 0.848071]  # t=20
APPROACH_021_JOINTS = [-0.013102, -1.602993, 0.073942, -2.860740, 0.135362, 1.799901, 0.854099]  # t=21
APPROACH_024_JOINTS = [-0.004755, -1.706964, 0.101245, -2.944092, 0.142709, 1.857555, 0.871120]  # t=24
APPROACH_026_JOINTS = [0.001236, -1.756093, 0.109921, -2.988664, 0.147189, 1.885532, 0.875030]  # t=26
APPROACH_027_JOINTS = [0.003951, -1.764691, 0.112731, -3.005225, 0.148844, 1.903378, 0.875783]  # t=27
APPROACH_030_JOINTS = [0.010442, -1.752947, 0.114598, -3.027836, 0.149869, 1.952497, 0.873680]  # t=30
APPROACH_033_JOINTS = [0.015440, -1.727200, 0.114383, -3.047399, 0.151715, 2.008723, 0.868306]  # t=33
APPROACH_036_JOINTS = [0.019025, -1.681157, 0.115287, -3.071089, 0.156165, 2.093717, 0.861468]  # t=36
APPROACH_039_JOINTS = [0.020426, -1.603276, 0.117009, -3.071885, 0.160646, 2.181141, 0.855082]  # t=39
APPROACH_040_JOINTS = [0.020626, -1.571962, 0.117278, -3.071871, 0.162454, 2.213531, 0.852067]  # t=40
APPROACH_042_JOINTS = [0.020833, -1.502174, 0.117925, -3.071861, 0.166724, 2.283615, 0.845334]  # t=42
APPROACH_044_JOINTS = [0.021092, -1.432088, 0.118559, -3.071798, 0.170498, 2.348035, 0.839618]  # t=44
APPROACH_045_JOINTS = [0.021639, -1.401049, 0.118062, -3.071777, 0.172435, 2.371060, 0.835555]  # t=45
APPROACH_048_JOINTS = [0.024365, -1.333129, 0.112888, -3.071842, 0.177004, 2.402904, 0.820271]  # t=48
APPROACH_051_JOINTS = [0.027619, -1.263724, 0.110512, -3.071915, 0.183883, 2.452968, 0.805268]  # t=51
APPROACH_054_JOINTS = [0.029773, -1.165040, 0.112679, -3.071858, 0.192455, 2.543077, 0.796073]  # t=54
APPROACH_057_JOINTS = [0.032496, -1.088952, 0.112765, -3.071866, 0.198552, 2.605429, 0.789382]  # t=57
APPROACH_058_JOINTS = [0.033301, -1.076919, 0.112318, -3.071864, 0.198975, 2.612533, 0.788614]  # t=58
PRESS_060_JOINTS = [0.033998, -1.060742, 0.111605, -3.067049, 0.196971, 2.623720, 0.787478]  # t=60
PRESS_062_JOINTS = [0.034165, -1.045003, 0.111209, -3.061544, 0.194073, 2.634150, 0.786279]  # t=62
PRESS_064_JOINTS = [0.034165, -1.028038, 0.110875, -3.055556, 0.191221, 2.645452, 0.784745]  # t=64
PRESS_066_JOINTS = [0.034093, -1.011390, 0.110361, -3.049302, 0.188301, 2.655912, 0.783085]  # t=66
PRESS_067_JOINTS = [0.034040, -1.003800, 0.110019, -3.046267, 0.186874, 2.660314, 0.782357]  # t=67
PRESS_068_JOINTS = [0.033988, -0.996996, 0.109628, -3.043412, 0.185506, 2.663981, 0.781761]  # t=68
PRESS_070_JOINTS = [0.033927, -0.986681, 0.108701, -3.038541, 0.183037, 2.668534, 0.781114]  # t=70
PRESS_071_JOINTS = [0.033960, -0.984736, 0.108197, -3.037163, 0.182012, 2.668148, 0.781109]  # t=71
PRESS_072_JOINTS = [0.034156, -0.987201, 0.107807, -3.037121, 0.181144, 2.664146, 0.781204]  # t=72
PRESS_073_JOINTS = [0.034786, -0.992782, 0.108229, -3.038452, 0.180604, 2.657878, 0.781826]  # t=73
PRESS_074_JOINTS = [0.036429, -1.002283, 0.110505, -3.041132, 0.180660, 2.648413, 0.783732]  # t=74
PRESS_076_JOINTS = [0.039976, -1.034133, 0.116828, -3.047405, 0.178830, 2.608639, 0.790785]  # t=76
PRESS_078_JOINTS = [0.044161, -1.071667, 0.124482, -3.051467, 0.177579, 2.553095, 0.800624]  # t=78
PRESS_080_JOINTS = [0.046959, -1.109150, 0.129467, -3.052752, 0.175105, 2.488475, 0.809649]  # t=80
PRESS_082_JOINTS = [0.047670, -1.154374, 0.128307, -3.050110, 0.169551, 2.396868, 0.814736]  # t=82
PRESS_084_JOINTS = [0.047870, -1.199225, 0.125446, -3.039923, 0.163828, 2.282891, 0.819490]  # t=84
PRESS_086_JOINTS = [0.047792, -1.239521, 0.120572, -3.022557, 0.159284, 2.150927, 0.824409]  # t=86
PRESS_087_JOINTS = [0.047689, -1.258342, 0.115459, -3.011791, 0.159371, 2.078458, 0.826226]  # t=87
PRESS_088_JOINTS = [0.047274, -1.275342, 0.108424, -2.999889, 0.160295, 2.003271, 0.827661]  # t=88
PRESS_090_JOINTS = [0.045434, -1.299196, 0.093141, -2.973527, 0.162019, 1.852690, 0.831252]  # t=90
PRESS_092_JOINTS = [0.042867, -1.308295, 0.078954, -2.945916, 0.163837, 1.707060, 0.834091]  # t=92
PRESS_094_JOINTS = [0.040066, -1.301387, 0.066326, -2.917951, 0.166579, 1.579844, 0.832874]  # t=94
PRESS_095_JOINTS = [0.038892, -1.291686, 0.060373, -2.905650, 0.168173, 1.529135, 0.830635]  # t=95
PRESS_096_JOINTS = [0.038144, -1.277473, 0.054442, -2.894176, 0.169443, 1.489885, 0.827570]  # t=96
PRESS_097_JOINTS = [0.037995, -1.258870, 0.048173, -2.883497, 0.170629, 1.462801, 0.824320]  # t=97
PRESS_098_JOINTS = [0.038367, -1.237446, 0.041005, -2.873105, 0.172029, 1.444367, 0.821357]  # t=98
PRESS_099_JOINTS = [0.039070, -1.216231, 0.033398, -2.862643, 0.173793, 1.426874, 0.819279]  # t=99
RETREAT_107_JOINTS = [0.032334, -1.227559, 0.036522, -2.837022, 0.191153, 1.313266, 0.821020]  # t=107
APPROACH_000_JOINTS = [-0.018436, -1.062742, -0.038319, -2.258365, 0.009854, 1.517683, 0.706290]  # t=1

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

def move_to_control_panel():
    """Approach the appliance control region."""
    moveJoint(APPROACH_000_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_002_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_003_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_004_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_006_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_009_JOINTS, input_type='joint', steps=3, 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_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_018_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_020_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_021_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_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_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_040_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_042_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_044_JOINTS, input_type='joint', steps=2, 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_051_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_054_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_057_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_058_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_060_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_062_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_064_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_066_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_067_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_068_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_070_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_071_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_072_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    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_076_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_078_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_080_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_082_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_084_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_086_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_087_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_088_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_090_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_092_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_094_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_095_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_096_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_097_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_098_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_099_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_107_JOINTS, input_type='joint', steps=8, settle_steps=0, gripper=-1.000)

move_to_control_panel()
press_control()
retreat_after_press()

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


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

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

SCENE_ARTIFACT = '../../../artifacts/20260324/StartCoffeeMachine/20260324_205339_start-coffee-machine_episode_000000_action2code-open-loop-joint_initial-scene.json'
POLICY_METADATA = {
    'policy_kind': 'open_loop_joint',
    'policy_variant': 'open-loop-joint',
    'task_name': 'StartCoffeeMachine',
    'episode_id': 'episode_000000',
    'scene_artifact_path': '../../../artifacts/20260324/StartCoffeeMachine/20260324_205339_start-coffee-machine_episode_000000_action2code-open-loop-joint_initial-scene.json',
    'fitting_summary_path': '../../../artifacts/20260324/StartCoffeeMachine/20260324_205339_start-coffee-machine_episode_000000_action2code-open-loop-joint_fitting-summary.json',
    'extracted_pose_metadata_path': '../../../artifacts/20260324/StartCoffeeMachine/20260324_205339_start-coffee-machine_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=5.802913, y=-3.751754, z=0.998361, qw=0.912257, qx=0.000134, qy=0.000142, qz=-0.409618)
GOAL_RECEPTACLE_POSE = pose(x=5.802914, y=-3.751791, z=0.998378, qw=0.912267, qx=0.000526, qy=0.000275, qz=-0.409595)

APPROACH_003_JOINTS = [-0.025241, -1.034618, -0.050414, -2.303311, 0.074662, 1.566283, 0.738405]  # t=3
APPROACH_006_JOINTS = [-0.025062, -1.067114, -0.052134, -2.336046, 0.076796, 1.627912, 0.729823]  # t=6
APPROACH_009_JOINTS = [-0.025301, -1.132842, -0.054674, -2.398797, 0.080574, 1.714648, 0.716344]  # t=9
APPROACH_010_JOINTS = [-0.025433, -1.157253, -0.055426, -2.425094, 0.082121, 1.748583, 0.711539]  # t=10
APPROACH_012_JOINTS = [-0.025801, -1.206928, -0.056769, -2.482486, 0.085396, 1.819103, 0.702125]  # t=12
APPROACH_014_JOINTS = [-0.026388, -1.255030, -0.057574, -2.540569, 0.088121, 1.882786, 0.695073]  # t=14
APPROACH_015_JOINTS = [-0.026566, -1.276224, -0.057555, -2.566904, 0.089549, 1.907944, 0.692354]  # t=15
APPROACH_018_JOINTS = [-0.026126, -1.321716, -0.054217, -2.627063, 0.095563, 1.953592, 0.687558]  # t=18
APPROACH_019_JOINTS = [-0.025748, -1.331523, -0.052009, -2.641278, 0.097973, 1.963732, 0.687235]  # t=19
APPROACH_021_JOINTS = [-0.024838, -1.343657, -0.046509, -2.664151, 0.102926, 1.984154, 0.687554]  # t=21
APPROACH_024_JOINTS = [-0.023449, -1.343676, -0.040182, -2.689174, 0.108728, 2.020645, 0.687349]  # t=24
APPROACH_027_JOINTS = [-0.021568, -1.324389, -0.036844, -2.702592, 0.113605, 2.066243, 0.684228]  # t=27
APPROACH_030_JOINTS = [-0.019588, -1.295348, -0.035166, -2.707324, 0.117461, 2.112539, 0.680581]  # t=30
APPROACH_033_JOINTS = [-0.017185, -1.258296, -0.033289, -2.707776, 0.121995, 2.163923, 0.676448]  # t=33
APPROACH_036_JOINTS = [-0.014658, -1.219418, -0.031889, -2.708514, 0.126668, 2.214023, 0.671571]  # t=36
APPROACH_039_JOINTS = [-0.011951, -1.181841, -0.030944, -2.711784, 0.132209, 2.268015, 0.665131]  # t=39
APPROACH_042_JOINTS = [-0.008686, -1.148371, -0.030257, -2.721509, 0.140222, 2.335381, 0.655314]  # t=42
APPROACH_045_JOINTS = [-0.004484, -1.119411, -0.029731, -2.743866, 0.151641, 2.418459, 0.641363]  # t=45
APPROACH_048_JOINTS = [0.001269, -1.093311, -0.029010, -2.775817, 0.167050, 2.514718, 0.623704]  # t=48
APPROACH_051_JOINTS = [0.009065, -1.063203, -0.027990, -2.808957, 0.185464, 2.614810, 0.604456]  # t=51
APPROACH_054_JOINTS = [0.019485, -1.022038, -0.027208, -2.832871, 0.205771, 2.713171, 0.584903]  # t=54
APPROACH_055_JOINTS = [0.023362, -1.006458, -0.027521, -2.837562, 0.212720, 2.744965, 0.579011]  # t=55
PRESS_071_JOINTS = [0.028899, -1.113189, -0.044861, -2.910099, 0.229024, 2.804234, 0.615175]  # t=71
RETREAT_073_JOINTS = [0.031949, -1.213183, -0.054697, -2.940291, 0.234977, 2.770497, 0.594519]  # t=73
RETREAT_075_JOINTS = [0.030451, -1.317684, -0.063077, -2.961995, 0.235672, 2.720888, 0.580707]  # t=75
RETREAT_077_JOINTS = [0.027010, -1.409341, -0.068772, -2.967159, 0.234722, 2.665458, 0.573120]  # t=77
RETREAT_079_JOINTS = [0.024142, -1.473806, -0.071686, -2.953129, 0.234540, 2.608775, 0.570109]  # t=79
RETREAT_081_JOINTS = [0.022427, -1.512359, -0.073551, -2.920075, 0.235309, 2.550420, 0.569276]  # t=81
RETREAT_083_JOINTS = [0.021564, -1.534205, -0.076046, -2.874414, 0.237222, 2.490613, 0.567894]  # t=83
RETREAT_085_JOINTS = [0.019621, -1.546044, -0.079511, -2.824790, 0.237374, 2.422404, 0.568771]  # t=85
RETREAT_087_JOINTS = [0.015677, -1.555855, -0.085173, -2.775880, 0.234521, 2.335298, 0.573040]  # t=87
RETREAT_089_JOINTS = [0.009346, -1.572305, -0.093377, -2.727107, 0.227129, 2.226187, 0.582547]  # t=89
RETREAT_090_JOINTS = [0.005476, -1.582872, -0.099016, -2.703295, 0.221866, 2.167560, 0.588109]  # t=90
RETREAT_091_JOINTS = [0.001286, -1.595778, -0.106944, -2.680339, 0.215748, 2.107469, 0.592186]  # t=91
RETREAT_093_JOINTS = [-0.007647, -1.627210, -0.129816, -2.637899, 0.201843, 1.991048, 0.593621]  # t=93
RETREAT_094_JOINTS = [-0.012448, -1.644500, -0.144562, -2.618128, 0.193390, 1.937896, 0.591480]  # t=94
RETREAT_095_JOINTS = [-0.017909, -1.662692, -0.162552, -2.599127, 0.181740, 1.889732, 0.587795]  # t=95
RETREAT_096_JOINTS = [-0.023677, -1.681392, -0.182550, -2.581362, 0.168661, 1.846307, 0.582217]  # t=96
APPROACH_000_JOINTS = [-0.025554, -1.030225, -0.050075, -2.298869, 0.074377, 1.552870, 0.739870]  # t=1
PRESS_067_JOINTS = [0.020571, -0.999995, -0.034956, -2.865440, 0.219134, 2.840460, 0.637911]  # t=67

# 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_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_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_018_JOINTS, input_type='joint', steps=3, 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_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_054_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_055_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)

def press_control():
    """Execute the short interaction path that actuates the control."""
    moveJoint(PRESS_067_JOINTS, input_type='joint', steps=12, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_071_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)

def retreat_after_press():
    """Retreat away after the button press interaction."""
    moveJoint(RETREAT_073_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_075_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_077_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_079_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_081_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_083_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_085_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    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_090_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_091_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_093_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_094_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    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)

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 button on the coffee machine to serve coffee.


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

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

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

OBJ_POSE_T0 = pose(x=3.281729, y=-0.359868, z=1.474919, qw=0.958304, qx=-0.003767, qy=0.012689, qz=0.285445)
GOAL_RECEPTACLE_POSE = pose(x=3.281729, y=-0.359868, z=1.474919, qw=0.958304, qx=-0.003767, qy=0.012689, qz=0.285445)

APPROACH_002_JOINTS = [0.007144, -1.050902, -0.014364, -2.245706, 0.084238, 1.519166, 0.704316]  # t=2
APPROACH_004_JOINTS = [0.005323, -1.068916, -0.014868, -2.244506, 0.083965, 1.500082, 0.703579]  # t=4
APPROACH_005_JOINTS = [0.004210, -1.081716, -0.015545, -2.245052, 0.083663, 1.488907, 0.702924]  # t=5
APPROACH_010_JOINTS = [-0.003162, -1.188847, -0.018196, -2.272333, 0.077017, 1.491743, 0.702193]  # t=10
APPROACH_012_JOINTS = [-0.005709, -1.225626, -0.025669, -2.279986, 0.072230, 1.517033, 0.691197]  # t=12
APPROACH_015_JOINTS = [-0.010312, -1.265320, -0.056978, -2.282652, 0.051934, 1.562799, 0.662169]  # t=15
APPROACH_016_JOINTS = [-0.011676, -1.276380, -0.067747, -2.281514, 0.046171, 1.578251, 0.651717]  # t=16
APPROACH_018_JOINTS = [-0.014712, -1.296859, -0.094530, -2.278393, 0.031594, 1.610405, 0.627494]  # t=18
APPROACH_019_JOINTS = [-0.016195, -1.307267, -0.109184, -2.275993, 0.024850, 1.626880, 0.613731]  # t=19
APPROACH_020_JOINTS = [-0.017664, -1.317218, -0.124015, -2.273991, 0.018580, 1.643606, 0.599700]  # t=20
APPROACH_025_JOINTS = [-0.023859, -1.345629, -0.194765, -2.262113, -0.004105, 1.728972, 0.531616]  # t=25
APPROACH_030_JOINTS = [-0.027260, -1.347000, -0.271368, -2.239282, -0.011441, 1.805078, 0.462470]  # t=30
APPROACH_035_JOINTS = [-0.027243, -1.349488, -0.350626, -2.232022, 0.006636, 1.911938, 0.378293]  # t=35
APPROACH_040_JOINTS = [-0.024571, -1.365207, -0.422030, -2.250222, 0.053759, 2.063507, 0.273833]  # t=40
APPROACH_041_JOINTS = [-0.023098, -1.369680, -0.436828, -2.257168, 0.067996, 2.098192, 0.248473]  # t=41
APPROACH_045_JOINTS = [-0.010711, -1.385900, -0.493478, -2.288256, 0.146067, 2.241488, 0.133816]  # t=45
APPROACH_048_JOINTS = [0.006631, -1.389613, -0.523787, -2.306547, 0.221074, 2.335462, 0.043075]  # t=48
APPROACH_050_JOINTS = [0.022177, -1.383781, -0.537554, -2.314435, 0.272152, 2.392727, -0.016131]  # t=50
APPROACH_052_JOINTS = [0.042098, -1.371058, -0.549793, -2.317215, 0.326159, 2.442825, -0.073765]  # t=52
APPROACH_055_JOINTS = [0.076837, -1.340223, -0.567867, -2.306708, 0.403186, 2.495127, -0.150140]  # t=55
APPROACH_060_JOINTS = [0.135160, -1.268401, -0.598008, -2.243225, 0.503458, 2.509826, -0.229181]  # t=60
APPROACH_061_JOINTS = [0.148500, -1.250732, -0.607351, -2.224440, 0.523902, 2.506936, -0.242703]  # t=61
APPROACH_065_JOINTS = [0.199679, -1.178625, -0.662124, -2.138304, 0.596758, 2.474024, -0.289254]  # t=65
APPROACH_070_JOINTS = [0.261643, -1.083404, -0.742523, -2.004651, 0.673526, 2.406039, -0.321992]  # t=70
APPROACH_071_JOINTS = [0.273890, -1.063913, -0.757107, -1.977923, 0.686440, 2.392067, -0.327077]  # t=71
APPROACH_075_JOINTS = [0.315388, -0.998597, -0.805482, -1.895142, 0.725829, 2.338229, -0.353509]  # t=75
APPROACH_080_JOINTS = [0.357869, -0.938542, -0.840313, -1.842545, 0.781385, 2.323622, -0.400365]  # t=80
APPROACH_085_JOINTS = [0.416779, -0.876023, -0.878795, -1.820411, 0.881342, 2.340094, -0.492180]  # t=85
APPROACH_087_JOINTS = [0.435784, -0.871229, -0.895634, -1.816550, 0.934770, 2.331480, -0.548824]  # t=87
APPROACH_090_JOINTS = [0.456298, -0.880699, -0.918868, -1.819315, 1.017520, 2.304444, -0.642330]  # t=90
APPROACH_091_JOINTS = [0.462323, -0.882907, -0.927326, -1.823480, 1.041396, 2.293922, -0.670169]  # t=91
APPROACH_095_JOINTS = [0.491671, -0.858273, -0.960226, -1.819379, 1.100395, 2.265191, -0.724227]  # t=95
APPROACH_100_JOINTS = [0.525775, -0.818409, -1.003691, -1.783975, 1.136361, 2.218875, -0.743480]  # t=100
APPROACH_101_JOINTS = [0.531689, -0.811022, -1.010744, -1.777227, 1.140972, 2.214111, -0.746002]  # t=101
APPROACH_104_JOINTS = [0.558222, -0.778264, -1.029518, -1.754534, 1.162973, 2.219024, -0.756137]  # t=104
PRESS_105_JOINTS = [0.559538, -0.777105, -1.031909, -1.752510, 1.164905, 2.214966, -0.755636]  # t=105
PRESS_106_JOINTS = [0.558221, -0.776433, -1.030521, -1.752758, 1.164508, 2.217393, -0.752869]  # t=106
PRESS_108_JOINTS = [0.554140, -0.774514, -1.024701, -1.755495, 1.163443, 2.233129, -0.748880]  # t=108
PRESS_110_JOINTS = [0.552399, -0.772424, -1.022154, -1.756643, 1.165011, 2.242676, -0.745798]  # t=110
PRESS_112_JOINTS = [0.550612, -0.770016, -1.021087, -1.756311, 1.162994, 2.244903, -0.741330]  # t=112
PRESS_113_JOINTS = [0.549549, -0.767353, -1.021745, -1.754589, 1.160635, 2.242253, -0.736921]  # t=113
PRESS_114_JOINTS = [0.548038, -0.763496, -1.023909, -1.751512, 1.157756, 2.234840, -0.731317]  # t=114
PRESS_116_JOINTS = [0.542708, -0.751521, -1.030364, -1.742147, 1.149977, 2.212424, -0.714556]  # t=116
PRESS_117_JOINTS = [0.538855, -0.743716, -1.033404, -1.736403, 1.144365, 2.200718, -0.702604]  # t=117
PRESS_118_JOINTS = [0.534583, -0.734921, -1.036200, -1.729891, 1.137138, 2.189218, -0.687896]  # t=118
PRESS_120_JOINTS = [0.525934, -0.713932, -1.043559, -1.712484, 1.117288, 2.161193, -0.649614]  # t=120
PRESS_122_JOINTS = [0.518779, -0.688324, -1.056607, -1.687271, 1.093344, 2.120095, -0.602332]  # t=122
PRESS_123_JOINTS = [0.517062, -0.678424, -1.063750, -1.675874, 1.085992, 2.100327, -0.583536]  # t=123
PRESS_124_JOINTS = [0.517131, -0.672774, -1.069837, -1.667312, 1.082611, 2.085652, -0.571660]  # t=124
PRESS_125_JOINTS = [0.517742, -0.673926, -1.075678, -1.656241, 1.083897, 2.073398, -0.568517]  # t=125
PRESS_126_JOINTS = [0.517540, -0.682840, -1.082175, -1.645410, 1.086933, 2.057860, -0.571951]  # t=126
PRESS_127_JOINTS = [0.516091, -0.698600, -1.088709, -1.636217, 1.090046, 2.038646, -0.579696]  # t=127
RETREAT_129_JOINTS = [0.512850, -0.744374, -1.098377, -1.620736, 1.105648, 2.002499, -0.611477]  # t=129
RETREAT_130_JOINTS = [0.512301, -0.772118, -1.100546, -1.616864, 1.120025, 1.986753, -0.637317]  # t=130
RETREAT_131_JOINTS = [0.511613, -0.803211, -1.100329, -1.617975, 1.137602, 1.970215, -0.669746]  # t=131
RETREAT_132_JOINTS = [0.510412, -0.837334, -1.097878, -1.623852, 1.157227, 1.952615, -0.712273]  # t=132
RETREAT_133_JOINTS = [0.508205, -0.873955, -1.092758, -1.635576, 1.176020, 1.931148, -0.765481]  # t=133
RETREAT_134_JOINTS = [0.503646, -0.912573, -1.083744, -1.654851, 1.192916, 1.906361, -0.822305]  # t=134
RETREAT_135_JOINTS = [0.495561, -0.952414, -1.070378, -1.681468, 1.208460, 1.881983, -0.877635]  # t=135
RETREAT_136_JOINTS = [0.483847, -0.992980, -1.053735, -1.714169, 1.224522, 1.861460, -0.930977]  # t=136
RETREAT_137_JOINTS = [0.468505, -1.034179, -1.035678, -1.753177, 1.241522, 1.845572, -0.981384]  # t=137
RETREAT_139_JOINTS = [0.425970, -1.117596, -0.999415, -1.849306, 1.269401, 1.823258, -1.070828]  # t=139
RETREAT_141_JOINTS = [0.368734, -1.200476, -0.964963, -1.958847, 1.283306, 1.809012, -1.140068]  # t=141
RETREAT_143_JOINTS = [0.301744, -1.281849, -0.931187, -2.069477, 1.298046, 1.804287, -1.189594]  # t=143
RETREAT_144_JOINTS = [0.266647, -1.321002, -0.912884, -2.121978, 1.309621, 1.805094, -1.209290]  # t=144
RETREAT_145_JOINTS = [0.231928, -1.357249, -0.892175, -2.170911, 1.325136, 1.809842, -1.225590]  # t=145
RETREAT_147_JOINTS = [0.164492, -1.421621, -0.845466, -2.258747, 1.362400, 1.827190, -1.246030]  # t=147
RETREAT_149_JOINTS = [0.099084, -1.478592, -0.793765, -2.332677, 1.396599, 1.849207, -1.245995]  # t=149
RETREAT_150_JOINTS = [0.068201, -1.503839, -0.764001, -2.361636, 1.414101, 1.862768, -1.237513]  # t=150
APPROACH_000_JOINTS = [0.007781, -1.047156, -0.014442, -2.246671, 0.084042, 1.524396, 0.704567]  # t=1

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

def move_to_control_panel():
    """Approach the appliance control region."""
    moveJoint(APPROACH_000_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_002_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_004_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_005_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_010_JOINTS, input_type='joint', steps=5, 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_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_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_030_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_035_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_040_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_041_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_045_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_048_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_050_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_052_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_055_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_060_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_061_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_065_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_070_JOINTS, input_type='joint', steps=5, 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_080_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_085_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_087_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_090_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_091_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_095_JOINTS, input_type='joint', steps=4, 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_104_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=1.000)

def press_control():
    """Execute the short interaction path that actuates the control."""
    moveJoint(PRESS_105_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_106_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_108_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_110_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_112_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_113_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_114_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_116_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_117_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_118_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_120_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_122_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_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_126_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_127_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=2, 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_139_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(RETREAT_141_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(RETREAT_143_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(RETREAT_144_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(RETREAT_145_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(RETREAT_147_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(RETREAT_149_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(RETREAT_150_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)

move_to_control_panel()
press_control()
retreat_after_press()

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


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

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

SCENE_ARTIFACT = '../../../artifacts/20260324/TurnOffSinkFaucet/20260324_205341_turn-off-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': 'TurnOffSinkFaucet',
    'episode_id': 'episode_000000',
    'scene_artifact_path': '../../../artifacts/20260324/TurnOffSinkFaucet/20260324_205341_turn-off-sink-faucet_episode_000000_action2code-open-loop-joint_initial-scene.json',
    'fitting_summary_path': '../../../artifacts/20260324/TurnOffSinkFaucet/20260324_205341_turn-off-sink-faucet_episode_000000_action2code-open-loop-joint_fitting-summary.json',
    'extracted_pose_metadata_path': '../../../artifacts/20260324/TurnOffSinkFaucet/20260324_205341_turn-off-sink-faucet_episode_000000_action2code-open-loop-joint_extracted-pose-metadata.json',
    'stable_grasp_contact_t': 117,
    'stable_release_contact_loss_t': 117,
    '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=5.233928, y=-2.809772, z=0.940525, qw=0.653941, qx=-0.000537, qy=-0.000498, qz=-0.756545)

APPROACH_002_JOINTS = [-0.000523, -1.038089, -0.015882, -2.323054, 0.054658, 1.509204, 0.668663]  # t=2
APPROACH_005_JOINTS = [-0.003232, -1.121580, -0.019852, -2.325807, 0.049516, 1.483869, 0.665168]  # t=5
APPROACH_006_JOINTS = [-0.005807, -1.166656, -0.033907, -2.337906, 0.039557, 1.484371, 0.656755]  # t=6
APPROACH_008_JOINTS = [-0.012649, -1.264377, -0.085828, -2.373255, 0.015203, 1.492431, 0.623776]  # t=8
APPROACH_010_JOINTS = [-0.019676, -1.348919, -0.155767, -2.416134, -0.002133, 1.515508, 0.575108]  # t=10
APPROACH_013_JOINTS = [-0.029347, -1.411663, -0.275669, -2.467526, -0.018678, 1.555806, 0.500888]  # t=13
APPROACH_015_JOINTS = [-0.033214, -1.414544, -0.357341, -2.479470, -0.025167, 1.581423, 0.442301]  # t=15
APPROACH_018_JOINTS = [-0.028825, -1.365734, -0.476280, -2.473982, -0.020665, 1.632747, 0.326340]  # t=18
APPROACH_020_JOINTS = [-0.019008, -1.309183, -0.549850, -2.451087, -0.011599, 1.659725, 0.235333]  # t=20
APPROACH_022_JOINTS = [-0.003455, -1.244567, -0.614279, -2.415849, 0.007237, 1.678674, 0.134234]  # t=22
APPROACH_025_JOINTS = [0.017142, -1.166147, -0.673910, -2.368975, 0.045653, 1.687584, 0.011530]  # t=25
APPROACH_030_JOINTS = [0.052695, -1.059486, -0.737862, -2.375643, 0.123427, 1.813856, -0.152928]  # t=30
APPROACH_032_JOINTS = [0.076628, -1.010745, -0.764016, -2.395674, 0.173224, 1.895335, -0.228385]  # t=32
APPROACH_035_JOINTS = [0.129460, -0.924743, -0.807749, -2.415943, 0.277431, 1.994074, -0.368020]  # t=35
APPROACH_036_JOINTS = [0.150541, -0.894509, -0.824379, -2.418648, 0.318811, 2.021526, -0.423888]  # t=36
APPROACH_040_JOINTS = [0.237621, -0.789860, -0.898157, -2.406291, 0.502832, 2.081940, -0.685643]  # t=40
APPROACH_045_JOINTS = [0.334706, -0.675235, -0.999183, -2.350464, 0.686964, 2.048393, -0.953772]  # t=45
APPROACH_049_JOINTS = [0.409795, -0.565136, -1.077592, -2.283526, 0.776571, 1.991588, -1.047434]  # t=49
APPROACH_050_JOINTS = [0.430578, -0.534721, -1.095496, -2.265680, 0.800597, 1.980731, -1.064497]  # t=50
APPROACH_053_JOINTS = [0.494575, -0.438462, -1.151916, -2.211630, 0.878722, 1.949897, -1.110495]  # t=53
APPROACH_055_JOINTS = [0.538061, -0.368430, -1.189120, -2.177537, 0.941669, 1.932810, -1.136696]  # t=55
APPROACH_060_JOINTS = [0.624148, -0.159615, -1.277932, -2.106605, 1.131319, 1.866147, -1.210121]  # t=60
APPROACH_065_JOINTS = [0.542593, 0.115052, -1.239777, -2.038029, 1.367780, 1.731343, -1.279144]  # t=65
APPROACH_066_JOINTS = [0.488577, 0.162586, -1.195907, -2.018679, 1.405636, 1.701035, -1.288531]  # t=66
APPROACH_069_JOINTS = [0.285963, 0.270225, -1.021361, -1.941699, 1.477376, 1.619430, -1.305560]  # t=69
APPROACH_070_JOINTS = [0.214516, 0.295532, -0.959318, -1.912229, 1.488060, 1.594649, -1.310062]  # t=70
APPROACH_074_JOINTS = [-0.039893, 0.373133, -0.726661, -1.793091, 1.494636, 1.528937, -1.313854]  # t=74
APPROACH_075_JOINTS = [-0.091500, 0.390025, -0.675190, -1.763985, 1.492504, 1.521666, -1.311354]  # t=75
APPROACH_080_JOINTS = [-0.276573, 0.480017, -0.467525, -1.619502, 1.485112, 1.527749, -1.284928]  # t=80
APPROACH_085_JOINTS = [-0.372412, 0.580192, -0.337281, -1.480305, 1.482701, 1.560589, -1.254292]  # t=85
APPROACH_090_JOINTS = [-0.419470, 0.688958, -0.253390, -1.332347, 1.483916, 1.603458, -1.216156]  # t=90
APPROACH_095_JOINTS = [-0.446835, 0.791486, -0.197080, -1.189996, 1.475741, 1.622606, -1.174949]  # t=95
APPROACH_100_JOINTS = [-0.461074, 0.855115, -0.152388, -1.106252, 1.455852, 1.624638, -1.148678]  # t=100
APPROACH_101_JOINTS = [-0.464673, 0.859892, -0.147787, -1.098653, 1.451469, 1.620216, -1.147132]  # t=101
PRESS_102_JOINTS = [-0.467974, 0.861619, -0.143819, -1.095523, 1.447683, 1.616885, -1.147050]  # t=102
PRESS_103_JOINTS = [-0.470595, 0.862031, -0.139808, -1.094651, 1.444553, 1.615780, -1.147597]  # t=103
PRESS_105_JOINTS = [-0.474243, 0.860965, -0.132140, -1.096631, 1.438960, 1.615183, -1.149438]  # t=105
PRESS_107_JOINTS = [-0.475467, 0.858028, -0.124699, -1.103070, 1.432716, 1.614268, -1.152322]  # t=107
PRESS_109_JOINTS = [-0.475017, 0.853137, -0.118021, -1.111598, 1.427308, 1.612110, -1.156265]  # t=109
PRESS_111_JOINTS = [-0.473120, 0.845481, -0.112712, -1.124494, 1.423496, 1.611548, -1.159899]  # t=111
PRESS_113_JOINTS = [-0.471918, 0.839218, -0.111209, -1.135850, 1.422777, 1.611886, -1.163350]  # t=113
PRESS_115_JOINTS = [-0.470144, 0.833872, -0.110434, -1.144574, 1.422995, 1.611070, -1.164839]  # t=115
PRESS_116_JOINTS = [-0.469013, 0.831374, -0.110191, -1.148214, 1.423023, 1.610280, -1.165224]  # t=116
PRESS_117_JOINTS = [-0.467764, 0.828992, -0.110057, -1.151422, 1.423038, 1.609404, -1.165402]  # t=117
PRESS_119_JOINTS = [-0.464946, 0.824555, -0.110066, -1.156829, 1.422932, 1.607195, -1.165415]  # t=119
PRESS_121_JOINTS = [-0.461869, 0.820266, -0.110140, -1.161695, 1.422919, 1.604791, -1.165408]  # t=121
PRESS_123_JOINTS = [-0.458503, 0.815389, -0.110238, -1.167353, 1.422703, 1.603022, -1.164452]  # t=123
PRESS_125_JOINTS = [-0.454963, 0.810058, -0.110194, -1.173925, 1.423049, 1.602766, -1.164746]  # t=125
PRESS_126_JOINTS = [-0.453057, 0.807305, -0.110139, -1.177431, 1.423470, 1.603728, -1.164990]  # t=126
PRESS_127_JOINTS = [-0.451135, 0.804865, -0.110161, -1.180688, 1.424150, 1.605884, -1.165385]  # t=127
RETREAT_132_JOINTS = [-0.445159, 0.797149, -0.114303, -1.191897, 1.427113, 1.611639, -1.167398]  # t=132
APPROACH_000_JOINTS = [-0.000303, -1.030960, -0.016641, -2.324678, 0.053727, 1.519172, 0.668566]  # 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_006_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_008_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_010_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_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_018_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_020_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_022_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_025_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_030_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_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_036_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_040_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_045_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_049_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_050_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_053_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_055_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_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_066_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_069_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_070_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_074_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_075_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_080_JOINTS, input_type='joint', steps=5, 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)

def press_control():
    """Execute the short interaction path that actuates the control."""
    moveJoint(PRESS_102_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_103_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_105_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_107_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_109_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_111_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_113_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_115_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_116_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_117_JOINTS, input_type='joint', steps=1, 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_123_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_125_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_126_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_127_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_132_JOINTS, input_type='joint', steps=5, 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: TurnOffStove
# Episode: episode_000000

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

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

OBJ_POSE_T0 = pose(x=0.369970, y=-4.074561, z=0.995814, qw=0.973460, qx=0.000005, qy=-0.000009, qz=0.228858)
GOAL_RECEPTACLE_POSE = pose(x=0.362176, y=-4.075617, z=0.995755, qw=0.990752, qx=0.000030, qy=-0.000091, qz=0.135687)

APPROACH_002_JOINTS = [-0.027908, -1.039799, -0.016667, -2.246071, 0.012891, 1.480599, 0.726349]  # t=2
APPROACH_004_JOINTS = [-0.027635, -1.050688, -0.017768, -2.244887, 0.011711, 1.462426, 0.726244]  # t=4
APPROACH_005_JOINTS = [-0.027623, -1.060647, -0.019489, -2.244388, 0.010063, 1.448342, 0.725683]  # t=5
APPROACH_009_JOINTS = [-0.027705, -1.116309, -0.030388, -2.254240, 0.000533, 1.389590, 0.719794]  # t=9
APPROACH_010_JOINTS = [-0.027750, -1.131333, -0.033816, -2.260886, -0.002487, 1.379439, 0.717677]  # t=10
APPROACH_012_JOINTS = [-0.027376, -1.157777, -0.037497, -2.280080, -0.009697, 1.371525, 0.707999]  # t=12
APPROACH_015_JOINTS = [-0.025583, -1.187099, -0.040682, -2.317469, -0.028248, 1.381710, 0.669695]  # t=15
APPROACH_020_JOINTS = [-0.019003, -1.226431, -0.046796, -2.380131, -0.075370, 1.397953, 0.537662]  # t=20
APPROACH_025_JOINTS = [-0.010118, -1.267826, -0.076818, -2.446982, -0.128518, 1.413557, 0.337739]  # t=25
APPROACH_027_JOINTS = [-0.007210, -1.285059, -0.097108, -2.467705, -0.142577, 1.415396, 0.256073]  # t=27
APPROACH_030_JOINTS = [-0.007693, -1.323295, -0.130484, -2.496626, -0.153269, 1.399242, 0.176938]  # t=30
APPROACH_033_JOINTS = [-0.012746, -1.364172, -0.150767, -2.540318, -0.152532, 1.373592, 0.165219]  # t=33
APPROACH_035_JOINTS = [-0.016599, -1.385175, -0.161904, -2.577205, -0.152151, 1.364463, 0.168350]  # t=35
APPROACH_036_JOINTS = [-0.018850, -1.393036, -0.167337, -2.595858, -0.152387, 1.364922, 0.174934]  # t=36
APPROACH_040_JOINTS = [-0.029095, -1.414750, -0.180726, -2.664553, -0.159808, 1.371991, 0.217612]  # t=40
APPROACH_041_JOINTS = [-0.031932, -1.417823, -0.183269, -2.680726, -0.165105, 1.373051, 0.229666]  # t=41
APPROACH_045_JOINTS = [-0.044143, -1.415372, -0.203611, -2.735881, -0.195504, 1.390968, 0.279537]  # t=45
APPROACH_050_JOINTS = [-0.058356, -1.395569, -0.219806, -2.798862, -0.214523, 1.439276, 0.368310]  # t=50
APPROACH_052_JOINTS = [-0.064174, -1.387411, -0.224642, -2.829923, -0.219472, 1.470352, 0.408982]  # t=52
APPROACH_055_JOINTS = [-0.073447, -1.371779, -0.235437, -2.883262, -0.226717, 1.528300, 0.471008]  # t=55
APPROACH_059_JOINTS = [-0.087536, -1.348338, -0.255351, -2.952001, -0.233525, 1.613946, 0.550598]  # t=59
APPROACH_060_JOINTS = [-0.089841, -1.339901, -0.256034, -2.969337, -0.232067, 1.640818, 0.573619]  # t=60
APPROACH_065_JOINTS = [-0.093964, -1.284443, -0.238383, -3.043851, -0.213148, 1.789776, 0.690677]  # t=65
APPROACH_070_JOINTS = [-0.099419, -1.210171, -0.224579, -3.072060, -0.208152, 1.899279, 0.775356]  # t=70
APPROACH_075_JOINTS = [-0.102890, -1.135110, -0.215296, -3.070493, -0.199551, 1.967337, 0.826773]  # t=75
APPROACH_080_JOINTS = [-0.104188, -1.062998, -0.206956, -3.071085, -0.191903, 2.041904, 0.867712]  # t=80
APPROACH_085_JOINTS = [-0.102516, -0.986823, -0.193926, -3.055414, -0.179072, 2.105508, 0.915862]  # t=85
APPROACH_087_JOINTS = [-0.101943, -0.956360, -0.190968, -3.049969, -0.176005, 2.130202, 0.927418]  # t=87
APPROACH_090_JOINTS = [-0.099978, -0.900002, -0.187914, -3.050177, -0.172593, 2.192446, 0.944501]  # t=90
APPROACH_095_JOINTS = [-0.106372, -0.834433, -0.194427, -3.035876, -0.179382, 2.229633, 0.959980]  # t=95
APPROACH_100_JOINTS = [-0.112862, -0.808925, -0.201442, -3.025501, -0.181916, 2.234132, 0.962816]  # t=100
APPROACH_105_JOINTS = [-0.118859, -0.826066, -0.202765, -3.024946, -0.182599, 2.204347, 0.969097]  # t=105
APPROACH_110_JOINTS = [-0.126577, -0.859780, -0.204665, -3.033654, -0.186381, 2.168337, 0.984750]  # t=110
APPROACH_112_JOINTS = [-0.129668, -0.873557, -0.206197, -3.041398, -0.188804, 2.164593, 0.991593]  # t=112
APPROACH_115_JOINTS = [-0.133065, -0.875934, -0.209929, -3.061207, -0.194850, 2.189394, 1.002681]  # t=115
APPROACH_117_JOINTS = [-0.133931, -0.873284, -0.210520, -3.072399, -0.196326, 2.206770, 1.010272]  # t=117
APPROACH_120_JOINTS = [-0.132884, -0.858355, -0.210217, -3.071844, -0.195780, 2.221078, 1.014764]  # t=120
APPROACH_122_JOINTS = [-0.132811, -0.848152, -0.210463, -3.070998, -0.195512, 2.227833, 1.015630]  # t=122
APPROACH_125_JOINTS = [-0.132568, -0.841914, -0.209527, -3.066547, -0.193559, 2.226578, 1.016327]  # t=125
APPROACH_130_JOINTS = [-0.132636, -0.838801, -0.209098, -3.063917, -0.192454, 2.225623, 1.020053]  # t=130
APPROACH_135_JOINTS = [-0.130422, -0.840073, -0.203764, -3.064805, -0.186376, 2.224971, 1.031473]  # t=135
APPROACH_137_JOINTS = [-0.130277, -0.840225, -0.202060, -3.064912, -0.185506, 2.224904, 1.036976]  # t=137
PRESS_139_JOINTS = [-0.130061, -0.840081, -0.201122, -3.065031, -0.184681, 2.225385, 1.039462]  # t=139
PRESS_141_JOINTS = [-0.130053, -0.839759, -0.200992, -3.065035, -0.184587, 2.225775, 1.039567]  # t=141
PRESS_143_JOINTS = [-0.130048, -0.839295, -0.200989, -3.065047, -0.184561, 2.226362, 1.039563]  # t=143
PRESS_145_JOINTS = [-0.130048, -0.838541, -0.200990, -3.065068, -0.184546, 2.227305, 1.039558]  # t=145
PRESS_147_JOINTS = [-0.130055, -0.837761, -0.200968, -3.065048, -0.184482, 2.228180, 1.040017]  # t=147
PRESS_149_JOINTS = [-0.130446, -0.837193, -0.200483, -3.065016, -0.184067, 2.228709, 1.047797]  # t=149
PRESS_151_JOINTS = [-0.131624, -0.836836, -0.198778, -3.065009, -0.182727, 2.228905, 1.070443]  # t=151
PRESS_153_JOINTS = [-0.133600, -0.836624, -0.195692, -3.065123, -0.180378, 2.229082, 1.108384]  # t=153
PRESS_155_JOINTS = [-0.136155, -0.836547, -0.191335, -3.065462, -0.177321, 2.229569, 1.157918]  # t=155
PRESS_157_JOINTS = [-0.139044, -0.836552, -0.186044, -3.065972, -0.173903, 2.230373, 1.214063]  # t=157
PRESS_159_JOINTS = [-0.142111, -0.836567, -0.180062, -3.066597, -0.170345, 2.231488, 1.273531]  # t=159
PRESS_161_JOINTS = [-0.145356, -0.836535, -0.173696, -3.067271, -0.166659, 2.232831, 1.335078]  # t=161
PRESS_163_JOINTS = [-0.148624, -0.836170, -0.166725, -3.068016, -0.162780, 2.234941, 1.398620]  # t=163
PRESS_165_JOINTS = [-0.151517, -0.834681, -0.158967, -3.068482, -0.158532, 2.238343, 1.461908]  # t=165
PRESS_167_JOINTS = [-0.154447, -0.832587, -0.150957, -3.068449, -0.154204, 2.241315, 1.525484]  # t=167
PRESS_168_JOINTS = [-0.156359, -0.832383, -0.147531, -3.068651, -0.152552, 2.241901, 1.557023]  # t=168
PRESS_169_JOINTS = [-0.158835, -0.833642, -0.144887, -3.069389, -0.151588, 2.241318, 1.588074]  # t=169
PRESS_171_JOINTS = [-0.164893, -0.839440, -0.141173, -3.072212, -0.150833, 2.238034, 1.649152]  # t=171
PRESS_172_JOINTS = [-0.167824, -0.841010, -0.140205, -3.072067, -0.149400, 2.233466, 1.678949]  # t=172
PRESS_173_JOINTS = [-0.170848, -0.843058, -0.139623, -3.072017, -0.147872, 2.228104, 1.708571]  # t=173
PRESS_175_JOINTS = [-0.177186, -0.848675, -0.139467, -3.072053, -0.144439, 2.214392, 1.767891]  # t=175
PRESS_177_JOINTS = [-0.183121, -0.854515, -0.139030, -3.072056, -0.139563, 2.200044, 1.828845]  # t=177
PRESS_179_JOINTS = [-0.187214, -0.857429, -0.135709, -3.071959, -0.132900, 2.192100, 1.892014]  # t=179
PRESS_181_JOINTS = [-0.189749, -0.856836, -0.128599, -3.071840, -0.125813, 2.192017, 1.957933]  # t=181
PRESS_183_JOINTS = [-0.192077, -0.855190, -0.120085, -3.071730, -0.119115, 2.194383, 2.025106]  # t=183
PRESS_185_JOINTS = [-0.194609, -0.853334, -0.111513, -3.071521, -0.112699, 2.196970, 2.091750]  # t=185
PRESS_187_JOINTS = [-0.197385, -0.851439, -0.102050, -3.071403, -0.107000, 2.200038, 2.160852]  # t=187
PRESS_189_JOINTS = [-0.200281, -0.850007, -0.090922, -3.071884, -0.103111, 2.204498, 2.232108]  # t=189
PRESS_191_JOINTS = [-0.203393, -0.847532, -0.077276, -3.071603, -0.101522, 2.207569, 2.309175]  # t=191
PRESS_193_JOINTS = [-0.206681, -0.840433, -0.059718, -3.068956, -0.101937, 2.211524, 2.396915]  # t=193
PRESS_195_JOINTS = [-0.210310, -0.832482, -0.044001, -3.064904, -0.101064, 2.212101, 2.483385]  # t=195
PRESS_197_JOINTS = [-0.214541, -0.823325, -0.031480, -3.059857, -0.099538, 2.212197, 2.566593]  # t=197
PRESS_199_JOINTS = [-0.219006, -0.811076, -0.021011, -3.052940, -0.097402, 2.212688, 2.648421]  # t=199
PRESS_201_JOINTS = [-0.223633, -0.798632, -0.013104, -3.045453, -0.093721, 2.211921, 2.728572]  # t=201
PRESS_203_JOINTS = [-0.227618, -0.795346, -0.006523, -3.042489, -0.087027, 2.206879, 2.806775]  # t=203
PRESS_205_JOINTS = [-0.231125, -0.797590, -0.000709, -3.043157, -0.078422, 2.203333, 2.884055]  # t=205
PRESS_206_JOINTS = [-0.234139, -0.799207, 0.000976, -3.044133, -0.072246, 2.203856, 2.901613]  # t=206
PRESS_207_JOINTS = [-0.240770, -0.801849, 0.003075, -3.046205, -0.061669, 2.207315, 2.898382]  # t=207
PRESS_209_JOINTS = [-0.258748, -0.809352, 0.012702, -3.051925, -0.033231, 2.215245, 2.897703]  # t=209
PRESS_211_JOINTS = [-0.279329, -0.818590, 0.025852, -3.058968, -0.000425, 2.224260, 2.897705]  # t=211
PRESS_213_JOINTS = [-0.300612, -0.827219, 0.040100, -3.065890, 0.033387, 2.234257, 2.897707]  # t=213
PRESS_215_JOINTS = [-0.321826, -0.833663, 0.054736, -3.071622, 0.066061, 2.244588, 2.897712]  # t=215
PRESS_217_JOINTS = [-0.343397, -0.831958, 0.070743, -3.071790, 0.094180, 2.251801, 2.897718]  # t=217
PRESS_219_JOINTS = [-0.364203, -0.829393, 0.086862, -3.071227, 0.119702, 2.258029, 2.897722]  # t=219
PRESS_221_JOINTS = [-0.382915, -0.827749, 0.101163, -3.071062, 0.142743, 2.263529, 2.897725]  # t=221
PRESS_223_JOINTS = [-0.399655, -0.826840, 0.113176, -3.071394, 0.163465, 2.269056, 2.897728]  # t=223
PRESS_225_JOINTS = [-0.414903, -0.825419, 0.122312, -3.071869, 0.182273, 2.276061, 2.897729]  # t=225
PRESS_227_JOINTS = [-0.428879, -0.822092, 0.129142, -3.071828, 0.199053, 2.284926, 2.897728]  # t=227
PRESS_228_JOINTS = [-0.435066, -0.820942, 0.133060, -3.071853, 0.207336, 2.288040, 2.897725]  # t=228
PRESS_229_JOINTS = [-0.440943, -0.820159, 0.137416, -3.071863, 0.215267, 2.290222, 2.897724]  # t=229
PRESS_231_JOINTS = [-0.452191, -0.819595, 0.146697, -3.071891, 0.229520, 2.292833, 2.897730]  # t=231
PRESS_233_JOINTS = [-0.463001, -0.819763, 0.155782, -3.071921, 0.242597, 2.294066, 2.897733]  # t=233
PRESS_235_JOINTS = [-0.472227, -0.822888, 0.168771, -3.072064, 0.257852, 2.288583, 2.897726]  # t=235
PRESS_237_JOINTS = [-0.481484, -0.828616, 0.187117, -3.072124, 0.274752, 2.277920, 2.897724]  # t=237
PRESS_239_JOINTS = [-0.491147, -0.834668, 0.205489, -3.072152, 0.293112, 2.266816, 2.897720]  # t=239
PRESS_241_JOINTS = [-0.500994, -0.840864, 0.223908, -3.072133, 0.311396, 2.256022, 2.897725]  # t=241
PRESS_243_JOINTS = [-0.512636, -0.845930, 0.241910, -3.072110, 0.329305, 2.248939, 2.897723]  # t=243
PRESS_245_JOINTS = [-0.525696, -0.848992, 0.256630, -3.072083, 0.347407, 2.246176, 2.897721]  # t=245
PRESS_247_JOINTS = [-0.538929, -0.849567, 0.266215, -3.072043, 0.364221, 2.247812, 2.897722]  # t=247
PRESS_249_JOINTS = [-0.552080, -0.847370, 0.270245, -3.072021, 0.379861, 2.253709, 2.897723]  # t=249
PRESS_251_JOINTS = [-0.564992, -0.844771, 0.272821, -3.072051, 0.396610, 2.258971, 2.897722]  # t=251
PRESS_253_JOINTS = [-0.578336, -0.843611, 0.278814, -3.072118, 0.413074, 2.262751, 2.897720]  # t=253
PRESS_254_JOINTS = [-0.584899, -0.844260, 0.284011, -3.072149, 0.421739, 2.262539, 2.897717]  # t=254
PRESS_255_JOINTS = [-0.591134, -0.845778, 0.290314, -3.072167, 0.431014, 2.260355, 2.897711]  # t=255
PRESS_256_JOINTS = [-0.596734, -0.848593, 0.298534, -3.072198, 0.439909, 2.256301, 2.897705]  # t=256
PRESS_257_JOINTS = [-0.601945, -0.852347, 0.307952, -3.072229, 0.448796, 2.250719, 2.897705]  # t=257
PRESS_259_JOINTS = [-0.612122, -0.860748, 0.328018, -3.072247, 0.466237, 2.238546, 2.897709]  # t=259
PRESS_261_JOINTS = [-0.622576, -0.868055, 0.346300, -3.072242, 0.482808, 2.228829, 2.897703]  # t=261
PRESS_263_JOINTS = [-0.633298, -0.872633, 0.359649, -3.072233, 0.498375, 2.223451, 2.897686]  # t=263
PRESS_264_JOINTS = [-0.638699, -0.873634, 0.363899, -3.072211, 0.506119, 2.221999, 2.897676]  # t=264
PRESS_265_JOINTS = [-0.644130, -0.873602, 0.366608, -3.072209, 0.513916, 2.222174, 2.897659]  # t=265
PRESS_267_JOINTS = [-0.655181, -0.870441, 0.368508, -3.072207, 0.528844, 2.228212, 2.897631]  # t=267
PRESS_269_JOINTS = [-0.666141, -0.865021, 0.367993, -3.072218, 0.541318, 2.239101, 2.897619]  # t=269
PRESS_271_JOINTS = [-0.677369, -0.857863, 0.365590, -3.072226, 0.551796, 2.253687, 2.897613]  # t=271
PRESS_273_JOINTS = [-0.688683, -0.850211, 0.362480, -3.072209, 0.560867, 2.269177, 2.897630]  # t=273
PRESS_274_JOINTS = [-0.692954, -0.848772, 0.362172, -3.072219, 0.567141, 2.270321, 2.897639]  # t=274
PRESS_275_JOINTS = [-0.697065, -0.848591, 0.363554, -3.072251, 0.572810, 2.270198, 2.897636]  # t=275
PRESS_277_JOINTS = [-0.705347, -0.849815, 0.369245, -3.072276, 0.582577, 2.269183, 2.897632]  # t=277
PRESS_279_JOINTS = [-0.713143, -0.851957, 0.376035, -3.072293, 0.591318, 2.267258, 2.897626]  # t=279
PRESS_281_JOINTS = [-0.719778, -0.854189, 0.382117, -3.072299, 0.598639, 2.264979, 2.897621]  # t=281
PRESS_283_JOINTS = [-0.725665, -0.856573, 0.387647, -3.072288, 0.605007, 2.262095, 2.897622]  # t=283
PRESS_285_JOINTS = [-0.731830, -0.859282, 0.393620, -3.072274, 0.611383, 2.258835, 2.897620]  # t=285
PRESS_287_JOINTS = [-0.738518, -0.862702, 0.400883, -3.072265, 0.617985, 2.255042, 2.897622]  # t=287
PRESS_289_JOINTS = [-0.745594, -0.866769, 0.409294, -3.072261, 0.624818, 2.250795, 2.897626]  # t=289
PRESS_291_JOINTS = [-0.752678, -0.871073, 0.418000, -3.072256, 0.631543, 2.246430, 2.897631]  # t=291
PRESS_293_JOINTS = [-0.759489, -0.875572, 0.426776, -3.072253, 0.637817, 2.241998, 2.897652]  # t=293
PRESS_295_JOINTS = [-0.765602, -0.879538, 0.434359, -3.072258, 0.644154, 2.237623, 2.897644]  # t=295
PRESS_297_JOINTS = [-0.770386, -0.882153, 0.439298, -3.072268, 0.649571, 2.234335, 2.897646]  # t=297
PRESS_299_JOINTS = [-0.773921, -0.883716, 0.441851, -3.072287, 0.653590, 2.231986, 2.897650]  # t=299
APPROACH_000_JOINTS = [-0.028088, -1.038286, -0.016562, -2.246353, 0.012992, 1.483404, 0.726344]  # t=1

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

def move_to_control_panel():
    """Approach the appliance control region."""
    moveJoint(APPROACH_000_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_002_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_004_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_005_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_009_JOINTS, input_type='joint', steps=4, 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_020_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_025_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_027_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_030_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_033_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_035_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_036_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_040_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_041_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_045_JOINTS, input_type='joint', steps=4, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_050_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_052_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_055_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_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_080_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_085_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_087_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_090_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_095_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_100_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_105_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_110_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_112_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_115_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_117_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_120_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_122_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_125_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_130_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_135_JOINTS, input_type='joint', steps=5, settle_steps=0, gripper=1.000)
    moveJoint(APPROACH_137_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)

def press_control():
    """Execute the short interaction path that actuates the control."""
    moveJoint(PRESS_139_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_141_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_143_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_145_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_147_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_149_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_151_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_153_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_155_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_157_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_159_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_161_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_163_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_165_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_167_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_168_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_169_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_171_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_172_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_173_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_175_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_177_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_179_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_181_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_183_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_185_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_187_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_189_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_191_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_193_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_195_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_197_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_199_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_201_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_203_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_205_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_206_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_207_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_209_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_211_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_213_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_215_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_217_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_219_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_221_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_223_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_225_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_227_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_228_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_229_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_231_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_233_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_235_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_237_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_239_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_241_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_243_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_245_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_247_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_249_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_251_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_253_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_254_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_255_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_256_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_257_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_259_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_261_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_263_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_264_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_265_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_267_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_269_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_271_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_273_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_274_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_275_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_277_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_279_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_281_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_283_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_285_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_287_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_289_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_291_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_293_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_295_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_297_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=1.000)
    moveJoint(PRESS_299_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 off the center burner of the stove.


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

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

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

OBJ_POSE_T0 = pose(x=2.231571, y=-1.879330, z=1.154389, qw=0.755673, qx=0.019372, qy=-0.048939, qz=0.652830)
GOAL_RECEPTACLE_POSE = pose(x=2.232378, y=-1.879197, z=1.154787, qw=0.769049, qx=0.038234, qy=-0.025274, qz=0.637545)

APPROACH_003_JOINTS = [-0.005378, -1.061565, -0.011311, -2.267854, 0.062931, 1.489900, 0.668617]  # t=3
APPROACH_004_JOINTS = [-0.005427, -1.066685, -0.009907, -2.271790, 0.063962, 1.481886, 0.669407]  # t=4
APPROACH_006_JOINTS = [-0.005613, -1.085195, -0.006402, -2.294138, 0.066182, 1.468545, 0.671387]  # t=6
APPROACH_009_JOINTS = [-0.005797, -1.130642, 0.000392, -2.353743, 0.071727, 1.464822, 0.674037]  # t=9
APPROACH_012_JOINTS = [-0.004517, -1.187525, 0.024616, -2.432792, 0.084810, 1.476455, 0.684850]  # t=12
APPROACH_015_JOINTS = [-0.002014, -1.247269, 0.052854, -2.517869, 0.102109, 1.501544, 0.698741]  # t=15
APPROACH_016_JOINTS = [-0.001254, -1.265487, 0.058984, -2.544471, 0.106521, 1.512677, 0.701914]  # t=16
APPROACH_018_JOINTS = [-0.000115, -1.297791, 0.064828, -2.595451, 0.110237, 1.536430, 0.703693]  # t=18
APPROACH_020_JOINTS = [0.001393, -1.326516, 0.068025, -2.646759, 0.113063, 1.560264, 0.703263]  # t=20
APPROACH_021_JOINTS = [0.002342, -1.340278, 0.069561, -2.673130, 0.114578, 1.572321, 0.702922]  # t=21
APPROACH_024_JOINTS = [0.005798, -1.380000, 0.074357, -2.752209, 0.119581, 1.607112, 0.702050]  # t=24
APPROACH_027_JOINTS = [0.009959, -1.416724, 0.079599, -2.828349, 0.125237, 1.640844, 0.701291]  # t=27
APPROACH_028_JOINTS = [0.011525, -1.428860, 0.081397, -2.852276, 0.127211, 1.652314, 0.700656]  # t=28
APPROACH_030_JOINTS = [0.014888, -1.452556, 0.084838, -2.897394, 0.131205, 1.675157, 0.698485]  # t=30
APPROACH_033_JOINTS = [0.019877, -1.480407, 0.089383, -2.956769, 0.136828, 1.716987, 0.694252]  # t=33
APPROACH_036_JOINTS = [0.024534, -1.491482, 0.093499, -3.008732, 0.142528, 1.772600, 0.688014]  # t=36
APPROACH_039_JOINTS = [0.028837, -1.486933, 0.097050, -3.052530, 0.148059, 1.835169, 0.681156]  # t=39
APPROACH_041_JOINTS = [0.032042, -1.475871, 0.100071, -3.073126, 0.153180, 1.877019, 0.677249]  # t=41
APPROACH_042_JOINTS = [0.033591, -1.464096, 0.102480, -3.072288, 0.156024, 1.893506, 0.676527]  # t=42
APPROACH_045_JOINTS = [0.038370, -1.421366, 0.114189, -3.059297, 0.164665, 1.927777, 0.686216]  # t=45
APPROACH_046_JOINTS = [0.040086, -1.406285, 0.118684, -3.054734, 0.167907, 1.939862, 0.689561]  # t=46
APPROACH_048_JOINTS = [0.044371, -1.374769, 0.129125, -3.048160, 0.177203, 1.968805, 0.694160]  # t=48
APPROACH_051_JOINTS = [0.051601, -1.326595, 0.147649, -3.037799, 0.193298, 2.008814, 0.702268]  # t=51
APPROACH_054_JOINTS = [0.055035, -1.280849, 0.160175, -3.035009, 0.200047, 2.054324, 0.707227]  # t=54
APPROACH_055_JOINTS = [0.055115, -1.270689, 0.162343, -3.034922, 0.200028, 2.066910, 0.712906]  # t=55
PRESS_056_JOINTS = [0.055093, -1.268033, 0.165321, -3.034465, 0.199760, 2.070953, 0.726565]  # t=56
PRESS_057_JOINTS = [0.055374, -1.268057, 0.168870, -3.036507, 0.200098, 2.078986, 0.738695]  # t=57
PRESS_059_JOINTS = [0.057153, -1.275793, 0.177886, -3.047407, 0.202092, 2.105450, 0.763119]  # t=59
PRESS_061_JOINTS = [0.060587, -1.291025, 0.189086, -3.065030, 0.204938, 2.141974, 0.788123]  # t=61
PRESS_062_JOINTS = [0.062802, -1.298743, 0.195409, -3.073214, 0.207093, 2.158341, 0.801342]  # t=62
PRESS_063_JOINTS = [0.063101, -1.296759, 0.200863, -3.072374, 0.208200, 2.160545, 0.812684]  # t=63
PRESS_065_JOINTS = [0.060862, -1.292363, 0.209638, -3.071100, 0.207956, 2.164778, 0.830128]  # t=65
PRESS_067_JOINTS = [0.058120, -1.291260, 0.218178, -3.071274, 0.209500, 2.168830, 0.843641]  # t=67
PRESS_069_JOINTS = [0.054745, -1.291475, 0.225757, -3.071908, 0.211840, 2.172660, 0.854072]  # t=69
PRESS_071_JOINTS = [0.050916, -1.291464, 0.233412, -3.071845, 0.215094, 2.175048, 0.862718]  # t=71
PRESS_072_JOINTS = [0.049088, -1.293388, 0.236456, -3.071920, 0.216712, 2.174174, 0.864519]  # t=72
PRESS_073_JOINTS = [0.047536, -1.298554, 0.238715, -3.071959, 0.217578, 2.171017, 0.865031]  # t=73
PRESS_074_JOINTS = [0.046690, -1.308619, 0.240682, -3.071870, 0.217709, 2.168323, 0.865254]  # t=74
PRESS_075_JOINTS = [0.046750, -1.323205, 0.242321, -3.071955, 0.217469, 2.168492, 0.866221]  # t=75
PRESS_077_JOINTS = [0.049139, -1.360880, 0.243222, -3.071955, 0.215021, 2.171323, 0.869974]  # t=77
RETREAT_078_JOINTS = [0.051797, -1.384840, 0.242053, -3.071747, 0.212312, 2.172247, 0.870882]  # t=78
RETREAT_079_JOINTS = [0.055368, -1.412599, 0.239682, -3.070604, 0.208310, 2.171745, 0.869818]  # t=79
RETREAT_080_JOINTS = [0.059574, -1.442870, 0.236546, -3.069964, 0.203799, 2.169734, 0.868118]  # t=80
RETREAT_081_JOINTS = [0.064300, -1.473984, 0.233412, -3.071127, 0.199695, 2.168126, 0.866175]  # t=81
RETREAT_082_JOINTS = [0.069229, -1.503845, 0.230711, -3.072198, 0.196277, 2.166831, 0.864233]  # t=82
RETREAT_083_JOINTS = [0.073733, -1.529919, 0.228446, -3.071989, 0.193122, 2.165226, 0.862717]  # t=83
RETREAT_084_JOINTS = [0.077796, -1.552208, 0.226163, -3.071922, 0.190414, 2.163238, 0.860816]  # t=84
RETREAT_085_JOINTS = [0.081523, -1.571998, 0.223483, -3.071875, 0.188034, 2.157008, 0.858531]  # t=85
RETREAT_086_JOINTS = [0.085033, -1.589937, 0.220525, -3.071857, 0.186156, 2.144833, 0.856310]  # t=86
RETREAT_087_JOINTS = [0.088447, -1.607252, 0.217274, -3.071463, 0.184682, 2.128392, 0.853635]  # t=87
RETREAT_088_JOINTS = [0.091839, -1.625324, 0.213832, -3.070562, 0.183392, 2.108788, 0.850558]  # t=88
RETREAT_089_JOINTS = [0.095097, -1.643917, 0.210513, -3.069500, 0.182277, 2.088262, 0.847575]  # t=89
RETREAT_090_JOINTS = [0.098108, -1.662533, 0.207435, -3.068453, 0.181297, 2.067511, 0.844968]  # t=90
RETREAT_091_JOINTS = [0.100861, -1.680521, 0.204668, -3.067757, 0.180713, 2.047551, 0.842496]  # t=91
RETREAT_092_JOINTS = [0.103365, -1.698093, 0.202045, -3.066816, 0.180351, 2.026335, 0.840103]  # t=92
RETREAT_093_JOINTS = [0.105585, -1.715470, 0.199513, -3.065108, 0.180032, 2.003681, 0.838002]  # t=93
APPROACH_000_JOINTS = [-0.005308, -1.059120, -0.012926, -2.267104, 0.061406, 1.498196, 0.667923]  # t=1

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

def move_to_control_panel():
    """Approach the appliance control region."""
    moveJoint(APPROACH_000_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_003_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_004_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_006_JOINTS, input_type='joint', steps=2, 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_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_018_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_020_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_021_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_024_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_027_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_028_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_030_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_033_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_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_041_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_042_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_045_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_046_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_048_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_051_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_054_JOINTS, input_type='joint', steps=3, settle_steps=0, gripper=-1.000)
    moveJoint(APPROACH_055_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)

def press_control():
    """Execute the short interaction path that actuates the control."""
    moveJoint(PRESS_056_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_057_JOINTS, input_type='joint', steps=1, 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_062_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_063_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_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_069_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_071_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)
    moveJoint(PRESS_072_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    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_077_JOINTS, input_type='joint', steps=2, settle_steps=0, gripper=-1.000)

def retreat_after_press():
    """Retreat away after the button press interaction."""
    moveJoint(RETREAT_078_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_079_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_080_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_081_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_082_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_083_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_084_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_085_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_086_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_087_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_088_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_089_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_090_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_091_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_092_JOINTS, input_type='joint', steps=1, settle_steps=0, gripper=-1.000)
    moveJoint(RETREAT_093_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

Turn on the blender by pressing the power button.