View Single Post
  #2   Spotlight this post!  
Unread 16-03-2009, 23:28
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: joystick comparison within percentage

In previous years, we did "arcade style" control in the code, even when the drivers used "tank style" input. The speed value was computed from the sum of the two joysticks, and the turn value was the difference. We applied a deadband function to the turn value, which does pretty much what you're asking for. A simple deadband is done like this: if the value is within a certain distance of zero, set it to zero.

(To turn arcade drive values back into tank drive values, the left motor is controlled by the speed plus the turn, and the right motor is controlled by the speed minus the turn.)
Reply With Quote