Project

General

Profile

Revision 1075

Added by Bradley Yoo over 10 years ago

speed now takes negative values

View differences:

motion.c
24 24
	short speed1 = r->shared->motor1;
25 25
	short speed2 = r->shared->motor2;
26 26
	float theta = r->pose.theta;
27

  
27
	
28 28
	if (theta < 0 || theta > 2*M_PI) return 1;
29
	if (speed1 < 0 || speed1 > 255) return 1;
30
	if (speed2 < 0 || speed2 > 255) return 1;
29
	if (speed1 < -255 || speed1 > 255) return 1;
30
	if (speed2 < -255 || speed2 > 255) return 1;
31 31

  
32 32
	/* if speed is lower than the cut off, don't move */
33 33
	if (abs(speed1) < CUTOFF) {

Also available in: Unified diff