How to get started in
Programming for Robotics
Q4 Lesson 1
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.
Programming languages
There are numerous programming languages available,
e.g. C/C++, Java, Fortran, Python etc. The most popular
language in robotics is probably C/C++ (C++ is an
object-oriented successor to the C language). Python is
also very popular due to its use in machine learning
and also because it can be used to develop ROS (Robot
Operating System packages .
There are additional, important software
tools used in robotics, in particular:
• 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 is used for data analysis and
interfaces with ROS (also, Octave is a
free, open-source equivalent to
Matlab
C programming and the Arduino
microcontroller
• The C/C++ language is one of the most widely used
programming languages in robotics. The Arduino
microcontroller uses a programming language based on C
and is a great way to learn the basics of this important
language whilst doing hands-on robotics.
What is Robot Programming?
Robot programming is the
process of giving
instructions to a robot to
perform specific tasks
under teleoperation (the
control of humans), full
autonomy or semi-
autonomy. These
instructions are written in a
programming language that
the robot can understand
and execute.
Why You should Learn Robot Programming?
Endless Possibilities: Robot programming opens up a world of endless
possibilities, such as building robots to automate tasks in various industries.
Career Opportunities: In today's tech-driven world, robot programming skills
are highly sought after by employers in fields like robotics, automation, and
artificial intelligence. Employers in fields like robotics, automation, and
artificial intelligence are actively seeking individuals with expertise in this
area.
Problem Solving: It challenges your problem-solving skills as you figure out
how to make a machine interact with its environment effectively.
Choosing the Right Robot
several key considerations should guide your
decision-making process
• Budget
• Task Requirements
• Programming Experience
• Expandability
• Operating System Compatibility
• Community and Support
• Safety Features
Principles of Robot
Programming
Q4 Lesson 2
The Core Principles of Robot Programming
Sensing and Perception
1. Types of Sensors: Robots use a variety of sensors, including cameras,
lidar, ultrasonic, light, gesture touch, and motion sensors, and more.
2. Data Processing: Once sensor data is collected, it needs to be processed
to extract meaningful information. This involves techniques like image
processing for camera data or filtering algorithms for noisy sensor
readings.
3. Sensor Fusion: Many advanced robots use sensor fusion, which
combines data from multiple sensors to create a more comprehensive
view of the environment.
4. Machine Learning: Machine learning techniques, such as neural
networks, can be employed to teach robots to recognize objects,
patterns, and even make predictions based on sensor data.
The Core Principles of Robot Programming
Decision-Making Algorithms
1. Types of Algorithms: For example, a robot vacuum may use a simple
algorithm to avoid obstacles, while a self-driving car relies on
sophisticated AI algorithms for navigation and collision avoidance.
2. Path Planning: Path planning algorithms help robots find the most
efficient route from one point to another while avoiding obstacles.
3. Reactive vs. Deliberative: Reactive systems react quickly to immediate
sensor input, while deliberative systems plan actions more strategically.
4. Learning-Based Decision Making: They can adapt their decision-making
based on previous interactions and data collected from their sensors.
The Core Principles of Robot Programming
Actuators and Motion Control
1. Types of Actuators: Robots use various types of actuators, including
motors, servos, pneumatic systems, and more. For example, motors provide
precise control of movement, while pneumatic actuators offer rapid force
generation.
2. Kinematics: Kinematics is the study of how robots move. It involves
understanding concepts like forward and inverse kinematics, which determine
how joint angles and positions affect the robot's end-effector (the part that
interacts with the environment).
3. Motion Control: Motion control algorithms dictate how actuators should move
to achieve desired robot movements.
4. Feedback Systems: Robots often use feedback systems, such as encoders and
gyroscopes, to monitor the position and orientation of their components.
Feedback helps ensure accurate and precise motion control.