Quote:
Originally Posted by Mubtasim
We are trying to make it so that when the joystick signals to seed up, there has to be several milliseconds delays in order to gradually increase the speed. Is there any simple way to do this?
|
Yes.
Code:
change = joystick - limitedJoystick;
if (change>limit) change = limit;
else (if change<-limit) change = -limit;
limitedJoystick += change;
limit is the amount of change you will allow every iteration (e.g. every 20 milliseconds for TeleOp)
limitedJoystick is the rate-limited joystick value you use to control your motors.
Here's an article which might be of interest:
http://thinktank.wpi.edu/article/140