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
-
Install ROS Humble or higher
-
Clone this repository:
mkdir -p ~/ws/src
cd ~/ws/src
git clone https://github.com/chapulina/desplate
- Install dependencies:
cd ~/ws
rosdep install --from-paths src --ignore-src -r -y
- Build and install:
cd ~/ws
colcon build
- Run one of the examples, i.e.:
ros2 launch desplate_empy vehicle_sdf_generate.launch.py
-
You should see a differential drive robot (like dolly) on RViz:
-
Also try checking the inertia visualization:
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:
-
Install all template files, i.e.:
https://github.com/chapulina/desplate/blob/86b7960169b02fc4fbd4765f9fe9e1342af3ac33/desplate_empy/CMakeLists.txt#L39-L46
-
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
-
Use the templating engine to generate a file and store it in a string variable.
File truncated at 100 lines see the full file