Repo symbol

desplate repository

Repo symbol

desplate repository

Repo symbol

desplate repository

Repo symbol

desplate repository

Repository Summary

Description Robot and world DEScription temPLATEs in ROS 2
Checkout URI https://github.com/chapulina/desplate.git
VCS Type git
VCS Version main
Last Updated 2022-10-18
Dev Status UNKNOWN
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
desplate_common 0.1.0
desplate_empy 0.1.0
desplate_erb 0.1.0
desplate_xacro 0.1.0

README

DEScription temPLATEs

This repository contains various examples for how to template description files in ROS 2. Each example demonstrates the use of a templating engine, with a description format, at compile time or launch time. All examples have the same final result, which makes it easy to compare them side-by-side.

Templating engines:

Description formats:

Is your engine or format of choice not represented? Consider opening a pull request to add it!

Quick start

  1. Install ROS Humble or higher

  2. Clone this repository:

    mkdir -p ~/ws/src
    cd ~/ws/src
    git clone https://github.com/chapulina/desplate
    
  1. Install dependencies:
    cd ~/ws
    rosdep install --from-paths src --ignore-src -r -y
    
  1. Build and install:
    cd ~/ws
    colcon build
    
  1. Run one of the examples, i.e.:
    ros2 launch desplate_empy vehicle_sdf_generate.launch.py
    
  1. You should see a differential drive robot (like dolly) on RViz:

    vehicle_rviz

  2. Also try checking the inertia visualization:

    vehicle_rviz

Try out all examples

Templating engine Format Stage Command
EmPy SDF launch ros2 launch desplate_empy vehicle_sdf_generate.launch.py
EmPy URDF launch ros2 launch desplate_empy vehicle_urdf_generate.launch.py
EmPy SDF compilation ros2 launch desplate_empy vehicle_sdf_installed.launch.py
EmPy URDF compilation ros2 launch desplate_empy vehicle_urdf_installed.launch.py
ERB SDF launch ros2 launch desplate_erb vehicle_sdf_generate.launch.py
ERB URDF launch ros2 launch desplate_erb vehicle_urdf_generate.launch.py
ERB SDF compilation ros2 launch desplate_erb vehicle_sdf_installed.launch.py
ERB URDF compilation ros2 launch desplate_erb vehicle_urdf_installed.launch.py
Xacro SDF launch ros2 launch desplate_xacro vehicle_sdf_generate.launch.py
Xacro URDF launch ros2 launch desplate_xacro vehicle_urdf_generate.launch.py
Xacro SDF compilation ros2 launch desplate_xacro vehicle_sdf_installed.launch.py
Xacro URDF compilation ros2 launch desplate_xacro vehicle_urdf_installed.launch.py

How it works

Launch time

Generating description files at launch time is convenient if you’re often iterating on parameters for those files. On the other hand, if your files aren’t changing much, consider generating them at compile time to save some time every time you launch.

Generate templates at launch file following these steps:

  1. Install all template files, i.e.:

    https://github.com/chapulina/desplate/blob/86b7960169b02fc4fbd4765f9fe9e1342af3ac33/desplate_empy/CMakeLists.txt#L39-L46

  2. In a launch file, get the path to the installed template file, for example:

    https://github.com/chapulina/desplate/blob/86b7960169b02fc4fbd4765f9fe9e1342af3ac33/desplate_empy/launch/vehicle_sdf_generate.launch.py#L30-L31

  3. Use the templating engine to generate a file and store it in a string variable.

File truncated at 100 lines see the full file

Repo symbol

desplate repository

Repo symbol

desplate repository

Repo symbol

desplate repository

Repo symbol

desplate repository