Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tank Drive Cheesy Joysticks swapped? #56

Open
niharmitra opened this issue Jan 16, 2016 · 5 comments
Open

Tank Drive Cheesy Joysticks swapped? #56

niharmitra opened this issue Jan 16, 2016 · 5 comments
Labels

Comments

@niharmitra
Copy link

It appears according to the documentation, the first joystick is the throttle and the second is the wheel. But from my team's testing it was the other way around?

@rhauch
Copy link
Member

rhauch commented Jan 18, 2016

Is this the method in TankDrive to which you're referring?

/**
 * Provide "cheesy drive" steering using a steering wheel and throttle. This function lets you directly provide joystick
 * values from any source.
 *
 * @param throttle the value of the throttle; must be -1 to 1, inclusive
 * @param wheel the value of the steering wheel; must be -1 to 1, inclusive Negative values turn right; positive values turn
 *        left.
 * @param isQuickTurn true if the quick-turn button is pressed
 * @see <a href="https://github.com/Team254/FRC-2014/blob/master/src/com/team254/frc2014/CheesyDriveHelper.java">Team 254
 *      Cheesy Drive logic</a>
 */
public void cheesy(double throttle, double wheel, boolean isQuickTurn) {
    ...
}

Note that this was derived from Team 254's CheesyDriveHelper, and our method's logic and even parameter order seems to follow that of Team 254's.

Can you double check that you've not made a mistake elsewhere in your code?

@EricLiu2000
Copy link

Yes that is the method. I just double checked, and it does seem that passing it the wheel then throttle works. We can post our usage of the code if you would like.

@rhauch
Copy link
Member

rhauch commented Jan 20, 2016

@EricLiu2000: I've looked at the code again in more depth, and I'm surprised to hear that the inputs are indeed switched. The existing logic just won't work if the throttle and wheel variables are semantically switched. I've also verified that Team 254's 2015 code is nearly identical to the 2014 code mentioned previously and very similar to our code.

That suggests to me that there is still a problem elsewhere in the code (including Strongback) or in the mapping between the physical devices and the software components on your robot. If you post your code, we'll go through it to see if we can find anything and (if time allows) test it on one of our team's robots. However, I'd ask that you double-check the physical mapping as well. If you're using two separate devices, double check that the port numbers in the code match the physical devices. Or, if you're using a single device, make sure that you're using the correct joystick implementation for your hardware device -- different joysticks are notorious for having different mappings between the buttons/controls and axes.

@niharmitra
Copy link
Author

https://github.com/team8/jFreyja/tree/strongback is the code we were running. We double checked the physical mapping in the driver station software, our joysticks were mapped to the ports we expected. Note that our code currently compensates for the swap.

@rhauch rhauch added this to the 2.0.0 Beta milestone Oct 28, 2016
@rhauch rhauch added the bug label Dec 19, 2016
@rhauch
Copy link
Member

rhauch commented Jan 15, 2017

@niharmitra Okay, I've looked at the code again and I'm still not convinced the behavior is as you describe. If you look closely at the logic, you'll see that the throttle and wheel components are indeed used correctly. I've also compared the logic to that from Team 254's code from 2014 and 2016, and our logic is identical to theirs.

Are you sure that you didn't accidentally reverse the inputs? That is by far the most likely cause.

@rhauch rhauch removed this from the 2017.1.0 milestone Jan 15, 2017
CarlinWilliamson added a commit to Team3132/strongback-java that referenced this issue Jun 30, 2020
added maybewaitfor and logged time it took to apply state
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants