language grl 0.1
module W2ExpressionMath
  const real blend_base = 5 + 5
  const real trig_value = sin(30 deg)
  const bool math_ok = (10 mm + 5 mm) > 12 mm and not false
  const speed v_pick = linear(100 + 50 mm/s)
  const speed v_safe = linear(max(50 mm/s, 200 mm/s / 2))
  const zone z_app = z(clamp(blend_base mm, 1 mm, 50 mm))
  target home = joint_target {
    joints: [0 deg, (10 + 5) deg, -30 deg, 0 deg, abs(-15) deg, round(pi) deg]
  }
  target pick = pose_target {
    pose: pose(400 + 50 mm, 20 * 2 mm, sqrt(90000) mm, 0 deg, 0 deg, atan2(1, 1))
  }
  proc main()
    movej home speed v_safe zone z_app
    movel pick speed v_pick zone z_app
    wait io.ai[2] > 0.5 timeout 1 + 1 s
  end
end
