I was looking around on the web about robotics programming, especially the Lego mindstorm EV3. I was looking at what programming languages this platform supports. I saw that you can program it in Java ME(understandable as Java is everywhere today) and in C#. I thought that C# was a windows only thing, with mono on linux. So my question actually is, for robotics programming (NOT just lego mindstorm ev3) which between Java and C# is the better option and why?

Recommended Answers

All 3 Replies

I would say C++ and Python. I guess Java could be an option, and I remember seeing some half-serious Java code in robotics. As for C# in robotics, that must be a joke, right?

By far, the most widespread languages for robotics are C, C++ and Python, depending on what "level" you are at (drivers, embedded systems, micro-PCs, controllers, high-level scripts or state machines, etc.). The brunt of it is in C++. It's basically C for dealing with hardware, C++ for everything that is important, that matters and/or is complicated, and Python for plugging the main pieces together or for helper tools (visualization, GUIs, scripts, etc.).

Besides that, there are, of course, hardware-specific languages such as KRL/RSI (for Kuka robotics). And there is also a number of other specialized tools that are use in robotics and automation. In more academic settings, people sometimes used Matlab/Simulink, although I find it very limiting (and very quirky to work with).

Of course, if you move one step removed from actual robotic hardware, you can pretty much use whatever you want, and Java certainly occupies a big space there. I'm talking about "ground station" work here, i.e., the stuff you run outside the robot, in a ground station computer, like planning or mapping algorithms (e.g., SLAM). But I still would not recommend using Java anywhere.

In my personal experience, probably 95% of robots I have seen or worked with run on C/C++ code, and the rest run on Matlab/Simulink (Real-time Workshop) code. The only things I have ever seen that were using Java were either far removed from hardware, or purely for simple simulation work. As for C#, I encountered one makeshift ground station GUI that was done in C#, that's all I can recall of it. C++ is so ubiquitus that you don't even have to ask or tell what language a particular piece of robotics software is written in, it's just assumed to be C++ by default.

Things like the Lego mindstorm are introductory toy-like products to help give a gentle introduction into robotics to children and teenagers. Their LabVIEW-based (or similar) languages are just there to be able to do simple programs without any "coding" necessary. And providing Java and C# as an option is for similar reason (do simple things without having to do any serious coding in a serious language). This is educational in the sense of raising interest in robotics and STEM in general. They have nothing to do really with "real" robotics programming.

Get familiar with the C / C++ / Python stack, and also Linux / bash. That's the best advice I can give, if serious robotics programming is what you have in mind in the long run.

Also, you have probably encountered it already (if you did any research into robot prog.), but if not, make sure to check out ROS (which also works on the mindstorm, if you want to refurbish that toy into something a bit more serious).

For simple robotics projects, the microcontrollers of Atmel or Microchip are often used. They both can be programmed in C, but also in their own brand of assembly language.

@mike_2000_17 Thanks, I dont know if I am going to do serious robotics programming yet. The only reason why i was looking at java ans c# was because they are a little easier to program in. But I do think that C or C++ would be better for robotics as they are way faster and can give more control over what really happens to your robot.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.