Keyboard and Mouse

Is there in anyway possible to drive a robot with a v5 system by using a keyboard and mouse?

No such way will be competition-legal, but it is possible.

The most obvious solution is probably to use a single-board computer with USB support, like a Raspberry Pi, as a go-between that relays keyboard and mouse inputs over serial into one of the smart ports.

2 Likes

Would you need code for this or is there a way to just set the keyboard to run inputs directly to the robot

The v5 brain doesn’t have a USB host port, so it wouldn’t be possible to connect a keyboard/mouse directly to a v5 robot in a useful way. There will need to be some sort of intermediary device which has a USB host port, can read input from the keyboard, and then send data to the v5 brain (via RS485, info about doing that in PROS here). As @Barin mentioned, an obvious candidate for this intermediary device would be a Raspberry Pi, since it has USB host ports and can communicate with generic serial devices.

To answer your question, yes, you would need some code to do this. The intermediary device (RPi etc.) would need to have a program running on it to read input from the keyboard/mouse, possibly process/interpret it, and then send data/commands to the v5 brain over serial. The v5 brain, in turn, would need to be programmed to receive that data and take appropriate action (i.e., turning a motor on when it hears that a particular key has been depressed, or whatever other controls you want to implement).

Again, this would not be legal for use in VRC, but definitely seems feasible.

2 Likes

Another way this could be done (which may be legal for VEXU) is to emulate the partner joystick using a RS485 serial adapter and use a laptop to send signals through that emulated joystick. The actual input method could then theoretically be anything, from a keyboard and mouse to a wii controller.

1 Like

That’s a really interesting idea, but I think it would be prohibited by <G7> (emphasis mine):

<G7> Only Drivers, and only in the Alliance Station. During a Match, all Drive Team Members
must remain in their Alliance Station. Drive Team Members are not allowed to use any sort of
communication devices during their Match. Devices with communication features turned off (e.g. a phone in airplane mode) are allowed.

  • Note: Per <T02>, Drive Team Members are the only Team members that are allowed to be in the Alliance Station during a Match.
  • Note 2: During a Match, Robots may be operated only by the Drive Team Members and/or by software running on the Robot’s control system, in accordance with <R11> and <G9>. Violations or refusal to comply with this rule could be considered a violation of <G1>.

Seems to me that controlling the robot from data sent from a laptop/RPi to a joystick would mean the robot is being operated by software not “running on the Robot’s control system”, and thus doing this in competition (even VEXU) would not be legal.

In theory, Bluetooth communication protocol is supported by the V5 radio, but it may not be hooked up to anything useful right now.

@yeetskeetrepeat, could you elaborate a little bit more about what it is that you are trying to achieve?

Does final solution have to be VRC or VEXU legal?

Do you need control system to be wireless or it is fine to run a cable from V5 to a RS485
USB dongle plugged into the computer?

How much effort are you willing to invest into this solution?

Once upon a time, it was officially ruled legal to utilize the partner port to connect to other devices in VEX U:

The idea is that, no matter what/how you interface the keyboard and mouse with the robot, the Brain is still the only thing along the chain that directly operates the robot. That is, competition control and software on the Brain can at any time completely override any external inputs, and the external inputs have no effect on the robot without the Brain’s software interpreting those inputs.

Though this should definitely be clarified in this season’s Q&A if OP wishes to utilize the partner port in this manner for VEX U.

1 Like

Cool, thanks for linking that!

To add on to what Barin said, this was also confirmed to be legal for last season:


All that remains is to verify if this is still legal for V5 (which is why I said it may be legal for VEXU), which it should be, especially considering even HS is allowed to have pretty much arbitrary devices connected to the joystick for the purpose of powering it.

1 Like

The solution does not have to be legal as it would be used in a classroom for fun. It would also be nice if the solution was wireless. In terms of effort I am willing to put in enough to get it done.

If you want a wireless solution, you could just use a standard wireless keyboard and mouse.

Alternatively, you could utilize the partner controller port as mentioned above.

Since it doesn’t need to be legal you can just use a raspi or arduino with bluetooth on the robot to communicate with the keyboard and mouse and then send the instructions over serial through the USB port on the brain.

1 Like