View Full Version : 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
TheNightviz
30-01-2014, 23:10
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?
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?
TheNightviz
30-01-2014, 23:30
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.
buildmaster5000
30-01-2014, 23:59
Perhaps you could have a boolean flag that controls whether to reverse some input values. Simple, effective...PERFECT
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.
Alpha Beta
31-01-2014, 00:47
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.
For anyone searching this thread later looking for a labview solution...
http://lswhs.leesummit.k12.mo.us/ambailey/Pictures/Reversing%20Drive%20Controls%20on%20a%20toggle.png
Alan Anderson
31-01-2014, 01:09
For anyone searching this thread later looking for a labview solution...
http://lswhs.leesummit.k12.mo.us/ambailey/Pictures/Reversing%20Drive%20Controls%20on%20a%20toggle.png
I generally advise against having a toggle function for a driver input. Unless you put some kind of obvious indicator on the robot itself, knowing which side is the front isn't always easy before you start driving. It can cause problems if the robot moves in the direction opposite the driver's intent.
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.
notmattlythgoe
31-01-2014, 14:20
I generally advise against having a toggle function for a driver input. Unless you put some kind of obvious indicator on the robot itself, knowing which side is the front isn't always easy before you start driving. It can cause problems if the robot moves in the direction opposite the driver's intent.
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.
I agree with this. Having user feedback so they driver/operator knows what state everything is in without having to remember it themselves is always the best option.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.