So I was wondering if we could code the robot in C rather than LabView.
C++ and Java are also supported languages. Some teams use other languages such as Python, but if you do that then don’t expect any help from CSAs or teams at your competition as those other languages are very uncommon. I’m not a programmer so I can’t offer much help otherwise, but I thought I would try to answer your question anyways.
C is close enough to C++ that I’d just suggest that.
I know you can run properly compiled Go on the Rio as well. But don’t expect anyone to help you debug at events.
Yes. Basically just install the C++ toolchains, then ignore all of the OOP bits of C++ when you’re writing your code.
Except where you have to interface with WPIlib
OP, while what you are describing is technically feasible, what is your motivation for doing so?
The HAL headers are C iirc, but all of WPILib is in C++ and Java. If you’re asking the question now, I recommend sticking with LabVIEW if you have experience or switching to Java as that’s a little more beginner friendly.
If you have programmer(s) who know C, making the switch to the amount of C++ you will need to program a robot is pretty minor; it just looks like rather funny ways to implement libraries.
If you’re going to have to learn the language and just want to switch to a text-based language rather than a wiring chart based one, I’d definitely recommend Java over C++, because it catches more problems during coding and compilation and execution than C++, so you get an error message rather than totally baffling robot behavior.
Labview isn’t the only option, you can code the robot in C++ or Java if you so incline. You also can code your robot in C by using the C++ compiler and just not using any C++ specific functionality. You’s have to interface to HAL instead of wpilibs which isn’t necessarily difficult to do, but there isn’t too much in the way of documentation, so getting stuff to work will take a bit of effort. Also if this is done this way, it becomes harder to get CSA help and you have a harder time getting “Cheesecaked autos” to work.
If you’re looking to experiment, I’d recommend trying out Python. We have a simulator that allows you to run your code on your laptop, so you can play with it without worrying about messing with your team’s RoboRIO.
https://robotpy.readthedocs.io/en/stable/getting_started.html