Skip to content

Commit

Permalink
Merge branch 'ign-fuel-tools5' into chapulina/cache_docs
Browse files Browse the repository at this point in the history
  • Loading branch information
chapulina authored Dec 23, 2020
2 parents af10ad3 + c0ec7e9 commit 9e1d558
Show file tree
Hide file tree
Showing 27 changed files with 199 additions and 99 deletions.
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners

* @nkoenig
tutorials/* @maryaB-osr
2 changes: 1 addition & 1 deletion .github/ci/packages.apt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ libcurl4-openssl-dev
libgflags-dev
libignition-cmake2-dev
libignition-common3-dev
libignition-msgs5-dev
libignition-msgs6-dev
libignition-tools-dev
libjsoncpp-dev
libtinyxml2-dev
Expand Down
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.5.1 FATAL_ERROR)
#============================================================================
# Initialize the project
#============================================================================
project(ignition-fuel_tools4 VERSION 4.3.0)
project(ignition-fuel_tools5 VERSION 5.1.1)

#============================================================================
# Find ignition-cmake
Expand All @@ -15,7 +15,7 @@ set(IGN_CMAKE_VER ${ignition-cmake2_VERSION_MAJOR})
#============================================================================
# Configure the project
#============================================================================
ign_configure_project()
ign_configure_project(VERSION_SUFFIX)

#============================================================================
# Set project-specific options
Expand Down Expand Up @@ -52,8 +52,8 @@ set(IGN_COMMON_MAJOR_VER ${ignition-common3_VERSION_MAJOR})

#--------------------------------------
# Find ignition-msgs
ign_find_package(ignition-msgs5 REQUIRED PRIVATE)
set(IGN_MSGS_MAJOR_VER ${ignition-msgs5_VERSION_MAJOR})
ign_find_package(ignition-msgs6 REQUIRED PRIVATE)
set(IGN_MSGS_MAJOR_VER ${ignition-msgs6_VERSION_MAJOR})

#--------------------------------------
# Find ignition-tools
Expand Down
30 changes: 29 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,32 @@
## Ignition Fuel Tools 4.x
## Ignition Fuel Tools 5.x

### Ignition Fuel Tools 5.X.X (20XX-XX-XX)

### Ignition Fuel Tools 5.1.1 (2020-12-18)

1. Fix light map URI in materials
* [Pull request 146](https://github.com/ignitionrobotics/ign-fuel-tools/pull/146)

### Ignition Fuel Tools 5.1.0 (2020-12-09)

1. Includes all changes up to version 4.3.0.

### Ignition Fuel Tools 5.0.0 (2020-09-28)

1. Added support for annotation parsing during model creation.
* [Pull request 95](https://github.com/ignitionrobotics/ign-fuel-tools/pull/95)

1. Removed repeated installation instructions.
* [Pull request 101](https://github.com/ignitionrobotics/ign-fuel-tools/pull/101)

1. Update codeowners.
* [Pull request 108](https://github.com/ignitionrobotics/ign-fuel-tools/pull/108)

1. Hide Private headers and LocalCache.hh
* [Pull request 109](https://github.com/ignitionrobotics/ign-fuel-tools/pull/109)

1. Fixed test - Download world 2
* [Pull request 110](https://github.com/ignitionrobotics/ign-fuel-tools/pull/110)

### Ignition Fuel Tools 4.3.0 (2020-12-01)

Expand Down
26 changes: 7 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ignition Fuel Tools

** Classes and tools for interacting with Ignition Fuel **
**Classes and tools for interacting with Ignition Fuel**

Ignition Fuel Tools is composed by a client library and command line tools for
interacting with Ignition Fuel servers.
Expand All @@ -13,24 +13,13 @@ Test coverage reports are available at Codecov:

# Building and installing

```
cd ign-fuel-tools
mkdir build
cd build
cmake ..
make
make test
make install
```

Make sure `IGN_CONFIG_PATH` is set to the right install location`ign fuel` will work.
Default is `/usr/local/share/ignition`.
See the [installation tutorial](https://ignitionrobotics.org/api/fuel_tools/4.0/install.html).

## Examples

For a complete list of commands run `ign fuel -h` on the command line.

** List all models **
**List all models**
```
$ ign fuel list -t model -r | head
https://fuel.ignitionrobotics.org/anonymous/test_model_595389531
Expand All @@ -45,7 +34,7 @@ https://fuel.ignitionrobotics.org/anonymous/test_model_834617935
https://fuel.ignitionrobotics.org/anonymous/test_model_380348669
```

** Download a model **
**Download a model**
```
$ ign fuel download -u https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Ambulance -v 4
Downloading model:
Expand All @@ -58,7 +47,7 @@ Downloading model:
Download succeeded.
```

** C++ Get List models **
**C++ Get List models**
```
// Create a client (uses https://fuel.ignitionrobotics.org by default)
ignition::fuel_tools::ClientConfig conf;
Expand All @@ -70,7 +59,7 @@ Download succeeded.
}
```

** Upload a model **
**Upload a model**

Create an account on
[https://app.ignitionrobotics.org/](https://app.ignitionrobotics.org/) and log
Expand Down Expand Up @@ -104,7 +93,7 @@ Note that the `upload` command only works for models currently, not worlds.

See issues beginning with [Fuel backend] in the title. Here are two examples.

** TODO: Find a model on disk **
**TODO: Find a model on disk**
```
$ ign fuel locate --name am1
/home/developer/.ignition/fuel/fuel.ignitionrobotics.org/alice/am1
Expand Down Expand Up @@ -191,4 +180,3 @@ export IGN_CONFIG_PATH=$HOME/.ignition/tools/configs
```

This issue is tracked [here](https://github.com/ignitionrobotics/ign-tools/issues/8).

20 changes: 10 additions & 10 deletions bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pipelines:
libignition-cmake2-dev
libignition-common3-dev
libignition-math6-dev
libignition-msgs5-dev
# libignition-msgs5-dev
# Ignition tools
- git clone http://github.com/ignitionrobotics/ign-tools -b master
- cd ign-tools
Expand All @@ -28,15 +28,15 @@ pipelines:
- make -j4 install
- cd ../..
# # Ignition msgs
# - apt-get -y install
# libprotobuf-dev protobuf-compiler libprotoc-dev libtinyxml2-dev
# - git clone http://github.com/ignitionrobotics/ign-msgs -b master
# - cd ign-msgs
# - mkdir build
# - cd build
# - cmake ..
# - make -j4 install
# - cd ../..
- apt-get -y install
libprotobuf-dev protobuf-compiler libprotoc-dev libtinyxml2-dev
- git clone http://github.com/ignitionrobotics/ign-msgs -b master
- cd ign-msgs
- mkdir build
- cd build
- cmake ..
- make -j4 install
- cd ../..
# Make sure ign-tools can find installed libs
- export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH
# Ignition Fuel Tools
Expand Down
2 changes: 1 addition & 1 deletion configure.bat
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ call %win_lib% :download_unzip_install libzip-1.4.0_zlip-1.2.11_vc15-x64-dll-MD.
call %win_lib% :install_ign_project ign-cmake ign-cmake2
call %win_lib% :install_ign_project ign-tools ign-tools1
call %win_lib% :install_ign_project ign-common ign-common3
call %win_lib% :install_ign_project ign-msgs ign-msgs5
call %win_lib% :install_ign_project ign-msgs master

:: Set configuration variables
@set build_type=Release
Expand Down
2 changes: 1 addition & 1 deletion example/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)

# Find the Ignition Fuel Tools library
find_package(ignition-fuel_tools4 QUIET REQUIRED)
find_package(ignition-fuel_tools5 QUIET REQUIRED)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${IGNITION-FUEL-TOOLS_CXX_FLAGS}")
include_directories(
${IGNITION-COMMON_INCLUDE_DIRS}
Expand Down
5 changes: 1 addition & 4 deletions include/ignition/fuel_tools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
ign_install_all_headers(
EXCLUDE_FILES
WorldIterPrivate.hh
)
ign_install_all_headers()
3 changes: 2 additions & 1 deletion include/ignition/fuel_tools/LocalCache.hh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ namespace ignition
{
/// \brief Constructor
/// \param[in] _config The configuration for the client
public: explicit LocalCache(const ClientConfig *_config);
public:
explicit IGN_DEPRECATED(5) LocalCache(const ClientConfig *_config);

/// \brief destructor
public: virtual ~LocalCache();
Expand Down
33 changes: 28 additions & 5 deletions src/FuelClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
#include "ignition/fuel_tools/JSONParser.hh"
#include "ignition/fuel_tools/LocalCache.hh"
#include "ignition/fuel_tools/ModelIdentifier.hh"
#include "ignition/fuel_tools/ModelIterPrivate.hh"
#include "ModelIterPrivate.hh"
#include "ignition/fuel_tools/RestClient.hh"
#include "ignition/fuel_tools/WorldIdentifier.hh"
#include "ignition/fuel_tools/WorldIterPrivate.hh"
#include "WorldIterPrivate.hh"

using namespace ignition;
using namespace fuel_tools;
Expand Down Expand Up @@ -231,9 +231,20 @@ FuelClient::FuelClient(const ClientConfig &_config, const Rest &_rest,
this->dataPtr->rest.SetUserAgent(this->dataPtr->config.UserAgent());

if (nullptr == _cache)
{
#ifndef _WIN32
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
this->dataPtr->cache.reset(new LocalCache(&(this->dataPtr->config)));
#ifndef _WIN32
# pragma GCC diagnostic pop
#endif
}
else
{
this->dataPtr->cache.reset(_cache);
}

this->dataPtr->urlModelRegex.reset(new std::regex(
this->dataPtr->kModelUrlRegexStr));
Expand Down Expand Up @@ -445,10 +456,24 @@ Result FuelClient::UploadModel(const std::string &_pathToModelDir,

if (resp.statusCode != 200)
{
std::string categories;
if (form.find("categories") != form.end())
{
categories = form.find("categories")->second;
}

ignerr << "Failed to upload model." << std::endl
<< " Server: " << _id.Server().Url().Str() << std::endl
<< " Server API Version: " << _id.Server().Version() << std::endl
<< " Route: /models\n"
<< " REST response code: " << resp.statusCode << std::endl;
<< " Categories: " << categories << std::endl
<< " REST response code: " << resp.statusCode
<< std::endl << std::endl
<< "Suggestions" << std::endl
<< " 1. Is the Server URL correct? Try entering it on a browser.\n"
<< " 2. Do the categories exist? If you are using the Fuel server,"
<< " then you can get the complete list at"
<< " https://fuel.ignitionrobotics.org/1.0/categories." << std::endl;
return Result(ResultType::FETCH_ERROR);
}

Expand Down Expand Up @@ -1418,7 +1443,6 @@ bool FuelClientPrivate::FillModelForm(const std::string &_pathToModelDir,
_form.emplace("tags", tags);

// Add categories
/* \todo: Uncomment in version 5.0
std::string categories;
if (meta.has_categories())
{
Expand All @@ -1437,7 +1461,6 @@ bool FuelClientPrivate::FillModelForm(const std::string &_pathToModelDir,
}
if (!categories.empty())
_form.emplace("categories", categories);
*/

// Add annotations as metadata.
for (const auto &annotation : meta.annotations())
Expand Down
4 changes: 2 additions & 2 deletions src/JSONParser_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
#include "ignition/fuel_tools/ClientConfig.hh"
#include "ignition/fuel_tools/JSONParser.hh"
#include "ignition/fuel_tools/ModelIter.hh"
#include "ignition/fuel_tools/ModelIterPrivate.hh"
#include "ignition/fuel_tools/WorldIter.hh"
#include "ignition/fuel_tools/WorldIterPrivate.hh"
#include "ModelIterPrivate.hh"
#include "WorldIterPrivate.hh"

using namespace ignition;
using namespace fuel_tools;
Expand Down
11 changes: 8 additions & 3 deletions src/LocalCache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@

#include "ignition/fuel_tools/ClientConfig.hh"
#include "ignition/fuel_tools/LocalCache.hh"
#include "ignition/fuel_tools/ModelIterPrivate.hh"
#include "ignition/fuel_tools/ModelPrivate.hh"
#include "ignition/fuel_tools/Zip.hh"
#include "ignition/fuel_tools/WorldIterPrivate.hh"

#include "ModelPrivate.hh"
#include "ModelIterPrivate.hh"
#include "WorldIterPrivate.hh"

using namespace ignition;
using namespace fuel_tools;
Expand Down Expand Up @@ -655,6 +656,10 @@ void LocalCachePrivate::FixPathsInMaterialElement(
workflowElem->FirstChildElement("emissive_map");
if (emissiveElem)
this->FixPathsInUri(emissiveElem, _id);
tinyxml2::XMLElement *lightElem =
workflowElem->FirstChildElement("light_map");
if (lightElem)
this->FixPathsInUri(lightElem, _id);
// metal workflow specific elements
if (workflow == "metal")
{
Expand Down
Loading

0 comments on commit 9e1d558

Please sign in to comment.