robotc - turning radius is inaccurate of the robot is inaccuarate -


#pragma config(standardmodel, "rvw squarebot")  task main(){ int begindistance = sensorvalue[sonarsensor]; while (sensorvalue[gyro] < 900){  motor[leftmotor] = 20; motor[rightmotor] = -20; } motor[leftmotor] = 0; motor[rightmotor] = 0;  sensorvalue[leftencoder] = 0; sensorvalue[rightencoder] = 0;  while (sensorvalue[sonarsensor] > 25){ motor[leftmotor] = 50; motor[rightmotor] =50; }  sensorvalue[gyro] = 0;  int z = 180 - atan(begindistance/sensorvalue[leftencoder]); while (sensorvalue[gyro] > -z){ motor[leftmotor]  = -31; motor[rightmotor]  = 31; } motor[leftmotor] = 0; motor[rightmotor] = 0; } 

by way begin distance 178, dont know why robot on turning, little bit, dont know why. im using squarebot. using robocci program. , using peg begin distance.

the gyro sensor not start @ 0. need store initial value variable, , find difference between value read , initial value.

the gyrosensor read-only, statement

sensorvalue[gyro] = 0; 

won't work.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -