home *** CD-ROM | disk | FTP | other *** search
/ Between Heaven & Hell 2 / BetweenHeavenHell.cdr / 500 / 471 / rccl230 < prev    next >
Text File  |  1987-03-02  |  1KB  |  71 lines

  1. #include "../h/rccl.h"
  2. #include "../h/umac.h"
  3. #include "../h/hand.h"
  4.  
  5. int turns;
  6.  
  7. pumatask()
  8. {
  9.     TRSF_PTR z, e, shaft, handle, apro, grasp, rotpx, rotnx;
  10.     POS_PTR  get, away;
  11.     POS_PTR turn;
  12.     int pxfn(), nxfn();
  13.     int q;
  14.  
  15.     rotpx = newtrans("ROTPX", pxfn);
  16.     rotnx = newtrans("ROTNX", nxfn);
  17.     z = gentr_trsl("Z",  0.,  0., 864.);
  18.     e = gentr_trsl("E" , 0. , 0. , 170.);
  19.     shaft = gentr_trsl("SHAFT", -200., 500., 600.);
  20.     shaft->fn = varb;
  21.     handle = gentr_trsl("HANDLE", 0., 0., 50.);
  22.     apro = gentr_trsl("APRO", -50., 0., 0.);
  23.     grasp = gentr_rpy("GRASP", 0., 0., 0., 0., 190., 0.);
  24.  
  25.     get = makeposition(
  26.     "GET", z, t6, e, EQ, shaft, handle, grasp, TL, e);
  27.  
  28.     away = makeposition(
  29.     "AWAY", z, t6, e, EQ, shaft, handle, grasp, apro, TL, e);
  30.  
  31.     turn = makeposition(
  32.     "TURN", z, t6, e, EQ, shaft, rotpx, handle, rotnx, grasp, TL, rotnx);
  33.  
  34.     setvel(300, 300);
  35.     move(away);
  36.     OPEN;
  37.     if (!teach(shaft, get)) {
  38.         move(away);
  39.         move(park);
  40.         return;
  41.     }
  42.     shaft->fn = const;
  43.     optimize(turn);
  44.     turns = 4;
  45.     waitfor(completed);
  46.     CLOSE;
  47.     comply("fx fz ", 0., 0.);
  48.         movecart(turn, 200, 4000 * turns);
  49.     lock("fx fz ");
  50.     move(get);
  51.     waitfor(turn->end);
  52.     OPEN;
  53.     distance("dx", -30.);
  54.         move(get);
  55.     setvel(200, 50);
  56.     setmod('j');
  57.     move(park);
  58. }
  59.  
  60. pxfn(t)
  61. TRSF_PTR t;
  62. {
  63.     Rot(t, xunit, goalpos->scal * 360 * turns);
  64. }
  65.  
  66. nxfn(t)
  67. TRSF_PTR t;
  68. {
  69.     Rot(t, xunit, - goalpos->scal * 360 * turns);
  70. }
  71.