Connect Xbox Controller Directly to Roborio

In the off season, our team is working on a new demo robot for informational outreach events in order to showcase some of the more fun aspects of robotics. However, our project requires us to directly connect the USB controller to the robot’s USB ports rather than to the driver station itself which will still be connected for emergency shutoff.

Is it even possible to connect directly to the robot, or should we invest in a wireless Xbox Controller to plug into the PC while used on the robot (which would probably increase latency for the driver)?

Thanks for the help!

Totally doable, but might require some effort.

I think you’ll probably want to compile https://github.com/xboxdrv/xboxdrv for the RIO. Quick googling also shows https://github.com/williamahartman/Jamepad as a way to read gamepads directly from Java instead of going through the driver station.

Oh wow, thanks! Do you know if there is another method for reading the gamepads using C++ instead of Java currently? Thanks again!

In your post you seemed worried about latency using wireless controllers. Let me assure you, most modern wireless game controllers have nearly nonexistent latency. Our team has used the official Microsoft Xbox One Wireless Adapter for PC (Link) with multiple wireless Xbox One controllers for driver practice and outreach events and have had zero issues. None of our drivers could detect any latency changes between a direct connection and the wireless adapter. Programming a solution would definitely be a great project, but if all you’re looking for is a way to control the robot away from the Driverstation, I highly recommend this route.

Gainput is referenced a few times in my quick google search. This says Xbox 360 control is okay, so you may be able to get around compliing xboxdrv, but if you’re having issues that’s the first thing I’d check.