# Cobot Programming Guide 2026: URScript vs ROS 2 vs AI Natural Language
A Universal Robots UR5e can be programmed through a drag-and-drop polyscope interface, raw URScript text files, ROS 2 nodes, or — as of 2025 — natural language prompts that generate motion sequences. Which approach is right depends entirely on what you're building.
This guide compares the major cobot programming paradigms with actual code examples, so you can make an informed decision before committing to a platform.
---
The Four Programming Paradigms
1. Teach Pendant / GUI (Polyscope, iHMI, etc.)
Every cobot ships with a tablet-based teach pendant. Universal Robots' Polyscope is the most mature. You build programs by chaining blocks: MoveJ, MoveL, Wait, If/Else, Force, Script.
Best for: Operators with no programming background. Simple pick-and-place, palletizing, basic welding.
Limitations: Complex conditional logic becomes unwieldy. Vision integration requires dropping into URScript anyway. Version control is painful.
Typical programming time: A simple pick-and-place: 2–4 hours. A vision-guided bin-picking cell: 2–3 days.
2. Text-Based OEM Languages (URScript, RAPID, KRL, Karel)
Each major cobot OEM has a proprietary scripting language:
- URScript (Universal Robots) — Python-inspired, runs on the robot controller
- RAPID (ABB) — modular, with strong data type handling
- KRL (KUKA) — C-like syntax, mature but verbose
- Karel (FANUC) — Pascal-based, powerful but dated
- INFORM (Yaskawa) — aging but deeply integrated with Yaskawa hardware
URScript example — simple force-limited screw insertion:
```python
def screw_insert(target_pose, force_limit=15):
# Move to approach position
movel(pose_add(target_pose, p[0,0,0.05,0,0,0]), a=1.2, v=0.15)
# Force-controlled insertion
force_mode(
task_frame=p[0,0,0,0,0,0],
selection_vector=[0,0,1,0,0,0],
wrench=[0,0,-force_limit,0,0,0],
type=2,
limits=[0.1,0.1,0.01,0.3,0.3,0.3]
)
# Rotate to drive screw
movel(pose_add(target_pose, p[0,0,-0.012,0,0,3.14]), a=0.5, v=0.02)
end_force_mode()
end
```
Best for: Production applications where you need deterministic performance. Direct hardware access. No ROS dependency.
Limitations: OEM-proprietary — skills don't transfer between brands. Limited standard library.
3. ROS 2 Integration
Robot Operating System 2 (ROS 2 Jazzy, released 2024) is the standard for research and increasingly for production systems requiring sensor fusion, multi-robot coordination, or AI integration.
All major cobots support ROS 2 via ros2_control hardware interfaces:
- Universal Robots:
Universal_Robots_ROS2_Driver(official, maintained by UR) - FANUC:
fanuc_ros2(community + FANUC Labs) - Kuka:
kuka_ros2(official) - ABB:
abb_ros2(official, uses OmniCore controller)
ROS 2 Python example — MoveIt 2 motion planning:
```python
import rclpy
from moveit.core.robot_state import RobotState
from moveit.planning import MoveItPy
def main():
rclpy.init()
robot = MoveItPy(node_name="ur5e_planner")
arm = robot.get_planning_component("ur_manipulator")
# Plan to named pose
arm.set_start_state_to_current_state()
arm.set_goal_state(configuration_name="home")
plan_result = arm.plan()
if plan_result:
robot.execute(plan_result.trajectory, controllers=["joint_trajectory_controller"])
rclpy.shutdown()
```
Best for: Research, multi-robot systems, AI/ML integration, applications requiring SLAM or complex perception pipelines.
Limitations: Steep learning curve. ROS 2 overhead introduces latency unsuitable for high-frequency control (>500 Hz). Production reliability requires careful system engineering.
Real-world adoption: A 2025 survey of industrial ROS 2 deployments found 34% in warehousing/logistics, 28% in manufacturing research, 22% in academic labs, 16% in production cells.
4. AI Natural Language Programming (2025–2026)
This is the fastest-evolving area. Several approaches are now production-ready:
Universal Robots AI Accelerator (launched late 2024): Accepts task descriptions and generates URScript. Example prompt: *"Pick items from conveyor A and place them in box positions 1–6 in a 2×3 grid on conveyor B. Leave 10mm gaps between items."*
Machina Labs and similar startups use LLM + simulation to generate robot programs for novel tasks, with human review before execution.
Figure AI and Physical Intelligence (π) are building end-to-end neural policies — but these are not yet production-ready for SME manufacturing.
Current limitations of AI programming:
- Works well for motion sequences; struggles with complex conditional logic
- Generated programs require expert review — don't deploy without testing
- Force/compliance tasks still require manual tuning
- Collision-free path planning from language is unreliable without simulation validation
Expected timeline: AI programming for standard tasks (pick-and-place, palletizing, machine tending) will be reliable for non-expert use by 2027–2028 per consensus industry forecast.
---
Platform Comparison Matrix
| Criterion | Teach Pendant | OEM Script | ROS 2 | AI NL |
|---|---|---|---|---|
| Learning curve | Low | Medium | High | Very Low |
| Flexibility | Low | High | Very High | Medium |
| Production reliability | High | Very High | Medium-High | Low-Medium |
| AI/ML integration | None | Limited | Excellent | Native |
| Multi-robot coordination | Poor | Limited | Excellent | Developing |
| Vendor lock-in | High | Very High | Low | Medium |
| Typical programmer | Operator | Engineer | Developer/Researcher | Operator |
| Best application | Simple tasks | Production | Research/Warehouse | Rapid prototyping |
---
Choosing the Right Approach for Your Application
Machine Tending (CNC, injection molding)
Use OEM scripting (URScript/RAPID) for production. Teach pendant for initial setup. Precise, repeatable motion matters more than flexibility.
Palletizing
Teach pendant for simple patterns. URScript for complex mixed-SKU logic. Consider collaborative robots specifically designed for palletizing with built-in pattern generators.
Assembly with Force Feedback
OEM scripting gives direct access to force_mode APIs. ROS 2 for integration with vision and multi-step assembly sequences tracked in state machines.
Warehouse Mobile Manipulation
ROS 2 is essentially required — SLAM navigation, sensor fusion, MoveIt 2 for arm control, fleet management integration.
Welding
OEM scripting with touch sensing and arc monitoring APIs. Welding cobots (FANUC CRX Welding, UR Welding packages) have pre-built libraries.
---
Development Environment Setup
URScript Development
- Download URSim (Universal Robots simulator) — free, runs on Linux/Docker
- Connect VS Code with the UR extension for syntax highlighting
- Use
socket_send_string()for RTDE data streaming during development - RTDE (Real-Time Data Exchange) for external control at 500 Hz
ROS 2 Development
- Install ROS 2 Jazzy on Ubuntu 24.04
- Clone the relevant OEM ROS 2 driver
- Use Gazebo Harmonic for simulation before touching hardware
- MoveIt 2 for motion planning with OMPL backend
Testing Before Deployment
Always:
- Test with reduced speed (10–25%) before full-speed operation
- Verify force limits in force_mode applications with a load cell
- Run 1,000+ cycle endurance test before go-live
- Document all waypoints with semantic names, not just coordinate arrays
---
Skills That Transfer Across Platforms
Regardless of which OEM you choose, these fundamentals transfer:
- Coordinate frames: World frame, tool frame, user frame transforms
- Motion types: Joint motion (MoveJ) vs linear Cartesian motion (MoveL) vs circular (MoveC)
- Force/impedance control: Concepts transfer even if API calls differ
- Vision integration: Camera calibration (hand-eye), coordinate transform from image to robot frame
- Safety PLC integration: Safe I/O, safety-rated speed/force monitoring
---
Resources
- Universal Robots Academy: free online cobot programming courses (urrobotics.com/academy)
- ROS 2 Documentation: docs.ros.org/en/jazzy
- MoveIt 2 Tutorials: moveit.ros.org
- FANUC ROBOGUIDE: offline programming and simulation environment
For pricing context on the robots you'll be programming, see our delta robot price guide or use the Robot ROI Calculator to model the business case before committing to a platform.


