|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Reversing Drive Controls
I've been looking into a way to press a button and have the Y axis for the driving controls reverse, that way when we turn around to pick up the ball in reverse, we can easily use inverted controls.
If anyone knows a good way to do this, I'd love to hear it. I don't think RobotDrive->SetInvertedMotor() does what I think it does... Thanks, --Reed |
|
#2
|
||||
|
||||
|
Re: Reversing Drive Controls
While I haven't messed around with it myself, you might want to look into having your robot's front based on the field possession instead of the a button. To accomplish this you could base the front based on which way the robot is turned, which would only require a gyro. However if you want to stick with a button switch there shouldn't be any reason you cannot code another version of your drive controls with the values reversed in a way that powers everything backwards, and then assigning that command to as you said the Y button. Which language are your programming in?
|
|
#3
|
||||
|
||||
|
Re: Reversing Drive Controls
We're programming in C++, and we're driving with new RobotDrive(Talon*, Talon*) and splitting the motor controllers for dual output. We'd have to set up a different driving system, huh?
|
|
#4
|
||||
|
||||
|
Re: Reversing Drive Controls
Thinking about it I'm sure there are many different ways to accomplish this. If you are looking for something somewhat simple though that's what would come to mind for me. However I am more used to Java for FRC so I could be way off basis on this translating to C++. If I'm thinking about it right though all you would have to do is take a negative value, or positive depending on what drives the robot "forward", and have a copy of your drive method/command that uses the opposite joystick value. With your dual output for the Talons I believe this should work rather well, and it would be easy to map to a on/off button.
|
|
#5
|
|||
|
|||
|
Re: Reversing Drive Controls
Perhaps you could have a boolean flag that controls whether to reverse some input values. Simple, effective...PERFECT
|
|
#6
|
||||
|
||||
|
Re: Reversing Drive Controls
It's actually quite simple. Add a case if the button is pressed, and multiply your joystick inputs by -1. This will reverse what is coming from the joystick.
|
|
#7
|
||||
|
||||
|
Re: Reversing Drive Controls
Quote:
![]() |
|
#8
|
|||||
|
|||||
|
Re: Reversing Drive Controls
Quote:
I would suggest instead using a pair of controller buttons, one to select "forward" and the other to select "backward" driving. That way the driver can always select the one he wants, and won't have to do a tentative drive maneuver before possible toggling to the other orientation. |
|
#9
|
|||||
|
|||||
|
Re: Reversing Drive Controls
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|