![]() |
Get joystick name and index in wpilib C++
Hi, we're trying to figure out how to access the joystick name, or some sort of hardware identifier in wpilib from C++. Basically, we want to be able to tell the difference between the logitech joystick, and the Xbox 360 controller when the robot initializes. We plan to convert a joystick into a switch box to store settings for autonomous mode each match, and we don't want to have to check the stick indices every time. Is there any way to get an identifier to tell which stick is shown as which index?
Also, I'm not incorrect in interpreting the rules as meaning that a box of switches set before the match during strategy talks would be fine to use because no human is touching the driver station or moving beyond the white line during autonomous mode am I? |
Re: Get joystick name and index in wpilib C++
Quote:
EDIT: Just re-read and realized you're talking about harvesting the joystick internals for a custom device. The same thought applies, just tie one of the axes to 0 or 5V (or whatever the max voltage on the internal pots is) and key off of that. Quote:
|
Re: Get joystick name and index in wpilib C++
Just to confirm. No information about the Vendor or Model of the joystick is ever sent to the robot. The DS displays it, but it is not part of the protocol. If your team plugs the joysticks into the same ports each time, I'd expect that you do not need to redo the ordering. Have you seen different?
To cut through the inverted inversions of the sentence. Joystick and I/O settings are sent to the robot during disabled mode and are latched during auto. A custom control box, with switches and pots is often used. If the I/O is not connected and the I/O is configured for Compatible mode, you can also make the settings directly onscreen. The Boolean and sliders can be named and their names and settings are stored to the ini file. Greg McKaskle |
Re: Get joystick name and index in wpilib C++
Quote:
It turned out that it's not hard to write a program on the PC to query the joystick information but we never got around to putting together the pieces to send it to the robot because we ended up only using one joystick. |
| All times are GMT -5. The time now is 02:33. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi