|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||||
|
||||||
|
Re: Coasting Problems
Quote:
Imagine the following scenario Code:
joystick output 1 1 0.75 0.75 0.5 0.5 0.3 0.3 0.26 0.26 0.25 0.25 0.1 0.25 0.0 0.25 Last edited by Joe Ross : 17-09-2013 at 16:14. |
|
#2
|
|||
|
|||
|
Re: Coasting Problems
Thank you for your help! I added to the code so the values are zeroed. I'm amazed that I missed that earlier.
|
|
#3
|
||||
|
||||
|
Re: Coasting Problems
Just for future reference, my favourite deadzone code looks something like this:
Code:
float deadZ (float val) {
return val > 0.6 || val < -0.6? val: 0;
}
To me this is the most aesthetically pleasing. But to each his own :P One thing I noticed that would also make it look better (my apologies, I'm really picky about these things) would be to assign 'Hardware.leftJoystick.getRawButton(1)' to a boolean somewhere in the beginning of your code so that you don't have to type that mess every time you need to check it. You could also make a similar method to the one above that takes your boolean as an input as well as a joystick value and clean up the code even more (there's currently a lot of code involved in just getting it to drive). Just my $0.02 :P Take it with a grain of salt |
|
#4
|
|||
|
|||
|
Re: Coasting Problems
Thanks, I will definitely give those a try.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|