From f7d63ba9684149a1bf6fa88a4e0a438a2df65be3 Mon Sep 17 00:00:00 2001 From: Louise Poubel Date: Fri, 17 Jul 2020 16:45:32 -0700 Subject: [PATCH 1/2] Backport support for s from Fuel Signed-off-by: Louise Poubel --- examples/worlds/fuel.sdf | 25 +++++++++++++++++++++++++ src/Server.cc | 2 ++ src/ServerPrivate.cc | 6 ++++++ src/ServerPrivate.hh | 5 +++++ src/gui/GuiRunner.cc | 6 ++++++ 5 files changed, 44 insertions(+) diff --git a/examples/worlds/fuel.sdf b/examples/worlds/fuel.sdf index 8c78cfdd84..cc29326e4d 100644 --- a/examples/worlds/fuel.sdf +++ b/examples/worlds/fuel.sdf @@ -120,19 +120,44 @@ + https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Double pendulum with base + 1 0 0 0 0 0 https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Backpack + 2 5 0 0 0 0 https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Gazebo - relative paths + + + 3 -1.5 0 0 0 0 + true + + + + + https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Radio/4/files/meshes/Radio.dae + + + + + + + https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Radio/4/files/meshes/Radio.dae + + + + + + diff --git a/src/Server.cc b/src/Server.cc index a1ab3879b3..8e0eff3545 100644 --- a/src/Server.cc +++ b/src/Server.cc @@ -97,6 +97,8 @@ Server::Server(const ServerConfig &_config) // Configure SDF to fetch assets from ignition fuel. sdf::setFindCallback(std::bind(&ServerPrivate::FetchResource, this->dataPtr.get(), std::placeholders::_1)); + common::addFindFileURICallback(std::bind(&ServerPrivate::FetchResourceUri, + this->dataPtr.get(), std::placeholders::_1)); sdf::Errors errors; diff --git a/src/ServerPrivate.cc b/src/ServerPrivate.cc index 78317c0652..1f49669602 100644 --- a/src/ServerPrivate.cc +++ b/src/ServerPrivate.cc @@ -418,3 +418,9 @@ std::string ServerPrivate::FetchResource(const std::string &_uri) } return path; } + +////////////////////////////////////////////////// +std::string ServerPrivate::FetchResourceUri(const common::URI &_uri) +{ + return this->FetchResource(_uri.Str()); +} diff --git a/src/ServerPrivate.hh b/src/ServerPrivate.hh index 297bc2303f..4f46c8d957 100644 --- a/src/ServerPrivate.hh +++ b/src/ServerPrivate.hh @@ -89,6 +89,11 @@ namespace ignition /// \return Path to the downloaded resource, empty on error. public: std::string FetchResource(const std::string &_uri); + /// \brief Fetch a resource from Fuel using fuel-tools. + /// \param[in] _uri The resource URI to fetch. + /// \return Path to the downloaded resource, empty on error. + public: std::string FetchResourceUri(const common::URI &_uri); + /// \brief Signal handler callback /// \param[in] _sig The signal number private: void OnSignal(int _sig); diff --git a/src/gui/GuiRunner.cc b/src/gui/GuiRunner.cc index ebca8316de..6d19354829 100644 --- a/src/gui/GuiRunner.cc +++ b/src/gui/GuiRunner.cc @@ -17,6 +17,7 @@ #include #include +#include #include // Include all components so they have first-class support @@ -34,6 +35,11 @@ GuiRunner::GuiRunner(const std::string &_worldName) this->setProperty("worldName", QString::fromStdString(_worldName)); this->stateTopic = "/world/" + _worldName + "/state"; + common::addFindFileURICallback([] (common::URI _uri) + { + return fuel_tools::fetchResource(_uri.Str()); + }); + igndbg << "Requesting initial state from [" << this->stateTopic << "]..." << std::endl; From 5cfdb58c9d26376da4d27b934cfe4937c5ce423f Mon Sep 17 00:00:00 2001 From: Louise Poubel Date: Wed, 22 Jul 2020 15:37:59 -0700 Subject: [PATCH 2/2] Fix action tests? Signed-off-by: Louise Poubel --- .github/ci-bionic/after_make.sh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .github/ci-bionic/after_make.sh diff --git a/.github/ci-bionic/after_make.sh b/.github/ci-bionic/after_make.sh new file mode 100644 index 0000000000..c35a06fad4 --- /dev/null +++ b/.github/ci-bionic/after_make.sh @@ -0,0 +1,6 @@ +#!/bin/sh -l + +set -x + +# Install +make install