Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Reversing Drive Controls (http://www.chiefdelphi.com/forums/showthread.php?t=125530)

Reed501 30-01-2014 23:00

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

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?

Reed501 30-01-2014 23:25

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?

TheNightviz 30-01-2014 23:30

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.

buildmaster5000 30-01-2014 23:59

Re: Reversing Drive Controls
 
Perhaps you could have a boolean flag that controls whether to reverse some input values. Simple, effective...PERFECT

Cecil 31-01-2014 00:15

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.

Alpha Beta 31-01-2014 00:47

Re: Reversing Drive Controls
 
Quote:

Originally Posted by Cecil (Post 1335205)
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...


Alan Anderson 31-01-2014 01:09

Re: Reversing Drive Controls
 
Quote:

Originally Posted by Alpha Beta (Post 1335213)
For anyone searching this thread later looking for a labview solution...


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

Re: Reversing Drive Controls
 
Quote:

Originally Posted by Alan Anderson (Post 1335221)
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.


All times are GMT -5. The time now is 18:37.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi