Hi all,
I’m attempting to code in a numpad as an “operator” controller for the FRC driverstation yet have not found documentation to do so. Do any of you have experience doing so? If so, can you guide me through it?
Thanks in advance!
Hi all,
I’m attempting to code in a numpad as an “operator” controller for the FRC driverstation yet have not found documentation to do so. Do any of you have experience doing so? If so, can you guide me through it?
Thanks in advance!
There is no option to do that within the DS itself, as the DS only supports USB HID joystick and gamepad (xbox controller) devices or things that emulate them. The “emulate a joystick” approach has been used by teams to create full custom button boards, e.g. using a TI LaunchPad device.
Alternatively, you could write a standalone application that reads the numpad and sends data over NetworkTables.
I’ve used (not in competition) something like vJoy (i.e. virtual joystick) or maybe something like KeyToJoy, or similar standalone programs that emulate the keyboard as a joystick.
Yeah, vJoy could work, but I’d be leery of using it in competition as well, it’s always felt flaky/unstable to me.
I like your second suggestion better if you wanted if for competition.
I always shill Virtual Gamepad Emulation Framework · GitHub as a better alternative to vJoy.
I had the same question, and, after a while, found Joystick Gremlin used in conjunction with vJoy. The setup was extremely simple, I just pressed the key on the numpad and selected which button I wanted it to output as. For me, I needed to run it as admin so that it could get keystrokes even when other apps were in focus. The system tray icon (I think that’s what it is called) can be right-clicked and the program can be hidden and enabled from that menu. I would recommend testing the keys and looking in the driver station to make sure it is enabled before every match, but you can also check to make sure there is a red dot on the system tray icon indicating it is enabled.
Our team used to have Razer button pads to add more buttons, such as the original Razer Tartarus. Ultimately we had more trouble with them over the years than they were worth.
For example, the Razer Synapse driver software would regularly hit issues and forget the bindings, leading to a mad scramble to fix it. A couple times in the 3 or 4 seasons that we used it, there was some issue with the main driver station laptops (students forgetting them at home when they took it to charge, etc.) and there was no chance of getting a replacement laptop to be able to recognize the device and have the drivers all installed at an event. So we’ve relied on just using well-supported HIDs ever since, such as Xbox controllers or imitations plus Smart Dashboard.
Also, the current button pads that are available from various vendors (Razer and others) tend to have 20+ buttons, but the Driver Station software that FIRST provides is limited to only ~16 buttons IIRC.
I know Spartechs 834 used a plug in number pad as a way to use their preset heights for their arm.
i worked on an RDP compatible keyboard controller (“emulator”) in python. its a single file, with arrays for the keybinds at line 45. feel free to customize for your purpose if you find it useful
You can use a basic script like
import time
import ntcore # pip install robotpy
import keyboard # pip install keyboard
inst = ntcore.NetworkTableInstance.getDefault()
table = inst.getTable("keyboard")
inst.startClient4("keyboard")
# pick one of these
# inst.setServer("10.te.am.2")
# inst.setServerTeam(4096)
# inst.startDSClient()
while not inst.isConnected():
print("not connected")
time.sleep(1)
while True:
event = keyboard.read_event()
if event.name:
table.putBoolean(event.name, event.event_type == keyboard.KEY_DOWN)
to forward your entire keyboard over networktables to your robot. You can then use NetworkButtons the same way you use Joystick buttons
We used this for the first time this year:
We changed the usb hid to look like a game controller and the frc dashboard would see it. It worked very well.
Note that while DriverStation.exe
is open and in focus, it will swallow all keyboard events for some reason.
We tried to use the Keybow, but it kept losing the downloaded python script. (I’m sure we were doing something wrong.)
It was super easy to configure, and the customizable RGB LEDs under the keys are awesome. And I like how you can stitch together multiple keybows to make a larger board.
We used a numpad this season and our solution to this was to take it apart and solder each switch to a wire that we plugged in to an arduino leonard, that then registered as a controller to drivers station.
I did briefly look at using key2joy but since all keyboard inputs are consumed while drivers station is in focus, this solution wasn’t too appealing to me.
I haven’t spend much time with the keybow but I have a student looking at it. He is currently having issues getting the driverstation to see it. Can you expand how you got it to look like a game controller? Maybe share the python for the keybow and the robot side controller code?
Another option which seems excessive but might work is using the wooting 60HE keyboard. It has analog switches and in the software you can configure it to act like a gamepad.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.