#include "../h/rccl.h"
#include "../h/rtc.h"

extern struct how how;
extern struct chg chg;

int sensor;

pumatask()
{
	TRSF_PTR z, e, b, ab, un;
	POS_PTR  p1, p2, p3;
	int touchfn();
	int q;

	e = trsl(newtrans("E", const), 0., 0., 170.);
	z = gentr_trsl("Z",  0.,  0., 864.);
	ab = gentr_trsl("AB", 0. , 0., -500.);
	un = gentr_trsl("AB", 0. , 0., -50.);
	b = gentr_rot("B1", 300. , 600., 500., yunit, 180.);
	b->fn = varb;


	p1 = makeposition("P1", z, t6, e, EQ, b, ab, TL, e);
	p2 = makeposition("P2", z, t6, e, EQ ,b, TL, e);
	p3 = makeposition("P3", z, t6, e, EQ, b, un, TL, e);

	sensor = adcopen(7);

	setvel(700, 700);
	setmod('c');
	move(p1);
	evalfn(touchfn);
	update(b, p2);
	movecart(p2, 0, 5000);
	move(p2);
	stop(500);
	move(p3);
	move(park);
}


touchfn()
{
	nextmove = goalpos->scal > .2;
}
