Use of gamepads in replacement of buttonboards

My team has been considering the use of gamepads(ps4, xbox, ftc, etc) and was wondering if any team has done this previously and if so, what programming language they used with the gamepads and if there was any lag while using the gamepads. My team is using logitech gamepad f310 and c++.

For our driving, we currently use an RC controller for driving, and a logitech gamepad for co pilot. We run this using Java and we have not had any issues with the gamepad what so ever.

2168 has used the F310 for at least the last 3 years, possibly longer, can’t remember. It’s been a while. We’ve always used Java.

Do a search for F310 on the forums here, you’ll find lots of teams using them.

There’s no perceivable difference in “lag” using these vs any other option. All IO into the robot has to go through the driver station and you’re limited there to a maximum update frequency of 20Hz? if I remember correctly. They’re just as reliable as the KOP Joysticks. Just make sure your drive team doesn’t abuse the USB cables. Theat’s the only problem we’ve had with them over the years. When the cables get wrapped around the controllers too tightly, there’s no strain relief and over time the USB cables become frayed. We buy new ones each competition season because of this.

We have also used an arcade style joystick (something like this)
And played around with the wired Xbox 360 controllers a few years back - the deadband on the joysticks was not acceptable for our use.

We used the gamepads (F310 or something similar) with LabVIEW in 2013. We didn’t have any lag as compared with the joysticks or other controllers.

If you experience lag, you’ll likely encounter the same problem with any control system because the issue probably stems from your connection with the robot. Check your settings on the robot and on your laptop to make sure they are all correct. Sometimes it will take a reset of the cRIO and/or your laptop to fix that one problem you may never be able to figure out because upon compiling or other transfer of data an error occurred. Redeploy the code too as well, and make sure you’re saving at regular intervals so you always have a backup copy of code that does work, at least somewhat.

We’ve used F310s for 2 seasons and 3 offseasons now. We’re very happy with them.

Do the Logitech F310’s work on plug-in, or do we need to code up something that maps them from a 16 bit signed integer to a 32 bit real ranging ±1.0 (or even more manipulations) ? And from one set of “axis” definitions to what the WhoPpIe code expects?
Using the standard LabView joystick read, we see the integer range (on some funny axis assignments). So far, we’ve been too distracted to try the simple, plug in the F310 and see what happens (What does this button do :slight_smile:

My team has used xbox controllers for as long as I’ve been on the team. As a previous poster noted, the deadzone is rather large. That hasn’t been a big issue for us; just remember to account for it in code. The triggers do weird stuff, and we haven’t been able to implement them. Otherwise, we just wrote a class called xBoxControllerMap which has a list of ints named for the buttons on the controller so we only had to figure out what does what once.

Unfortunately I can’t tell you the exact gamepads we use, but one is Logitech and the other is a Cyborg.

Our programmers code in Java

And as a driver for two seasons (as well as a lot of offseason events and demos) I haven’t noticed any lag between the controller and robot.

Hope it works out well for you :slight_smile:

Here is our XBoxControllerMap class for Java. We use another custom class called DPadButton to turn the accessible directions of the d-pad into buttons that can trigger commands. The implementation should be relatively easy to get the gist of from a C++ point of view.

Our team has been using gamepads for as long as I have been on the team. I have seen them programmed in java, c++, and labveiw with no lag issues. We even used a custom arduino controller last year either no lag. If there is lag it is usually something else code wise.

You can program in a deadband to encompass the inaccuracies (over-accuracies, I guess, if that is a thing). We use wired Xbox controllers, and we have to do the same.
Just last week we were diagnosing a wonky motor-controller on our kit bot. After immediately blaming the software team (it is always software’s fault! :P) and then checking all the wiring, including replacing the motor-controller, we determined that that it was, in fact, a deadband issue. Once we determined the culprit it was quickly fixed. I am not a programmer, so I have no idea how they did it (witchcraft, I presume) but the kit bot works fine now.

You can program in a deadband to encompass the inaccuracies (over-accuracies, I guess, if that is a thing). We use wired Xbox controllers, and we have to do the same.

Our problem with the sticks wasn’t that there was not enough dead band, it was that there was too much. If I rmember correctly, about 30% of the sticks motion (all the way up to all the way down) accounted for no change in the analog value reported to the robot.

That just means there’s less controllable area over which the driver can adjust speeds. We don’t see this problem wit the F310. So that
s what we have used. Maybe there are different hardware versions of the wired 360 controller… The one we bought back in 2010 had this problem, and we haven’t checked again since.

Team 230 has been using the Logitech gamepad (now the F310) for 6 years now and programming in C++. We too have had an excellent experience with them. They are supported through the WPILib just like the kit joysticks as well as many others you can buy. Although we do not use it to drive the robot but rather for our operator controls, in particular we use the gamepad rather than xbox or other similar controllers because the joysticks have better sensitivity and deadband area. This makes those joysticks more useful for controlling other mechanisms too. I agree that they do have an issue with stress on the cord which can fray/break causing issues so we also get new ones for competition use each year. No matter how much we remind people not to wind up the cord so tightly… they still do it. :smiley:

If you need any help with interfacing to them with your C++ code feel free to pm me or post questions here.