Can robot brain get/send custom messages to PC?

This sounds interesting. Would you do this to control a different V5 in a configuration similar to the upcoming VEX LINK, or would it be to talk to a controller using the radio. The former could be extremely interesting for external computing in a competition like VAIC. Obviously this would hugely benefit teams who can afford powerful computers, but maybe it would be possible to control the robot using a neural net on a remote computer. Then again, neural nets would have many issues…

1 Like

IQ is more difficult to communicate with as the BLE connection is reversed as compared to the V5. There is, however, more information available. VEX has (pretty old now) an sdk available and we wrote some demo apps when it was first available.

see my earlier comments about BLE.
VEXcode also supports wireless programming and stdio (in and out) through the controller.

quite hard, a fair amount of reverse engineering.
simpler solution (more expensive :slight_smile: )would be to use a V5 at the computer connected with USB, then use VEXlink (and yea, I know we have not discussed many details on that yet) with one or more radios to talk with the robot (or robots) you could theoretically control up to 20 robots from the one PC.

12 Likes

I would be really happy to be able to interface to the PC via the Vex V5 Controller vs another V5 Brain, since the terminal window in Vexcode already can display output when the controller is connected to the PC via USB and wirelessly to the brain via VexNet or Bluetooth
is that a possibility? would it be theoretically possible to have say a python program connect to the ‘terminal’ and send and receive messages to the Brain via the handset and vexnet?

1 Like

Not via the controller.

With the direct USB connection, anything that can open a serial port could replace the terminal. Either close VEXcode or disable the terminal in preferences to free up the serial port for use by other code.

the terminal is a bit more difficult when using the controller as the messages are part of the admin messages that get sent, we have not opened up that protocol beyond third party devs, but I’m sure someone could look at what PROS is doing and copy it.

6 Likes

Ok Cool, I got that to work with Terra Term, Not as useful to have a hard tether to the V5 Brain though.

Also I am not seeing how to send data from the PC to the Brain,

More to dig into…

Sorry to be a latecomer to this thread. Lots of useful stuff, especially about wireless. I had a student ask me about connecting a GPS (real GPS) sensor to the V5 for a summer project, and my first thought was to get a GPS hat for the Raspberry Pi, and connect the Pi to the V5 using serial cable. I also live in the FRC world, where Raspberry Pi’s are very commonly added to robots as co-processors, usually for vision processing. It seems to me that the Pi is becoming a standard way to add edge computing to a robot, using a model where the Pi accomplishes a computing task to produce simple numbers, to feed to the main brain like any other simple sensor. Since the Pi has host-mode USB, it should be a simple matter to connect the V5 by USB, and do serial comm. As stated by @Potatehoes914M, there’s a way to do this with PROS, and I’ve seen other messages on the board recommending PROS for this. I’ve also seen a message or two implying VEXCode can do this with stdin/stdout. The latter seems like the ideal way for my student to proceed. Writing a few print/read statements in C++ and Python to establish a simple protocol would be within their capability. Moving to PROS might be too much. But my question is whether this will work in VEXCode? I haven’t had an opportunity to try it myself, but wondering what to tell the student.

1 Like

Lets continue discussion over

1 Like

I’ve worked with GPS in graduate school. Things like this, basically communicate over serial.

Often a u-blox chip. There’s a standard NEMA protocol these things speak. So connecting to VEX boils down to getting serial into the VEX brain.

1 Like

We are thinking of using this GPS hat, along with running GPSD on the Pi

yes, no problem, as long as the Pi sees the V5 and mounts as a CDC serial device. VEXcode supports stdio using C or C++ APIs.

A bit more tricky in Python as that serial output is used for REPL, I’ve improved that in the next Python VM (meaning you have a choice now), not sure when Robomatter will release the next VEXcode V5 with that update though.

6 Likes

I Have 276-6009-750 With Brain 276-4810 I Try To Use VEXLink To Connect With Computer Serial But I Can’t How Can Solve This