Programming Languages for Robotics


  • Electric



  • That was an interesting read. He hints at the it depends answer and then goes on trying to find some patterns in the madness, but at the end I am still more convinced with *it depends as an answer. Saying what programming language is good for robotics is similar to asking what programming language is good for developing graphical user interfaces.

    I personally am learning robotics using Arduino and Linux so naturally I would be interested in learning more C++ and Python. When working on Linuxthere is a wide range of programming languages available. However most often you want to use certain algorithms in your project and your choice of language would depend on what the best libraries available out there would offer you.


  • Linux

    I agree with Aras, it is very dependent on what you are doing.

    Python is great (particularly on an RPi) because you can work quickly and optimize later as required. Sadly, it is not widely available on something like an Arduino because it uses a lot of resources, although I think micro-python is trying to change this?

    If you are working on something like an internet-of-things project you may also be incorporating a web browser and then you could be into javascript and PHP to glue everything together.

    One area the original article does not talk about is graphical-based ‘learning’ languages. There is an MIT developed language (Scratch) that has been extended to work with the Arduino. ‘Programming’ involves assembling graphical building blocks, making it more intuitive to learn. I know they have had success using it with young kids, but do not know how that has extended to teaching more sophisticated concepts.


  • Electric

    I tend to gravitate more to the industrial languages because they “look and feel” like the other industrial PLC languages I am familiar with. I am starting to explore ROS industrial which is an open source industrial robotics language supported by most of the big robotics companies like ABB. After reading your comments I might have to pick up python again and take a stab at it.



  • I have been wanting to play with ROS (Robot Operating System) for a long time but have not had the chance yet. With laser cutter arriving soon I plan to build a simple arm and start playing around with it. Looking at the code base ROS is mostly written using C++ and Python and those are the interface languages they are offering initially.

    We have talked about doing some programming meetings at the space. I wonder if we should setup a regular (Monthly?) robot programming meeting at makerspace. That way we can exchange knowledge about different platforms and even learn particular programming languages together.



  • I think it really boils down to what you’re doing.

    For simple robots, like mini-sumo and line-following, maze-solving type robots, you can do quite well using C/C++ on an Arduino.

    As your tasks start to get more complex and you start using sensors which generate higher streams of data (camers, lidar, etc) then the arduino quickly runs out of oomph.

    I’ve been playing with python quite a bit and in particular micropython. My brother put together a 4-legged walker with the full kinematics done in micropython. I’m slowly working on doing the same foir a six-legged walker.

    I have a library of code I’ve written for talking to Bioloid servos in C, C++ and a very similar library in python. Doing the python version was much easier than doing the C++ version. The C version will run on an arduino though.

    I’m also working towrards learning ROS and picked up a TurtleBot 2 so I’d have some hardware already put together.

    The RPi is a nice platform but doesn’t have much I/O suitable for robotics, unless you start adding devices to a bus (like the bioloid devices on a serial bus). The BeagleBone Black is a much more suitable platform from the I/O standpoint.

    You can use Python or C++ on either RPi or BBB.



  • free interactive python course at University of Waterloo http://cscircles.cemc.uwaterloo.ca/


Log in to reply