-

jacro package from jacro repo

jacro

Package Summary

Tags No category tags.
Version 0.2.0
License BSD
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/JafarAbdi/jacro.git
VCS Type git
VCS Version main
Last Updated 2024-11-13
Dev Status DEVELOPED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

TODO: Project Short Description

Additional Links

Maintainers

  • Jafar Uruc

Authors

  • Jafar Uruc

Jacro

Think “xacro” but with Jinja - we just swapped the “x” for “j”. Not the most creative naming! 🤷 Just a small wrapper around jinja2 - if you’re not using ROS 2, you probably want to use jinja2 directly!

Build Status

Usage

import jacro

jacro.process_text("Text {{ arg1 }}/{{ arg2 }}", mappings={"arg1": "value1", "arg2": "value2"})
jacro.process_file("filename.ext", mappings={"arg1": "value1", "arg2": "value2"})

You can use all functionality from jinja2 (even as a replacement to xacro itself!)

Custom functions

Currently, jacro have the following extra registered functions:

  • ros_pkg_path('pkg'): Will be replaces with the shared directory of ‘pkg’
urdf: {{ ros_pkg_path('my_robot_description') }} -> urdf: /path/to/my_robot_description/share/my_robot_description
urdf: {{ ros_pkg_path('std_msgs') }} -> urdf: /opt/ros/humble/share/std_msgs

Command-Line Interface

To save the output to a file, use the -o or --output option.

jacro input_filename -o output_filename arg1=value1 arg2=value2 ...

To print the output to the console

jacro input_filename arg1:=value_1 arg2:=[1, 2, 3] arg3:=["asd", "jafar"] ...

Linting

Using pre-commit

pre-commit run -a

Testing

Using pytest directly

python -m pytest --capture=no

Or using colcon

colcon build --packages-up-to jacro
colcon test --packages-select jacro
colcon test-result

CHANGELOG

Changelog for package jacro

0.2.0 (2024-11-13)

  • Replace minijinja with jinja2
  • Contributors: JafarAbdi

0.1.0 (2024-11-13)

  • Initial commit
  • Contributors: Jafar Uruç

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged jacro at Robotics Stack Exchange

No version for distro jazzy. Known supported distros are highlighted in the buttons above.
No version for distro rolling. Known supported distros are highlighted in the buttons above.
No version for distro noetic. Known supported distros are highlighted in the buttons above.
No version for distro ardent. Known supported distros are highlighted in the buttons above.
No version for distro bouncy. Known supported distros are highlighted in the buttons above.
No version for distro crystal. Known supported distros are highlighted in the buttons above.
No version for distro eloquent. Known supported distros are highlighted in the buttons above.
No version for distro dashing. Known supported distros are highlighted in the buttons above.
No version for distro galactic. Known supported distros are highlighted in the buttons above.
No version for distro foxy. Known supported distros are highlighted in the buttons above.
No version for distro iron. Known supported distros are highlighted in the buttons above.
No version for distro lunar. Known supported distros are highlighted in the buttons above.
No version for distro jade. Known supported distros are highlighted in the buttons above.
No version for distro indigo. Known supported distros are highlighted in the buttons above.
No version for distro hydro. Known supported distros are highlighted in the buttons above.
No version for distro kinetic. Known supported distros are highlighted in the buttons above.
No version for distro melodic. Known supported distros are highlighted in the buttons above.