Go to Post FIRST is not about robots or which roller coaster we get to ride... it is about people. - Andy Baker [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 11-11-2016, 07:24 PM
abigailthefox's Avatar
abigailthefox abigailthefox is offline
Registered User
FRC #1711 (Raptors)
Team Role: Programmer
 
Join Date: Feb 2015
Rookie Year: 2015
Location: Traverse City
Posts: 48
abigailthefox is an unknown quantity at this point
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!
Reply With Quote
  #2   Spotlight this post!  
Unread 11-11-2016, 11:36 PM
Ben Wolsieffer Ben Wolsieffer is offline
Dartmouth 2020
AKA: lopsided98
FRC #2084 (Robots by the C)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Manchester, MA (Hanover, NH)
Posts: 520
Ben Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud of
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.
__________________



2016 North Shore District - Semifinalists and Excellence in Engineering Award
2015 Northeastern University District - Semifinalists and Creativity Award
2014 Granite State District - Semifinalists and Innovation in Control Award
2012 Boston Regional - Finalists
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 07:38 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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