language grl 0.1
module W2DataTargetToolFrame
  persistent tool gripper = tool {
    tcp: pose(0 mm, 0 mm, 100 mm, 0 deg, 0 deg, 0 deg),
    mass: 1.25 kg,
    cog: [0 mm, 0 mm, 40 mm]
  }
  persistent frame fixture = frame { origin: pose(800 mm, 0 mm, 0 mm, 0 deg, 0 deg, 0 deg) }
  const bool use_fixture = true
  const int slot_count = 2
  const real blend_scale = 1.5
  const string recipe = "w2"
  const time settle = 250 ms
  const length lift = 80 mm
  const angle face = 90 deg
  const percent safe_percent = 40 %
  const speed vj = joint(safe_percent)
  const speed vl = linear(120 mm/s)
  const zone z5 = z(5 mm)
  const pose safe_pose = pose(500 mm, 0 mm, 100 mm, 0 deg, 0 deg, face)
  target home = joint_target { joints: [0 deg, 0 deg, 0 deg, 0 deg, 0 deg, 0 deg] }
  target approach = joint_target {
    joints: [0 deg, -22.918312 deg, 28.647890 deg, 0 deg, 11.459156 deg, 0 deg]
  }
  target pick = pose_target {
    pose: pose(500 mm, 0 mm, 0 mm, 0 deg, 0 deg, 90 deg),
    config: robot_config(0, 0, 1),
    tool: gripper,
    frame: fixture
  }
  target pick_q = pose_target {
    pose: poseq(500 mm, 30 mm, 0 mm, 0, 0, 0, 1),
    tool: gripper,
    frame: fixture
  }
  proc main()
    set_tool gripper
    set_frame fixture
    set_speed vl
    set_zone z5
    movej home speed vj zone fine
    movej approach speed vj zone z5 tool gripper frame fixture
    movel pick_q speed vl zone z5 tool gripper frame fixture
  end
end
