Hi everyone,
I’ve been working on a project to improve the developer experience when writing ROS 2 Jazzy launch files.
It provides JSON Schema for ROS 2 launch YAML, XSD for launch XML, and VS Code integration including auto-completion, validation, hover docs, and substitution snippets.
Repository
https://github.com/ok-tmhr/ros2_awesome
Features
1. YAML Schema for ROS 2 Launch Files
Provides full validation and auto-completion for:
-
launch:structure -
actions (
node,group,arg,set_env, etc.) -
parameters
-
substitutions
-
conditions (
if,unless)
Schema URL:
https://ok-tmhr.github.io/ros2_awesome/schema/launch.yaml
You can enable it by adding this at the top of your .launch.yaml:
# yaml-language-server: $schema=https://ok-tmhr.github.io/ros2_awesome/schema/launch.yaml
2. XML Schema (XSD) for launch XML
https://ok-tmhr.github.io/ros2_awesome/schema/launch_ros.xsd
Usage:
<launch
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://ok-tmhr.github.io/ros2_awesome/schema/launch_ros.xsd">
3. Substitution Snippets for VS Code
The repo includes a snippet extension (launch_substitution.json) that can be installed via:
It provides auto-completion for:
$(var ...)
$(env ...)
$(not ...)
$(eval ...)
Typing $ triggers suggestions.
4. Substitutions also work in parameter files
When a parameter YAML is loaded via a launch file, substitutions are evaluated:
my_node:
ros__parameters:
use_sim_time: $(var use_sim_time)
robot_name: $(env ROBOT_NAME)
This is supported by the schema and by the snippet extension.
5. Sample directory included
The sample/ directory contains working examples for both YAML and XML launch files.