Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   WPILIB use without Driver Station (http://www.chiefdelphi.com/forums/showthread.php?t=152263)

abigailthefox 11-11-2016 19:24

WPILIB use without Driver Station
 
During the offseason, my team has been working on a mini competition to host at one of our yearly youth science events. The main premise of the competition is that we have small teams of students design small, inexpensive robots controlled by an Arduino, and let children drive these robots in short games.
As the programming lead, I am currently in charge of developing a game control system for this event. Think FMS, but much more simple. We are writing this by hand to keep it simple. Most of the code relating to the wifi communication to the robots, and the actual game competition is already written, but I'm currently working on the joystick code and finding it difficult to find a good library that serves our purpose.
I was wondering if the WPI library Joystick class could be successfully used without simultaneously using the driver station, and if it's theoretically possible, I was wondering if anyone has ever tried. If not, if anyone could offer some pointers on writing your own joystick class (mainly in the topic of directly getting joystick values from a USB connection on the computer), that would also be very welcome!

Ben Wolsieffer 11-11-2016 23:36

Re: WPILIB use without Driver Station
 
The WPILib joystick class does not directly communicate with the joystick over USB, so it is unlikely to be very useful to you. The driver station communicates with the joystick over USB and sends the values to the robot over the network.

Depending on what platforms you need to support, there are a number of libraries for interfacing with joysticks.

I have used the Jinput library in Java and it works well if you are writing your application in Java, although it is pretty old.
If you are using Python, pygame provides a joystick library, and there a number of other smaller libraries out there that may work.
If you only need to support Windows, and you use C/C++, you can use XInput (the built in Windows joystick API).
SDL is a lightweight C game/3D graphics library that provides a joystick library that can be used even if you don't use SDL for displaying your application. It supports Windows, Linux and OSX.
I have not used any of these except for JInput, so YMMV.

It may be possible to use some of RobotOpen's libraries, which are designed to be used with their custom Arduino based robot controller. RobotOpen provides a driver station and Arduino code for communicating with it.


All times are GMT -5. The time now is 09:32.

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