language grl 0.1
module W2RuntimeTimeout
  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] }
  proc on_timeout_recover()
    alarm TIMEOUT_RECOVER "timeout recover" severity warning
  end
  proc main()
    wait io.di[99] == true timeout 100 ms on_timeout alarm "DI99 timeout"
    wait io.di[98] == true timeout 100 ms on_timeout call on_timeout_recover()
    movej home speed v zone zf
  end
end
