Hear me out. Artificial intelligence for controlling the robot

Yeah no one does, don’t use C++, it sucks. Use C, its better. (I guess you might have to use C++ for this project, but try and avoid C++, It has a lot of issues, and its ancient)

they’re called learning algorithms. :/, try PPO. Thats a good one. There is a number of these algorithms, I advise you to read articles on them and figure out which one is the best for you. Try this article first https://openai.com/index/openai-baselines-ppo. If you don’t want to read, you are going to have to for this project. For Computer science (planing out the algorithms and the different technical pieces) articles and lectures are great, for the actual programing (Computer Engineering) try documentation.

I would look into model predictive control and ONNX Runtime for this, but I’m no AI/ML expert

It’s probably possible, but it will probably require more effort than just coding it yourself. My recommendation would be to reward the program for scoring points, and maybe punish it for removing the objects from the field or something like that.

Each of the inputs has a weight. For example if you had 5 inputs with the following values (the values are always between 0 and 1, inclusive):

Input 1: 0.75
Input 2: 0.84
Input 3: 0.62
Input 4: 0.21
Input 5: 0.1

The neural network would randomly assign each number a weight (between -1 and 1, inclusive) for each hidden neuron. For example, for neuron n, those values might be:

Weight n1: -0.45
Weight n2: 0.87
Weight n3: -0.02
Weight n4: 0.36
Weight n5: -0.63

You would then sum the products of each weight with its respective input:
0.75*(-0.45)+0.84*(0.87)+0.62*(-0.02)+0.21*(0.36)+0.1*(-0.63)

In this case, that expression equals 0.3935.
I’m not sure what happens next, but I know that you check that number against a bias.

Here’s a better explanation:

Thats a Fitness algorithm, that only really works digitaly because you need to run hundreds off different “robots” at a time to get a good result. That said, that is pretty much what all algorithms do

C++ is just a superset of C (it has all the features that C has plus more, e.g.: classes). Both C and C++ are compiled languages, and there is not enough of a speed difference to discount the massive benefit of classes (especially for a neural network with nodes and layers); not to mention that C++ is one of the most common languages used for vex. Also, even if C++ is “ancient”, C is even older. Lastly, I don’t think “no one” knows how to use C++, as it is one of the most popular languages ever (second according to the TIOBE index).

WEEKLY UPDATE: I am now going to try to actually learn how to code C++ and then try to code a neural network as @lacsap suggested

Also does anybody know a good website that teaches C++ for free & preferably without an account?

  1. W3schools
  2. YouTube

Here you go: https://www.learncpp.com/

C++ Tutorial is really good for the basics (it also has a lot of other languages) and it should have all you need to learn for regular vex (syntax-wise; not including coding concepts like PID or odometry). For more complex concepts (not necessarily robotics-related but useful for AI), https://www.geeksforgeeks.org/ is good, just don’t leave the tab open for too long since the ads use a ton of RAM for some reason. The C++ standard library’s documentation is a bit harder to read and might be confusing, but here is a link I found: DevDocs — C++ documentation (I just found it and I haven’t used it before but it looks good; at least it’s better than cppreference.com). You probably only need the first two websites though.

I know I said C++ but do you guys also know any for python? I can only really test in VEXcode VR which doesn’t have C++ and only has python.

I have defied the will of god and coded a functional 12 neuron neural network with blocks.

Really? Could you share it?

I am 99% sure you will not be able to train an AI for real life gameplay and control through the stock VEXcode VR system.

I logged back into my vexforum account after three months just to ask you to stop spreading misinformation. DUDE…, C++ is still being updated. The next standard, C++26, will be released around 2026… What are you talking about? If you don’t know C++, that’s fine, just don’t talk like you do. lmao

@Some_random_person Be more specific. (The following quote of Connor was in a previous post that was not approved by mods for some reason)

because when we get multiple posts with the same link it adds nothing.

6 Likes

Im using VEXcode VR to test to see if the neural network even works because VEXcode VR allows me to train/test the network without having to use a robot which is important because I don’t have a robot.