Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix LocalCache so that models/worlds downloaded via fuel.ignitionrobotics.org can be found in the cache #406

Merged
merged 1 commit into from
Mar 18, 2024

Conversation

azeey
Copy link
Contributor

@azeey azeey commented Mar 16, 2024

🦟 Bug fix

Fixes gazebosim/gz-sim#2281

Summary

LocalCache::MatchingModel and LocalCache::MatchingWorld are used to determine if a given Fuel URL is in the local cache. These functions used LocalCache::AllModels to get a list of all known models/worlds and compare them to the requested Fuel URL. The problem is that LocalCache::AllModel would only look for models/worlds in a predetermined directory, <cache location>/fuel.gazebosim.org:

for (auto &server : this->dataPtr->config->Servers())
{
std::string path = common::joinPaths(
this->dataPtr->config->CacheLocation(), uriToPath(server.Url()));

However, since the argument to MatchingModel/MatchingWorld would already have the server URL, we shouldn't have to look through AllModels. This patch uses the path common::joinPaths( this->dataPtr->config->CacheLocation(), uriToPath(_id.Server().Url())); to look for models/worlds. The side effect of this is that Fuel URLs that use fuel.ignitionrobotics.org now work.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

…otics.org can be found in the cache

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@azeey azeey requested a review from nkoenig as a code owner March 16, 2024 03:22
@github-actions github-actions bot added the 🎵 harmonic Gazebo Harmonic label Mar 16, 2024
@azeey azeey merged commit f379bd7 into gazebosim:gz-fuel-tools9 Mar 18, 2024
9 checks passed
@azeey azeey deleted the fix_local_cache branch March 18, 2024 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎵 harmonic Gazebo Harmonic
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Unable to load example worlds from main menu.
2 participants