xacro-rs

Crates.ioxacro-rs
lib.rsxacro-rs
version0.2.1
created_at2026-01-25 03:25:55.17782+00
updated_at2026-01-25 20:39:02.288599+00
descriptionA xml preprocessor for xacro files to generate URDF files
homepagehttps://github.com/kaidokert/xacro
repositoryhttps://github.com/kaidokert/xacro
max_upload_size
id2068038
size1,002,073
Kaido Kert (kaidokert)

documentation

https://docs.rs/xacro-rs

README

xacro-rs

crate documentation Build and test Coverage Status License: MIT

An XML preprocessor for xacro files to generate URDF files

Reference: http://wiki.ros.org/xacro

Installation

As a library

cargo add xacro-rs

As a command-line tool

cargo install xacro-rs

Usage

Command-line tool

Process a xacro file:

xacro-rs robot.xacro > robot.urdf

With arguments:

xacro-rs robot.xacro robot_name:=myrobot wheel_radius:=0.5

From stdin:

cat robot.xacro | xacro-rs - > robot.urdf

See xacro-rs --help for all options.

Library usage

See the examples/ directory for runnable examples including:

  • Basic file processing
  • Processing from stdin
  • Using arguments and the builder API
  • Custom extensions
  • Generic XML macros (non-ROS usage)

API documentation: https://docs.rs/xacro-rs

Status

Core xacro functionality implemented:

  • macro
  • include
  • insert_block
  • property
  • if
  • unless
  • load_yaml
  • Basic Python expression evaluation (see limitations)
  • Extensions: $(find), $(env), $(optenv), $(cwd)

Not implemented:

  • element (dynamic XML generation)
  • attribute (dynamic attributes)

See KNOWN_ISSUES.md for limitations and deviations from Python xacro.

No ROS dependencies required. Package resolution via RUST_XACRO_PACKAGE_MAP environment variable.

Commit count: 141

cargo fmt