# Paths are resolved relative to the code/ directory by legacy entry points.
master_urdf: "config/master_7dof.urdf"
slave_urdf: "config/real_slave_7dof.urdf"

m_base_frame: master_base
m_shoulder_frame: master_shoulder
m_elbow_frame: master_forearm
m_wrist_frame: master_wrist
m_ee_frame: master_ee
s_base_frame: PELVIS_S
s_shoulder_frame: R_SHOULDER_R_S
s_elbow_frame: R_ELBOW_R_S
s_wrist_frame: R_WRIST_R_S
# The physical URDF has no calibrated TCP/FT frame yet.  R_WRIST_R_S is the
# chain-end frame; the new simulator adds a documented R_EE_SIM frame at run
# time.  Replace it with the measured TCP before hardware experiments.
s_ee_frame: R_WRIST_R_S

master_joint_names: [
  "master_shoulder_pitch_joint",
  "master_shoulder_yaw_joint",
  "master_shoulder_roll_joint",
  "master_elbow_flex_joint",
  "master_wrist_roll_joint",
  "master_wrist_yaw_joint",
  "master_wrist_pitch_joint",
]

sew_mapper:
  slave_joint_names: [
    "R_SHOULDER_P",
    "R_SHOULDER_R",
    "R_SHOULDER_Y",
    "R_ELBOW_R",
    "R_WRIST_P",
    "R_WRIST_Y",
    "R_WRIST_R",
  ]
  shoulder_axis_order: "yxy"
  shoulder_signs: [-1.0, 1.0, -1.0]
  wrist_axis_order: "yzx"
  wrist_signs: [-1.0, 1.0, 1.0]
  elbow_axis_local: [1.0, 0.0, 0.0]
  up_dir: [0, 0, 1.0]
  eps_clip: 0.001
  fd_eps: 0.0001

interaction_est:
  lambda_damp: 0.001

haptic_render:
  feedback_strength: 1.2
  E_init: 1.0
  E_max: 8.0
  alpha_floor: 0.0
  alpha_ceil: 1.0
  E0: 1.0

simulation:
  dt: 0.002
  duration: 4.0
  mapping_hz: 50.0
  seed: 7
  # Independent forward/return channels.  G0c may override these with a
  # frozen trace; the defaults reproduce the former fixed-return-delay case.
  forward_delay_s: 0.0
  feedback_delay_s: 0.080
  forward_jitter_s: 0.0
  return_jitter_s: 0.0
  forward_packet_loss: 0.0
  return_packet_loss: 0.0
  forward_timeout_s: 0.20
  return_timeout_s: 0.20
  # A small smooth 3-cycle contact probe exposes delayed-channel activity
  # without causing joint, torque, or position-limit events.
  contact_probe_fraction: 0.03
  contact_probe_cycles: 3.0
  slave_tcp_frame: R_EE_SIM
  slave_tcp_offset: [-0.01212, -0.17655, 0.07506]
  wall_fraction: 0.55
  wall_stiffness: 800.0
  wall_damping: 45.0
  wall_force_limit: 80.0
  wall_transition_depth: 0.0001
  master_kp: [196.0, 196.0, 144.0, 256.0, 100.0, 100.0, 81.0]
  master_kd: [28.0, 28.0, 24.0, 32.0, 20.0, 20.0, 18.0]
  slave_kp: [900.0, 900.0, 676.0, 1156.0, 400.0, 324.0, 324.0]
  slave_kd: [54.0, 54.0, 46.8, 61.2, 36.0, 32.4, 32.4]
  master_acceleration_limits: [100.0, 100.0, 120.0, 120.0, 160.0, 160.0, 160.0]
  slave_acceleration_limits: [120.0, 120.0, 150.0, 150.0, 180.0, 180.0, 180.0]
  master_tracking_effort_fraction: 0.65
  slave_tracking_effort_fraction: 0.70
  velocity_limit_fraction: 0.80
  soft_limit_buffer: 0.12
  feedback_strength: 0.50
  haptic_filter_alpha: 0.222
  haptic_torque_limits: [6.0, 6.0, 4.0, 3.0, 1.0, 1.0, 1.0]
  haptic_rate_limits: [150.0, 150.0, 100.0, 80.0, 30.0, 30.0, 30.0]
  energy_min: 0.050
  energy_max: 0.055
  energy_initial: 0.050
  sensor_noise_std: 0.001
  # G0c numerical scaling only.  Replace with a calibration-selected value
  # before locked hardware experiments.
  wrench_characteristic_length_m: 0.30
  wrench_scaled_damping: 0.001
  sensor_bias: [0.080, -0.050, 0.035, -0.025, 0.015, -0.010, 0.020]
  bias_calibration_samples: 200
  joint_limit_margin: 0.00001
  differential_step: 0.0001
