Programming skills for robotics
What is a computer program?Robots process sensor data, perform cognition and plan actions using computer programs that are executed on a processor. Computer programs are essentially a set of instructions that operate on an input to produce an output.
Example: A face recognition program in a robot will:
1. take an image of a person as an input,
2. scan the image for a specific set of features,
3. compare these features to a library of known faces,
4. find a match, then
5. return the name of the person as an output.
The program will perform exactly these same set of instructions every time it executes.
- Robot Operating System (ROS) is a set of software libraries and tools that helps you build robot applications. You can also write your own programs for ROS e.g. in C/C++ or Python.
- Matlab which is used for data analysis and interfaces with ROS (also, Octave is a free, open-source equivalent to Matlab available here.)
C programming and the Arduino microcontroller
Python and the Raspberry Pi
What are the differences between an Arduino and a Raspberry Pi?
Arduino. An Arduino is a microcontroller, which is like a simple computer but which runs and loops a single program that you have written on a PC. This program is compiled and downloaded to the microcontroller as machine code. The Arduino is well suited to low-level robot control and has features like analogue-to-digital conversion for connecting analogue sensors.
Raspberry Pi. A Raspberry Pi (RPi) is just like a normal PC and so is more versatile than an Arduino but lacks features like analogue-to-digital conversion. The RPi runs a Linux operating system (usually Raspian). You can connect a keyboard, mouse and monitor to a RPi, along with peripherals like a camera – very useful for robotics. (Due to the fact that the RPi runs Linux you can also install ROS although it can be a bit tricky to setup.)
Programming is a key skill to develop for working in robotics. In this step, we’ll introduce programming, the important languages, and how you can get started with tools like Arduino and Raspberry Pi.
DiscussionWhat programming language would you like to learn, and are you tempted have a go with an Arduino to learn C, or a Raspberry Pi to learn Python or both?
What is a computer program?
Building a Future with Robots
Our purpose is to transform access to education.
We offer a diverse selection of courses from leading universities and cultural institutions from around the world. These are delivered one step at a time, and are accessible on mobile, tablet and desktop, so you can fit learning around your life.
We believe learning should be an enjoyable, social experience, so our courses offer the opportunity to discuss what you’re learning with others as you go, helping you make fresh discoveries and form new ideas.
You can unlock new opportunities with unlimited access to hundreds of online short courses for a year by subscribing to our Unlimited package. Build your knowledge with top universities and organisations.