Add a new Git repository to the message registry for automatic message type loading. Use when the user wants to support message types from a new ROS2 repository, or when adding support for a new message package.
This skill guides you through adding a new Git repository to the zenoh_ros2_sdk/_repositories.py file to enable automatic message type loading.
First, identify the repository URL and explore its structure to find message packages.
The user may provide:
https://github.com/ros2/geometry2.git)geometry2)tf2_msgs)Use curl to check the repository structure:
# List all directories in the repository
curl -s https://api.github.com/repos/ros2/geometry2/contents | \
python3 -c "import sys, json; data = json.load(sys.stdin); \
dirs = [item['name'] for item in data if item['type'] == 'dir']; \
print('\n'.join(sorted(dirs)))"
Check which directories contain message definitions:
# Check if a package has a msg directory
curl -s https://api.github.com/repos/ros2/geometry2/contents/tf2_msgs | \
python3 -c "import sys, json; data = json.load(sys.stdin); \
print('\n'.join([item['name'] for item in data if item['type'] == 'dir']))"
Check what messages are in a package:
# List .msg files in a package
curl -s https://api.github.com/repos/ros2/geometry2/contents/tf2_msgs/msg | \
python3 -c "import sys, json; data = json.load(sys.stdin); \
msgs = [item['name'] for item in data if item['name'].endswith('.msg')]; \
print('\n'.join(sorted(msgs)))"
Identify the repository layout pattern:
Structure: <repo_root>/<package>/msg/<message>.msg
common_interfaces, rcl_interfaces, geometry2msg/ directoryStructure: <repo_root>/msg/<message>.msg or <repo_root>/<package>/msg/<message>.msg
example_interfacesChoose an appropriate commit or tag:
jazzy, iron, humble) for consistency with other repositoriesjazzy to match existing repositories (rcl_interfaces, common_interfaces, example_interfaces, geometry2)rolling branch only if you need latest development featuresCheck available tags:
curl -s https://api.github.com/repos/ros2/geometry2/tags | \
python3 -c "import sys, json; data = json.load(sys.stdin); \
print('\n'.join([tag['name'] for tag in data[:10]]))"
Edit zenoh_ros2_sdk/_repositories.py and add a new entry to MESSAGE_REPOSITORIES:
# Repository name (descriptive, matches repo name)
"repository_name": MessageRepository(
url="https://github.com/ros2/repository_name.git",
commit="jazzy", # Use jazzy for consistency with other repositories
cache_path="repository_name", # Local cache directory name
msg_path="", # Empty for standard structure: <package>/msg/<message>.msg
packages=[
"package1", # List all message packages in this repository
"package2",
# ... more packages
],
),
"package_name": MessageRepository(
url="https://github.com/ros2/package_name.git",
commit="jazzy", # Use jazzy for consistency, or specific tag/commit
cache_path="package_name",
msg_path="", # Adjust if messages are at repo root vs package subdirectory
packages=[
"package_name", # Single package
],
),
# Geometry2 (contains tf2_msgs and other TF2-related packages)
# This repository contains TF2 transform message definitions
# Reference: https://github.com/ros2/geometry2
"geometry2": MessageRepository(
url="https://github.com/ros2/geometry2.git",
commit="jazzy", # Use specific commit/tag for reproducibility
cache_path="geometry2",
msg_path="", # Messages are at <package>/msg/<message>.msg
packages=[
"tf2_msgs", # Contains TFMessage, TF2Error messages
],
),
The PACKAGE_TO_REPOSITORY mapping is automatically generated at the bottom of the file. Verify it includes your new packages:
# Mapping from message package namespace to repository name
PACKAGE_TO_REPOSITORY: Dict[str, str] = {}
for repo_name, repo in MESSAGE_REPOSITORIES.items():
for package in repo.packages:
PACKAGE_TO_REPOSITORY[package] = repo_name
This ensures packages like tf2_msgs map to geometry2 repository.
Run linting to ensure code quality:
# Check for linting errors
# (The linter will automatically check when you edit the file)
Verify the repository works by testing message loading:
from zenoh_ros2_sdk import load_message_type, get_message_class
# Load a message type from the new repository
load_message_type("tf2_msgs/msg/TFMessage")
TFMessage = get_message_class("tf2_msgs/msg/TFMessage")
if TFMessage:
print("Successfully loaded message from new repository!")
rcl_interfaces - Core ROS2 interfaces (builtin_interfaces, action_msgs, etc.)common_interfaces - Standard messages (std_msgs, geometry_msgs, sensor_msgs, etc.)example_interfaces - Example messages and servicesgeometry2 - TF2 messages (tf2_msgs)ros2_interfaces - Additional ROS2 interfacesrosidl_defaults - Default message definitions~/.cache/zenoh_ros2_sdk/ (or $ZENOH_ROS2_SDK_CACHE)jazzy as the default commit tag to match existing repositories for consistency and reproducibilitySearch for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer