DEV Community

Arouna Mounchili
Arouna Mounchili

Posted on

Treating Robots as Code: Why We Built a Programmable IR for ROS 2

How LinkForge v1.4.0 moves beyond static XML (URDF/SRDF) to bring modern software engineering ergonomics to robotics simulation.

linkforge_v1_4_hero_hardened

If you work in robotics, you know the pain of the XML monolith.

For years, we’ve treated URDF and SRDF files like static, hand-written documents. We copy-paste coordinates, manually estimate inertia tensors, and attempt to fix broken collision models only after our simulator crashes.

A while ago, I wrote about how we stopped hand-coding URDFs by bridging Blender and ROS 2. That was a massive step forward for visual design. But as robots become increasingly modular, and as Embodied AI demands headless, parallel training loops, visual design is no longer enough.

Robotics needs modern software engineering ergonomics.

Today, we are releasing LinkForge v1.4.0, an architectural shift that treats robot descriptions not as static XML files, but as a programmable, physically-validated Intermediate Representation (IR).

Here is why we built it, and how it changes the workflow.


The Problem with "Robots as XML"

URDFs and SRDFs are essentially compiled executables for simulators. They were never meant to be source code.

When you attach a robotic arm to a mobile base by hand, you are manually merging two complex, highly sensitive state machines. You have to:

  1. Resolve joint name collisions.
  2. Manually shift geometric origins.
  3. Merge MoveIt 2 planning groups.
  4. Pray you didn't accidentally type a mass of 0.0, which will silently crash Gazebo on launch.

This workflow is brittle, error-prone, and entirely disconnected from modern CI/CD practices.


The Paradigm Shift: Validated Composition

With LinkForge v1.4.0, we introduced a fluent Python API that acts as an Intermediate Representation (IR). You define your parameters once, compose modules programmatically, and compile headlessly to URDF, SRDF, or your chosen simulation target.

Look at the difference between guessing your physics in XML, versus strictly validating them in Python:

xml vs python

Instead of manually editing SRDF files for motion planning, LinkForge provides a robust API to compose subsystems:

from linkforge.core import RobotBuilder

base = RobotBuilder("mobile_base")
# ... load base parameters ...

arm = RobotBuilder("manipulator")
# ... load arm parameters ...

# Safely attach the arm to the base
base.attach(arm, at_link="top_plate", prefix="left_arm_")
Enter fullscreen mode Exit fullscreen mode

Under the hood, the builder automatically re-namespaces conflicting joint names, shifts the topological tree, and seamlessly merges your MoveIt 2 semantic planning groups.


Mathematical Rigor: The Physics "Linter"

In standard workflows, you don't know your robot's physics are broken until the simulator rejects them. LinkForge introduces a RobotValidator that acts as a strict linter for rigid-body physics.

1. No More Guessing Inertia
Stop guessing your ixx, iyy, and izz values. LinkForge integrates Sylvester & Mirtich algorithms to calculate rigorous inertia tensors directly from your mesh geometry and mass.

2. Early Validation
The linter verifies kinematic trees for disconnected nodes, unintended loops, and non-physical inertia tensors. If a sub-assembly has a zero-mass link, the validator catches it and fails the build before you ever launch a simulation.


Headless Decoupling for Embodied AI

Perhaps the most important architectural change in v1.4.0 is the complete decoupling of linkforge-core.

We have fully separated the rigid-body core logic from the visual platforms (like Blender). This means you can now run the IR engine entirely headlessly on high-performance clusters.

If you are working in Reinforcement Learning or Embodied AI, you can programmatically generate, mutate, and validate thousands of robot morphologies (changing joint limits, mass, or geometries) inside parallel training loops with zero external UI dependencies.


Stop Editing XML. Start Compiling Robots.

Robotics is advancing too fast to be held back by fragile description files. By treating your robot as code, you unlock version control, continuous integration, and programmatic scale.

LinkForge is fully open-source and ready for your workflows.

🔗 Check out the repository on GitHub:
https://github.com/arounamounchili/linkforge

📦 Download on PyPI:
https://pypi.org/project/linkforge-core/

Or try it out immediately:

pip install linkforge-core
Enter fullscreen mode Exit fullscreen mode

I would love to hear your thoughts on this architecture! How are you currently managing your URDF/SRDF pipelines, and what pain points do you face when migrating from CAD to Simulation? Let's chat in the comments!

Top comments (0)