Skip to content

utils: add RobotDescriptionCache for URDF download and mesh embedding#272

Open
abhichothani42 wants to merge 2 commits into
eef-04-examplesfrom
urdf-01-description-cache
Open

utils: add RobotDescriptionCache for URDF download and mesh embedding#272
abhichothani42 wants to merge 2 commits into
eef-04-examplesfrom
urdf-01-description-cache

Conversation

@abhichothani42

@abhichothani42 abhichothani42 commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR adds a small utility that resolves a robot name to its URDF, downloading and caching files locally, and optionally embeds all meshes as base64 data URIs so the resulting URDF is fully self-contained and portable.

Changes

  • Add RobotDescriptionCache::resolve(robot_name, urdf_variant, git_ref, include_meshes) — returns the URDF string for a robot, downloading from TrossenRobotics/trossen_arm_description at the given git ref on cache miss.
  • Files are cached under ~/.cache/trossen_sdk/robot_description/<git_ref>/ so repeated recordings never re-download.
  • With include_meshes=false, package:// mesh references are rewritten to absolute local cache paths (usable by Rerun on the same machine). With include_meshes=true, meshes are embedded as base64 data URIs (usable anywhere, including Foxglove).
  • Link libcurl into trossen_sdk and add libcurl4-openssl-dev to the CI dependencies.

Test Plan

  • Builds cleanly (make build)
  • Tests pass(make test)
  • Lint passes (pre-commit run --all-files)
  • Tested on hardware

Breaking Changes

None. New utility, not called by anything yet.

Related Issues

None.

abhichothani42 commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new RobotDescriptionCache utility in trossen_sdk to resolve a configured robot name (or explicit URDF path) into a URDF string by downloading from TrossenRobotics/trossen_arm_description, caching artifacts locally, and optionally embedding meshes/textures as base64 data URIs for portability.

Changes:

  • Add RobotDescriptionCache::resolve(...) implementation + public header.
  • Add libcurl as a required dependency and link it into trossen_sdk.
  • Update CI system dependencies to install libcurl4-openssl-dev.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
src/utils/robot_description_cache.cpp Implements download, cache, and URDF path rewriting / mesh embedding logic.
include/trossen_sdk/utils/robot_description_cache.hpp Declares the public API and documents behavior/config parameters.
CMakeLists.txt Adds the new source file and links CURL::libcurl into trossen_sdk.
.github/workflows/build.yml Installs libcurl4-openssl-dev in CI to satisfy the new dependency.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/utils/robot_description_cache.cpp
Comment on lines +84 to +86
{
auto cached = ref_cache_dir / rel_path;

Comment thread src/utils/robot_description_cache.cpp Outdated
Comment thread src/utils/robot_description_cache.cpp Outdated
Comment thread include/trossen_sdk/utils/robot_description_cache.hpp Outdated
Comment on lines +225 to +229
std::string RobotDescriptionCache::resolve(
const std::string& robot_name,
const std::string& urdf_variant,
const std::string& git_ref,
bool include_meshes)
Comment on lines +244 to +246
auto ref_cache_dir = cache_root() / git_ref;
std::filesystem::create_directories(ref_cache_dir);

@abhichothani42
abhichothani42 force-pushed the urdf-01-description-cache branch from 0f981e8 to 584b9d7 Compare July 17, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants