URDF & Xacro Robot Kinematics
ModelScript provides first-class support for URDF (.urdf) and Xacro (.xacro), the robotics industry and ROS (Robot Operating System) standard for describing kinematic trees, inertial properties, visual geometry, and joint limits of robotic manipulators, humanoids, and autonomous vehicles.
Capabilities & Supported Formats
| Format | Extension | Description |
|---|---|---|
| Unified Robot Description Format | .urdf, .xml | XML schema defining kinematic links, joints (revolute, continuous, prismatic, fixed, floating, planar), inertial parameters, collision bounds, and visual meshes. |
| Xacro Macro Template | .xacro | Parametric XML preprocessor adding variables (<xacro:property>), mathematical expressions, and reusable macros (<xacro:macro>). |
Key Architectural Features
- Xacro Expansion & Parser:
- Robust XML reader with automatic in-memory macro expansion (
<xacro:macro>) and mathematical expression evaluation before parsing. - Generates strongly typed robot AST representation via
parseUrdf().
- Robust XML reader with automatic in-memory macro expansion (
- Topological Kinematic Tree & Featherstone Algorithms:
- Traverses joint-link connectivity starting from the root base link.
- Implements Recursive Newton-Euler Algorithm (RNEA) for inverse dynamics: calculates required joint torques
given joint positions , velocities , and accelerations . - Implements Articulated-Body Algorithm (ABA) for forward dynamics: evaluates forward acceleration
in operations.
- Robotics Linters (
M7501–M7508):- Detects dangling parent/child link references, disconnected kinematic sub-trees, inverted joint limits (
lower > upper), zero joint axis vectors, missing inertia tags, and non-physical inertia tensors.
- Detects dangling parent/child link references, disconnected kinematic sub-trees, inverted joint limits (
- Multi-Target Projections:
- Modelica MultiBody: Synthesizes
Modelica.Mechanics.MultiBodyrobotic arms with joint friction and actuator controllers. - MSC Adams: Exports Adams
.admsolver datasets. - SIMPACK: Generates SIMPACK
.spckmechanisms. - 3D CAD: Projects robot geometry into CSG primitives and STEP visual meshes.
- Modelica MultiBody: Synthesizes
Command Line Interface (msx urdf)
bash
msx urdf <action> [files...] [options]| Action | Description | Key Options |
|---|---|---|
lint | Runs kinematic tree validation, joint limit checks, and inertia verification. | — |
rnea | Evaluates inverse dynamics (RNEA) at test joint coordinates. | --gravity |
to-modelica | Generates standard Modelica.Mechanics.MultiBody robot system. | --out=<file.mo> |
to-adams | Projects robot mechanism into MSC Adams .adm solver dataset. | --out=<file.adm> |
to-simpack | Projects robot mechanism into SIMPACK XML .spck model. | --out=<file.spck> |
to-dae | Lowers kinematic state equations directly into DAEBuilder arena. | — |
Examples
bash
# Evaluate inverse dynamics (RNEA) at test joint coordinates
msx urdf rnea KukaIiwa14.urdf
# Check for inverted joint limits or dangling parent links
msx urdf lint MobileManipulator.urdf
# Convert robot description into standard Modelica 3.x
msx urdf to-modelica PandaArm.urdf --out=PandaArm.mo
# Export to MSC Adams for vehicle-mounted robot simulation
msx urdf to-adams RoverArm.urdf --out=RoverArm.admRobotics Linters & Diagnostic Rules
8 rules5 error3 warning Run with msx lint
| Code | Rule | Severity | Message |
|---|---|---|---|
M7501 | unresolved-parent-link | error | Joint '<jointName>' references non-existent parent link '<linkName>'. |
M7502 | kinematic-loop | error | Closed kinematic chain or duplicate parent detected at link '<linkName>' (URDF requires open tree). |
M7503 | invalid-inertia-tensor | error | Link '<linkName>' defines non-physical inertia tensor: <reason>. |
M7504 | invalid-joint-limits | error | Joint '<jointName>' defines invalid limits (lower: <lower> >= upper: <upper>). |
M7505 | missing-mesh-resource | warning | Visual mesh URI '<uri>' on link '<linkName>' may not resolve at runtime. |
M7506 | massless-link | warning | Link '<linkName>' has zero mass and no inertial specification. |
M7507 | zero-norm-joint-axis | error | Joint '<jointName>' defines a zero-norm rotation/translation axis [0, 0, 0]. |
M7508 | continuous-joint-with-limits | warning | Joint '<jointName>' is declared 'continuous' but specifies upper/lower limits. |
Generated from languages/urdf/src/errors.ts. All languages →

