|
1. Have you tested the code you posted? From reading it quickly it looks as if it would always cause your robot to go full reverse. Thanks to the integer math (p1_wheel/255) will always be 0.
2. The ((2000 + p1_y + p1_x - 127) Min 2000 Max 2254)-2000 will do this for you. If you push the joystick straight to the left/right you will turn on a dime. If you push it to the corners, you will turn while still going forward. Stuff in between will give similar results. Try dropping it in RoboEmu and take a look at the motor outputs as you move the "joystick" around.
3. Take a look at InnovationFirst's digital filter whitepaper. I believe it accomplishes exacltly what you are looking for.
--Rob
|