Skip to content

Commit

Permalink
openrobotics to OpenRobotics (#75)
Browse files Browse the repository at this point in the history
Signed-off-by: Nate Koenig <nate@openrobotics.org>

Co-authored-by: Nate Koenig <nate@openrobotics.org>
  • Loading branch information
nkoenig and Nate Koenig authored Jun 8, 2020
1 parent 9359dde commit 0f9aa4c
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 41 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ https://fuel.ignitionrobotics.org/anonymous/test_model_380348669
** Download a model **
```
$ ign fuel download -u https://fuel.ignitionrobotics.org/1.0/openrobotics/models/Ambulance -v 4
$ ign fuel download -u https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Ambulance -v 4
Downloading model:
Name: Ambulance
Owner: openrobotics
Owner: OpenRobotics
Server:
URL: https://fuel.ignitionrobotics.org
Version: 1.0
Expand Down
6 changes: 3 additions & 3 deletions example/details.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ int main(int argc, char **argv)
std::string usage("Show details of a resource.");
usage += " Usage:\n ./details <options>\n\n";
usage += " Example:\n"
"\t ./details -t model -o openrobotics -n Beer"
"\t ./details -t world -s https://localhost:4430 -o openrobotics -n Empty"
"\t ./details -c /tmp/my_config.yaml -o openrobotics -n Beer -t model";
"\t ./details -t model -o OpenRobotics -n Beer"
"\t ./details -t world -s https://localhost:4430 -o OpenRobotics -n Empty"
"\t ./details -c /tmp/my_config.yaml -o OpenRobotics -n Beer -t model";

gflags::SetUsageMessage(usage);

Expand Down
4 changes: 2 additions & 2 deletions example/download.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ int main(int argc, char **argv)
std::string usage("Download a resource.");
usage += " Usage:\n ./download <options>\n\n";
usage += " Examples:\n"
"\t ./download -t model -o openrobotics -n Beer\n"
"\t ./download -t model -o OpenRobotics -n Beer\n"
"\t ./download -s https://fuel.ignitionrobotics.org -t world "
"-o openrobotics"
"-o OpenRobotics"
" -n Empty\n"
"\t ./download -c /tmp/my_config.yaml -t model -o caguero -n Beer\n";

Expand Down
6 changes: 3 additions & 3 deletions include/ignition/fuel_tools/FuelClient.hh
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ namespace ignition
/// \brief Download a world from ignition fuel. This will override an
/// existing local copy of the world.
/// \param[in] _worldUrl The unique URL of the world to download.
/// E.g.: https://fuel.ignitionrobotics.org/1.0/openrobotics/worlds/Empty
/// E.g.: https://fuel.ignitionrobotics.org/1.0/OpenRobotics/worlds/Empty
/// \param[out] _path Path where the world was downloaded.
/// \return Result of the download operation.
public: Result DownloadWorld(const common::URI &_worldUrl,
Expand All @@ -199,15 +199,15 @@ namespace ignition

/// \brief Check if a world is already present in the local cache.
/// \param[in] _worldUrl The unique URL of the world on a Fuel server.
/// E.g.: https://fuel.ignitionrobotics.org/1.0/openrobotics/worlds/Empty
/// E.g.: https://fuel.ignitionrobotics.org/1.0/OpenRobotics/worlds/Empty
/// \param[out] _path Local path where the world can be found.
/// \return FETCH_ERROR if not cached, FETCH_ALREADY_EXISTS if cached.
public: Result CachedWorld(const common::URI &_worldUrl,
std::string &_path);

/// \brief Check if a world exists in the cache.
/// \param[in] _worldUrl The unique URL of the world on a Fuel server.
/// E.g.: https://fuel.ignitionrobotics.org/1.0/openrobotics/worlds/Empty
/// E.g.: https://fuel.ignitionrobotics.org/1.0/OpenRobotics/worlds/Empty
/// \return True if the world exists in the cache, false otherwise.
public: bool CachedWorld(const common::URI &_worldUrl);

Expand Down
2 changes: 1 addition & 1 deletion src/FuelClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class ignition::fuel_tools::FuelClientPrivate
"([0-9]*|tip)"};

/// \brief A world URL,
/// E.g.: https://fuel.ignitionrobotics.org/1.0/openrobotics/worlds/Empty/1
/// E.g.: https://fuel.ignitionrobotics.org/1.0/OpenRobotics/worlds/Empty/1
/// Where the API version and the world version are optional.
public: const std::string kWorldUrlRegexStr{
// Method
Expand Down
40 changes: 20 additions & 20 deletions src/FuelClient_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,13 @@ TEST_F(FuelClientTest, ParseModelFileURL)
ModelIdentifier id;
std::string filePath;
const common::URI modelUrl{
"https://fuel.ignitionrobotics.org/1.0/openrobotics/models/"
"https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/"
"Cordless Drill/tip/files/meshes/cordless_drill.dae"};
EXPECT_TRUE(client.ParseModelFileUrl(modelUrl, id, filePath));

EXPECT_EQ(id.Server().Url().Str(), "https://fuel.ignitionrobotics.org");
EXPECT_EQ(id.Server().Version(), "1.0");
EXPECT_EQ(id.Owner(), "openrobotics");
EXPECT_EQ(id.Owner(), "OpenRobotics");
EXPECT_EQ(id.Name(), "Cordless Drill");
EXPECT_EQ(filePath, "meshes/cordless_drill.dae");
}
Expand All @@ -306,13 +306,13 @@ TEST_F(FuelClientTest, ParseModelFileURL)
ModelIdentifier id;
std::string filePath;
const common::URI modelUrl{
"https://fuel.ignitionrobotics.org/1.0/openrobotics/models/Pine Tree/tip/"
"https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Pine Tree/tip/"
"files/materials/scripts/pine_tree.material"};
EXPECT_TRUE(client.ParseModelFileUrl(modelUrl, id, filePath));

EXPECT_EQ(id.Server().Url().Str(), "https://fuel.ignitionrobotics.org");
EXPECT_EQ(id.Server().Version(), "1.0");
EXPECT_EQ(id.Owner(), "openrobotics");
EXPECT_EQ(id.Owner(), "OpenRobotics");
EXPECT_EQ(id.Name(), "Pine Tree");
EXPECT_EQ(filePath, "materials/scripts/pine_tree.material");
}
Expand All @@ -325,13 +325,13 @@ TEST_F(FuelClientTest, ParseModelFileURL)
ModelIdentifier id;
std::string filePath;
const common::URI modelUrl{
"https://fuel.ignitionrobotics.org/5.0/openrobotics/models/Pine Tree/tip/"
"https://fuel.ignitionrobotics.org/5.0/OpenRobotics/models/Pine Tree/tip/"
"files/model.sdf"};
EXPECT_TRUE(client.ParseModelFileUrl(modelUrl, id, filePath));

EXPECT_EQ(id.Server().Url().Str(), "https://fuel.ignitionrobotics.org");
EXPECT_EQ(id.Server().Version(), "1.0");
EXPECT_EQ(id.Owner(), "openrobotics");
EXPECT_EQ(id.Owner(), "OpenRobotics");
EXPECT_EQ(id.Name(), "Pine Tree");
EXPECT_EQ(filePath, "model.sdf");
}
Expand All @@ -342,14 +342,14 @@ TEST_F(FuelClientTest, ParseModelFileURL)
ModelIdentifier id;
std::string filePath;
const common::URI modelUrl{
"https://fuel.ignitionrobotics.org/openrobotics/models/Pine Tree/tip/"
"https://fuel.ignitionrobotics.org/OpenRobotics/models/Pine Tree/tip/"
"files/materials/scripts/pine_tree.material"};
EXPECT_TRUE(client.ParseModelFileUrl(modelUrl, id, filePath));

EXPECT_EQ(id.Server().Url().Str(), "https://fuel.ignitionrobotics.org");
EXPECT_FALSE(id.Server().Version().empty());
EXPECT_EQ("1.0", id.Server().Version());
EXPECT_EQ(id.Owner(), "openrobotics");
EXPECT_EQ(id.Owner(), "OpenRobotics");
EXPECT_EQ(id.Name(), "Pine Tree");
EXPECT_EQ(filePath, "materials/scripts/pine_tree.material");
}
Expand All @@ -362,13 +362,13 @@ TEST_F(FuelClientTest, ParseModelFileURL)
ModelIdentifier id;
std::string filePath;
const common::URI modelUrl{
"https://fuel.ignitionrobotics.org/openrobotics/models/Pine Tree/tip/"
"https://fuel.ignitionrobotics.org/OpenRobotics/models/Pine Tree/tip/"
"files/materials/scripts/pine_tree.material"};
EXPECT_TRUE(client.ParseModelFileUrl(modelUrl, id, filePath));

EXPECT_EQ(id.Server().Url().Str(), "https://fuel.ignitionrobotics.org");
EXPECT_EQ(id.Server().Version(), "1.0");
EXPECT_EQ(id.Owner(), "openrobotics");
EXPECT_EQ(id.Owner(), "OpenRobotics");
EXPECT_EQ(id.Name(), "Pine Tree");
EXPECT_EQ(filePath, "materials/scripts/pine_tree.material");
}
Expand Down Expand Up @@ -809,13 +809,13 @@ TEST_F(FuelClientTest, ParseWorldFileUrl)
WorldIdentifier id;
std::string filePath;
const common::URI worldUrl{
"https://fuel.ignitionrobotics.org/1.0/openrobotics/worlds/Empty/tip/"
"https://fuel.ignitionrobotics.org/1.0/OpenRobotics/worlds/Empty/tip/"
"files/empty.world"};
EXPECT_TRUE(client.ParseWorldFileUrl(worldUrl, id, filePath));

EXPECT_EQ(id.Server().Url().Str(), "https://fuel.ignitionrobotics.org");
EXPECT_EQ(id.Server().Version(), "1.0");
EXPECT_EQ(id.Owner(), "openrobotics");
EXPECT_EQ(id.Owner(), "OpenRobotics");
EXPECT_EQ(id.Name(), "Empty");
EXPECT_EQ(filePath, "empty.world");
}
Expand All @@ -828,13 +828,13 @@ TEST_F(FuelClientTest, ParseWorldFileUrl)
WorldIdentifier id;
std::string filePath;
const common::URI worldUrl{
"https://fuel.ignitionrobotics.org/1.0/openrobotics/worlds/Empty sky/tip/"
"https://fuel.ignitionrobotics.org/1.0/OpenRobotics/worlds/Empty sky/tip/"
"files/empty_sky.world"};
EXPECT_TRUE(client.ParseWorldFileUrl(worldUrl, id, filePath));

EXPECT_EQ(id.Server().Url().Str(), "https://fuel.ignitionrobotics.org");
EXPECT_EQ(id.Server().Version(), "1.0");
EXPECT_EQ(id.Owner(), "openrobotics");
EXPECT_EQ(id.Owner(), "OpenRobotics");
EXPECT_EQ(id.Name(), "Empty sky");
EXPECT_EQ(filePath, "empty_sky.world");
}
Expand All @@ -847,13 +847,13 @@ TEST_F(FuelClientTest, ParseWorldFileUrl)
WorldIdentifier id;
std::string filePath;
const common::URI worldUrl{
"https://fuel.ignitionrobotics.org/5.0/openrobotics/worlds/Empty/tip/"
"https://fuel.ignitionrobotics.org/5.0/OpenRobotics/worlds/Empty/tip/"
"files/empty.world"};
EXPECT_TRUE(client.ParseWorldFileUrl(worldUrl, id, filePath));

EXPECT_EQ(id.Server().Url().Str(), "https://fuel.ignitionrobotics.org");
EXPECT_EQ(id.Server().Version(), "1.0");
EXPECT_EQ(id.Owner(), "openrobotics");
EXPECT_EQ(id.Owner(), "OpenRobotics");
EXPECT_EQ(id.Name(), "Empty");
EXPECT_EQ(filePath, "empty.world");
}
Expand All @@ -864,14 +864,14 @@ TEST_F(FuelClientTest, ParseWorldFileUrl)
WorldIdentifier id;
std::string filePath;
const common::URI worldUrl{
"https://fuel.ignitionrobotics.org/openrobotics/worlds/Empty sky/tip/"
"https://fuel.ignitionrobotics.org/OpenRobotics/worlds/Empty sky/tip/"
"files/empty_sky.world"};
EXPECT_TRUE(client.ParseWorldFileUrl(worldUrl, id, filePath));

EXPECT_EQ(id.Server().Url().Str(), "https://fuel.ignitionrobotics.org");
EXPECT_FALSE(id.Server().Version().empty());
EXPECT_EQ("1.0", id.Server().Version());
EXPECT_EQ(id.Owner(), "openrobotics");
EXPECT_EQ(id.Owner(), "OpenRobotics");
EXPECT_EQ(id.Name(), "Empty sky");
EXPECT_EQ(filePath, "empty_sky.world");
}
Expand All @@ -884,13 +884,13 @@ TEST_F(FuelClientTest, ParseWorldFileUrl)
WorldIdentifier id;
std::string filePath;
const common::URI worldUrl{
"https://fuel.ignitionrobotics.org/1.0/openrobotics/worlds/Empty/tip/"
"https://fuel.ignitionrobotics.org/1.0/OpenRobotics/worlds/Empty/tip/"
"files/empty.world"};
EXPECT_TRUE(client.ParseWorldFileUrl(worldUrl, id, filePath));

EXPECT_EQ(id.Server().Url().Str(), "https://fuel.ignitionrobotics.org");
EXPECT_EQ(id.Server().Version(), "1.0");
EXPECT_EQ(id.Owner(), "openrobotics");
EXPECT_EQ(id.Owner(), "OpenRobotics");
EXPECT_EQ(id.Name(), "Empty");
EXPECT_EQ(filePath, "empty.world");
}
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/cmdfuel.rb.in
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ SUBCOMMANDS = {
" \n"\
"Available Options: \n"\
" -u [--url] arg Full resource URL, such as: \n"\
" https://fuel.ignitionrobotics.org/1.0/openrobotics/models/Ambulance\n"\
" https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Ambulance\n"\
" --header arg Set an HTTP header, such as \n"\
" --header 'authorization: Bearer JWT'. \n" +
COMMON_OPTIONS,
Expand Down Expand Up @@ -161,7 +161,7 @@ class Cmd
end
when 'download'
if options['url'] == ''
puts "Missing resource URL (e.g. --url https://fuel.ignitionrobotics.org/1.0/openrobotics/models/Ambulance)."
puts "Missing resource URL (e.g. --url https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Ambulance)."
exit(-1)
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/ign_src_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ TEST(CmdLine, ModelListCustomServerPrettyOwner)
redirectIO(stdOutBuffer, stdErrBuffer);

EXPECT_TRUE(listModels("https://staging-fuel.ignitionrobotics.org",
"openrobotics"));
"OpenRobotics"));

EXPECT_NE(stdOutBuffer.str().find(
"https://staging-fuel.ignitionrobotics.org"),
Expand Down
14 changes: 7 additions & 7 deletions tutorials/03_command_line.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You should see a list such as:
Fetching world list from https://fuel.ignitionrobotics.org...
Received world list (took 350ms).
https://fuel.ignitionrobotics.org
├── openrobotics
├── OpenRobotics
│ ├── Empty
│ └── Shapes
└── chapulina
Expand Down Expand Up @@ -50,8 +50,8 @@ a way that's easier for scripts to parse. For example, try:
And you'll get a list of the world URLs similar to the one below:

```
https://fuel.ignitionrobotics.org/1.0/openrobotics/worlds/Empty
https://fuel.ignitionrobotics.org/1.0/openrobotics/worlds/Shapes
https://fuel.ignitionrobotics.org/1.0/OpenRobotics/worlds/Empty
https://fuel.ignitionrobotics.org/1.0/OpenRobotics/worlds/Shapes
https://fuel.ignitionrobotics.org/1.0/chapulina/worlds/Shapes%20copy
```

Expand All @@ -60,7 +60,7 @@ https://fuel.ignitionrobotics.org/1.0/chapulina/worlds/Shapes%20copy
It's also possible to only list resources belonging to a given user, using the
`--owner` flag. Try for example:

`ign fuel list -t model -o openrobotics`
`ign fuel list -t model -o OpenRobotics`

## Download resources

Expand All @@ -70,14 +70,14 @@ computer. We use the `ign fuel download` tool for this.
We learned above how to get resource URLs. Now we can use these URLs to download
them. For example, try:

`ign fuel download -v 4 -u https://fuel.ignitionrobotics.org/1.0/openrobotics/worlds/Empty`
`ign fuel download -v 4 -u https://fuel.ignitionrobotics.org/1.0/OpenRobotics/worlds/Empty`

Note that we passed the `-v 4` option so we get a verbose output. You should see something like:

```
Downloading world:
Name: Empty
Owner: openrobotics
Owner: OpenRobotics
Server:
URL: https://fuel.ignitionrobotics.org
Version: 1.0
Expand All @@ -94,5 +94,5 @@ directory, which we call the "local cache". The path is broken down as follows:

> **Tip**: You can change the local cache path on `config.yaml`.
> **Tip**: You can also use other tools such as `wget` to download a zipped file of a world, just add `.zip` to the end of the URL, for example: `wget https://fuel.ignitionrobotics.org/1.0/openrobotics/worlds/Empty.zip`.
> **Tip**: You can also use other tools such as `wget` to download a zipped file of a world, just add `.zip` to the end of the URL, for example: `wget https://fuel.ignitionrobotics.org/1.0/OpenRobotics/worlds/Empty.zip`.

0 comments on commit 0f9aa4c

Please sign in to comment.