Module 4: Programming and Languages for
Robotics
1. Robot Programming
Robot programming involves creating instructions to control a robot’s actions, enabling it to perform tasks
autonomously or semi-autonomously.
Methods of Robot Programming
Teach Pendant Programming:
o Uses a handheld device to manually guide the robot through tasks.
o Advantages: Intuitive, no advanced coding skills needed, ideal for simple tasks.
o Disadvantages: Time-consuming, limited to specific robots, not scalable.
o Applications: Industrial robots for welding, assembly.
Offline Programming:
o Uses software to simulate and program robots in a virtual environment.
o Advantages: Reduces downtime, allows complex task design, reusable code.
o Disadvantages: Requires simulation software, potential mismatch with real-world
conditions.
o Applications: Automotive manufacturing, complex robotic cells.
Lead-Through Programming:
o Physically moves the robot arm to record positions and motions.
o Advantages: Simple, direct, good for continuous paths.
o Disadvantages: Labor-intensive, limited precision, unsafe for large robots.
o Applications: Spray painting, arc welding.
Text-Based Programming:
o Uses high-level programming languages or robot-specific languages.
o Advantages: Flexible, reusable, supports complex logic and integration.
o Disadvantages: Requires programming expertise, longer development time.
o Applications: Research robots, collaborative robots.
Graphical Programming:
o Uses visual interfaces (e.g., drag-and-drop blocks) to create programs.
o Advantages: User-friendly, accessible to non-programmers, rapid prototyping.
o Disadvantages: Limited complexity, less control over low-level operations.
o Applications: Educational robots, small-scale automation.
Task-Oriented Programming:
o Focuses on defining tasks rather than detailed motions (e.g., “pick and place”).
o Advantages: High abstraction, simplifies programming, adaptable.
o Disadvantages: Requires advanced software, may lack fine control.
o Applications: Service robots, human-robot collaboration.
2. WAIT, SIGNAL, and DELAY Commands
These are fundamental commands in robot programming for controlling timing and synchronization.
WAIT Command:
o Pauses program execution until a specified condition is met (e.g., sensor input, time elapsed).
o Syntax Example: WAIT FOR INPUT 1 = ON
o Use Cases: Waiting for a part to arrive, synchronizing with external devices.
oAdvantages: Ensures precise timing, prevents premature actions.
oDisadvantages: Can cause delays if conditions are not met.
SIGNAL Command:
o Sends an output signal to control external devices or other robots.
o Syntax Example: SIGNAL OUTPUT 2 = ON
o Use Cases: Activating a gripper, triggering a conveyor belt.
o Advantages: Enables communication with peripherals, supports automation.
o Disadvantages: Requires proper hardware setup, potential for signal errors.
DELAY Command:
o Introduces a fixed time pause in program execution.
o Syntax Example: DELAY 2.5 (pauses for 2.5 seconds)
o Use Cases: Allowing time for mechanical settling, cooling, or process completion.
o Advantages: Simple, predictable timing.
o Disadvantages: Inflexible, can slow down operations unnecessarily.
3. Subroutines
Subroutines are reusable blocks of code that perform specific tasks, improving modularity and efficiency in
robot programs.
Definition: A named sequence of instructions that can be called multiple times within a program.
Characteristics:
o Reduces code duplication.
o Simplifies debugging and maintenance.
o Can accept parameters for flexibility (e.g., position coordinates).
Syntax Example (Pseudocode):
SUBROUTINE MoveToPosition(x, y, z)
MOVE TO POINT(x, y, z)
DELAY 0.5
END
CALL MoveToPosition(100, 200, 50)
Advantages:
o Enhances code readability and organization.
o Saves memory and development time.
o Facilitates complex task decomposition.
Disadvantages:
o Overhead in calling/returning (minimal in modern systems).
o Requires careful parameter management to avoid errors.
Applications: Repetitive tasks (e.g., pick-and-place), modular control of robot functions.
4. Programming Languages for Robotics
Generations of Robotic Languages
First Generation (1970s):
o Low-level, machine-specific languages.
o Characteristics: Direct hardware control, limited abstraction, manual motion programming.
o Examples: WAVE, early teach pendant scripts.
o Limitations: Time-consuming, non-portable, error-prone.
Second Generation (1980s):
o Structured, high-level languages with motion and task primitives.
o Characteristics: Support for variables, loops, conditionals; vendor-specific.
o Examples: VAL, RAIL, AML.
o Limitations: Limited portability, tied to specific robot models.
Third Generation (1990s–2000s):
o General-purpose languages adapted for robotics.
o Characteristics: Object-oriented, modular, support for simulation and integration.
o Examples: C++, Python, Java.
o Limitations: Requires additional libraries for robot-specific tasks.
Fourth Generation (2000s–Present):
o Framework-based, open-source ecosystems.
o Characteristics: Middleware for distributed systems, high abstraction, cross-platform.
o Examples: ROS (Robot Operating System), YARP.
o Limitations: Steep learning curve, computational overhead.
Introduction to Various Robotic Languages
VAL (Variable Assembly Language):
o Developed by Unimation for PUMA robots (1980s).
o Features: Motion control, I/O handling, simple syntax for industrial tasks.
o Example: MOVE TO P1; WAIT INPUT 1 = ON
o Advantages: Easy for industrial robots, precise motion control.
o Disadvantages: Limited to Unimation robots, outdated.
o Applications: Assembly, material handling.
RAIL (Robotic Assembly and Inspection Language):
o Developed by Automatix for vision-guided robots (1980s).
o Features: Vision integration, task-level programming, structured syntax.
o Example: IF [Link] = TRUE THEN GRASP
o Advantages: Strong for vision-based tasks, flexible.
o Disadvantages: Vendor-specific, limited adoption.
o Applications: Inspection, pick-and-place with vision.
AML (A Manufacturing Language):
o Developed by IBM for robotic manufacturing (1980s).
o Features: Hierarchical control, data structures, complex task planning.
o Example: MOVE(ARM, POINT(10, 20, 30))
o Advantages: Powerful for complex tasks, modular.
o Disadvantages: Complex syntax, limited to IBM systems.
o Applications: Precision manufacturing, research.
Python:
o General-purpose language widely used in robotics (2000s–present).
o Features: Simple syntax, extensive libraries (e.g., NumPy, OpenCV), ROS integration.
o Example:
o import rospy
o rospy.init_node('robot_control')
o Advantages: Versatile, beginner-friendly, cross-platform.
o Disadvantages: Slower execution, not ideal for real-time control.
o Applications: Research, prototyping, AI-driven robots.
ROS (Robot Operating System):
o Open-source framework, not a true OS (2007–present).
o Features: Middleware for communication, modular nodes, tools for simulation (Gazebo).
o Example:
o rosrun my_package control_node
o Advantages: Scalable, supports diverse robots, large community.
o Disadvantages: Complex setup, resource-intensive.
o Applications: Autonomous robots, research, industrial systems.
Development of Languages from WAVE to ROS
WAVE (1973):
o First robotic language, developed at Stanford for the Stanford Arm.
o Features: Basic motion control, joint-level programming.
o Limitations: Low-level, no task abstraction, specific to one robot.
o Impact: Pioneered robotic programming, inspired future languages.
AL (1974–1980s):
o Developed at Stanford, successor to WAVE.
o Features: Task-level programming, concurrent control of multiple arms.
o Limitations: Research-focused, not widely adopted industrially.
o Impact: Introduced structured programming concepts.
VAL/VAL-II (1980s):
o Commercial language by Unimation for PUMA robots.
o Features: Motion primitives, I/O control, teach pendant integration.
o Limitations: Tied to Unimation hardware, limited flexibility.
o Impact: Standardized industrial robot programming.
RAIL and AML (1980s):
o Focused on vision and manufacturing tasks, respectively.
o Features: Task-specific abstractions, structured syntax.
o Limitations: Vendor lock-in, niche adoption.
o Impact: Advanced task-level programming.
KRL, RAPID, and Others (1990s):
o Vendor-specific languages (e.g., KUKA’s KRL, ABB’s RAPID).
o Features: High-level control, integration with industrial systems.
o Limitations: Non-portable, proprietary.
o Impact: Dominated industrial robotics.
C++ and Python (1990s–2000s):
o General-purpose languages adapted for robotics.
o Features: Libraries for kinematics, vision, and control.
o Limitations: Required custom frameworks for robot integration.
o Impact: Enabled research and prototyping.
ROS (2007–Present):
o Open-source framework by Willow Garage, now Open Robotics.
o Features: Distributed architecture, cross-robot compatibility, simulation tools.
o Limitations: Complex for beginners, not real-time by default.
o Impact: Revolutionized robotics by enabling modularity, collaboration, and rapid
development.
5. Key Points for Exam/Understanding
Programming Methods: Choose based on task complexity and robot type; offline and text-based
dominate modern robotics.
WAIT/SIGNAL/DELAY: Essential for timing and synchronization; understand their role in
industrial programs.
Subroutines: Improve modularity; critical for reusable, maintainable code.
Language Generations: Evolved from low-level (WAVE) to framework-based (ROS); know key
features and limitations.
Specific Languages: VAL/RAIL/AML for industrial tasks, Python/ROS for modern flexibility; ROS
is a game-changer.
Language Evolution: From hardware-specific (WAVE) to open-source ecosystems (ROS); driven
by abstraction and portability needs.