language grl 0.1
module W2ExceptionAlarm
  const speed v = joint(30 %)
  const zone zf = fine
  target home = joint_target { joints: [0 deg, 0 deg, 0 deg, 0 deg, 0 deg, 0 deg] }
  trap recover_trap()
    raise E_STOP
  end
  task background cycle 20 ms
    alarm TASK_MONITOR "task boundary"
  end
  proc main()
    alarm START "start" severity info
    try
      movej home speed v zone zf
      raise E_PICK_FAILED
    catch E_PICK_FAILED
      alarm RECOVER "recovering" severity warning
    finally
      alarm CLEANUP "cleanup"
    end
    enable interrupt guard
    disable interrupt guard
  end
end
