Skip to content

Commit

Permalink
ign -> gz CLI Migration : sdformat (#1047)
Browse files Browse the repository at this point in the history
Signed-off-by: methylDragon <[email protected]>
  • Loading branch information
methylDragon authored Jun 22, 2022
1 parent 8061156 commit 15718e8
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 33 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ if (BUILD_SDF)
endif()

#################################################
# Find ign command line utility:
find_program(GZ_PROGRAM ign)
# Find gz command line utility:
find_program(GZ_PROGRAM gz)

#################################################
# Copied from catkin/cmake/empy.cmake
Expand Down
26 changes: 13 additions & 13 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
1. Add `L16` pixel format to Camera pixel format conversion function
* [Pull request #487](https://github.com/gazebosim/sdformat/pull/487)

1. Added ``--inertial-stats`` option to ``ign sdf``
1. Added ``--inertial-stats`` option to ``gz sdf``
* [Pull request #936](https://github.com/gazebosim/sdformat/pull/936)

1. Added `anti_aliasing` element to camera's SDF
Expand Down Expand Up @@ -925,7 +925,7 @@

### libsdformat 10.2.0 (2021-01-12)

1. Disable ign test on Windows
1. Disable gz test on Windows
+ [Pull request 456](https://github.com/osrf/sdformat/pull/456)

1. Add Heightmap class
Expand Down Expand Up @@ -1026,7 +1026,7 @@
1. Added `<shininess>` to `<material>`
* [Pull request #985](https://github.com/gazebosim/sdformat/pull/985)

1. Backport ``ign sdf --inertial-stats``
1. Backport ``gz sdf --inertial-stats``
* [Pull request #958](https://github.com/gazebosim/sdformat/pull/958)

1. Add L16 pixel format to Camera pixel format conversion function
Expand Down Expand Up @@ -1361,10 +1361,10 @@

### libsdformat 9.0.0 (2019-12-10)

1. Move recursiveSameTypeUniqueNames from ign.cc to parser.cc and make public.
1. Move recursiveSameTypeUniqueNames from gz.cc to parser.cc and make public.
* [BitBucket pull request 606](https://osrf-migration.github.io/sdformat-gh-pages/#!/osrf/sdformat/pull-requests/606)

1. Check that joints have valid parent and child names in `ign sdf --check`.
1. Check that joints have valid parent and child names in `gz sdf --check`.
* [BitBucket pull request 609](https://osrf-migration.github.io/sdformat-gh-pages/#!/osrf/sdformat/pull-requests/609)

1. Model DOM: error when trying to load nested models, which aren't yet supported.
Expand All @@ -1382,7 +1382,7 @@
1. Relax name checking, so name collisions generate warnings and names are automatically changed.
* [BitBucket pull request 621](https://osrf-migration.github.io/sdformat-gh-pages/#!/osrf/sdformat/pull-requests/621)

1. Unversioned library name for ign tool commands.
1. Unversioned library name for gz tool commands.
* [BitBucket pull request 612](https://osrf-migration.github.io/sdformat-gh-pages/#!/osrf/sdformat/pull-requests/612)

1. Initial version of SDFormat 1.7 specification.
Expand Down Expand Up @@ -1544,7 +1544,7 @@
1. Use inline namespaces in Utils.cc
* [BitBucket pull request 574](https://osrf-migration.github.io/sdformat-gh-pages/#!/osrf/sdformat/pull-requests/574)

1. Convert `ign sdf` file inputs to absolute paths before processing them
1. Convert `gz sdf` file inputs to absolute paths before processing them
* [BitBucket pull request 583](https://osrf-migration.github.io/sdformat-gh-pages/#!/osrf/sdformat/pull-requests/583)

1. Add `emissive_map` to material sdf
Expand Down Expand Up @@ -1581,11 +1581,11 @@
1. Move private headers from include/sdf to src folder.
* [BitBucket pull request 553](https://osrf-migration.github.io/sdformat-gh-pages/#!/osrf/sdformat/pull-requests/553)

1. Fix ign library path on macOS.
1. Fix gz library path on macOS.
* [BitBucket pull request 542](https://osrf-migration.github.io/sdformat-gh-pages/#!/osrf/sdformat/pull-requests/542)
* [BitBucket pull request 564](https://osrf-migration.github.io/sdformat-gh-pages/#!/osrf/sdformat/pull-requests/564)

1. Use `ign sdf --check` to check sibling elements of the same type for non-unique names.
1. Use `gz sdf --check` to check sibling elements of the same type for non-unique names.
* [BitBucket pull request 554](https://osrf-migration.github.io/sdformat-gh-pages/#!/osrf/sdformat/pull-requests/554)

1. Converter: remove all matching elements specified by `<remove>` tag.
Expand Down Expand Up @@ -1769,7 +1769,7 @@
* [BitBucket pull request 476](https://osrf-migration.github.io/sdformat-gh-pages/#!/osrf/sdformat/pull-requests/476)
* [BitBucket pull request 463](https://osrf-migration.github.io/sdformat-gh-pages/#!/osrf/sdformat/pull-requests/463)

1. Fix ign library path on macOS.
1. Fix gz library path on macOS.
* [BitBucket pull request 542](https://osrf-migration.github.io/sdformat-gh-pages/#!/osrf/sdformat/pull-requests/542)

1. Preserve XML elements that are not part of the SDF specification.
Expand Down Expand Up @@ -1826,7 +1826,7 @@

### libsdformat 6.3.0 (2021-06-21)

1. Move recursiveSameTypeUniqueNames from ign.cc to parser.cc and make public.
1. Move recursiveSameTypeUniqueNames from gz.cc to parser.cc and make public.
* [Pull request 580](https://github.com/osrf/sdformat/pull/580)

1. Parse rpyOffset as radians
Expand All @@ -1841,10 +1841,10 @@
1. Avoid hardcoding /machine:x64 flag on 64-bit on MSVC with CMake >= 3.5.
* [BitBucket pull request 565](https://osrf-migration.github.io/sdformat-gh-pages/#!/osrf/sdformat/pull-requests/565)

1. Fix ign library path on macOS.
1. Fix gz library path on macOS.
* [BitBucket pull request 552](https://osrf-migration.github.io/sdformat-gh-pages/#!/osrf/sdformat/pull-requests/552)

1. Use `ign sdf --check` to check sibling elements of the same type for non-unique names.
1. Use `gz sdf --check` to check sibling elements of the same type for non-unique names.
* [BitBucket pull request 554](https://osrf-migration.github.io/sdformat-gh-pages/#!/osrf/sdformat/pull-requests/554)

1. Converter: remove all matching elements specified by `<remove>` tag.
Expand Down
2 changes: 1 addition & 1 deletion Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ ABI was broken for `sdf::Element`, and restored on version 11.2.1.
Uniqueness is forced so that referencing implicit frames is not ambiguous,
e.g. you cannot have a link and joint share an implicit frame name.
Some existing SDFormat models may not comply with this requirement.
The `ign sdf --check` command can be used to identify models that violate
The `gz sdf --check` command can be used to identify models that violate
this requirement.
+ [BitBucket pull request 600](https://osrf-migration.github.io/sdformat-gh-pages/#!/osrf/sdformat/pull-requests/600)

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ Miniconda suffices.

Create if necessary, and activate a Conda environment:
```
conda create -n ign-ws
conda activate ign-ws
conda create -n gz-ws
conda activate gz-ws
```

Install `sdformat`:
Expand Down Expand Up @@ -184,8 +184,8 @@ Miniconda suffices.

Create if necessary, and activate a Conda environment:
```
conda create -n ign-ws
conda activate ign-ws
conda create -n gz-ws
conda activate gz-ws
```

Install prerequisites:
Expand Down
4 changes: 2 additions & 2 deletions conf/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Used only for internal testing.
set(gz_library_path "${CMAKE_BINARY_DIR}/test/lib/ruby/ignition/cmd${PROJECT_NAME}")
set(gz_library_path "${CMAKE_BINARY_DIR}/test/lib/ruby/gz/cmd${PROJECT_NAME}")

# Generate a configuration file for internal testing.
# Note that the major version of the library is included in the name.
Expand All @@ -9,7 +9,7 @@ configure_file(
"${CMAKE_BINARY_DIR}/test/conf/${PROJECT_NAME}.yaml" @ONLY)

# Used for the installed version.
set(gz_library_path "${CMAKE_INSTALL_PREFIX}/lib/ruby/ignition/cmd${PROJECT_NAME}")
set(gz_library_path "${CMAKE_INSTALL_PREFIX}/lib/ruby/gz/cmd${PROJECT_NAME}")

# Generate the configuration file that is installed.
# Note that the major version of the library is included in the name.
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ endif()
if (BUILD_TESTING)
# Build this test file only if Ignition Tools is installed.
if (NOT GZ_PROGRAM)
list(REMOVE_ITEM gtest_sources ign_TEST.cc)
list(REMOVE_ITEM gtest_sources gz_TEST.cc)
endif()

# Skip tests that don't work on Windows
Expand Down
2 changes: 1 addition & 1 deletion src/Param.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1353,7 +1353,7 @@ bool Param::Reparse(sdf::Errors &_errors)
strToReparse = this->dataPtr->strValue.value();
}
// A default PrintConfig can be used here, as Reparse() is not called in the
// code path from the 'ign sdf -p' command.
// code path from the 'gz sdf -p' command.
else if (!this->dataPtr->StringFromValueImpl(PrintConfig(),
this->dataPtr->typeName,
this->dataPtr->defaultValue,
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Generate the ruby script for internal testing.
# Note that the major version of the library is included in the name.
# Ex: cmdsdformat0.rb
set(cmd_script_generated_test "${CMAKE_BINARY_DIR}/test/lib/ruby/ignition/cmd${PROJECT_NAME}.rb")
set(cmd_script_generated_test "${CMAKE_BINARY_DIR}/test/lib/ruby/gz/cmd${PROJECT_NAME}.rb")
set(cmd_script_configured_test "${cmd_script_generated_test}.configured")

# Set the library_location variable to the full path of the library file within
Expand Down Expand Up @@ -41,4 +41,4 @@ file(GENERATE
INPUT "${cmd_script_configured}")

# Install the ruby command line library in an unversioned location.
install(FILES ${cmd_script_generated} DESTINATION lib/ruby/ignition)
install(FILES ${cmd_script_generated} DESTINATION lib/ruby/gz)
4 changes: 2 additions & 2 deletions src/cmd/cmdsdformat.rb.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ COMMON_OPTIONS =
' --versions Show the available versions.'
COMMANDS = { 'sdf' =>
"Utilities for SDF files.\n\n"\
" ign sdf [options]\n\n"\
" gz sdf [options]\n\n"\
"Options:\n\n"\
" -k [ --check ] arg Check if an SDFormat file is valid.\n" +
" -d [ --describe ] [SPEC VERSION] Print the aggregated SDFormat spec description. Default version (@SDF_PROTOCOL_VERSION@).\n" +
Expand Down Expand Up @@ -251,7 +251,7 @@ class Cmd
end
else
puts 'Command error: I do not have an implementation for '\
"command [ign #{options['command']}]."
"command [gz #{options['command']}]."
end
rescue
puts "Library error: Problem running [#{options['command']}]() "\
Expand Down
2 changes: 1 addition & 1 deletion src/ign.cc → src/gz.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

#include "FrameSemantics.hh"
#include "ScopedGraph.hh"
#include "ign.hh"
#include "gz.hh"

//////////////////////////////////////////////////
extern "C" SDFORMAT_VISIBLE int cmdCheck(const char *_path)
Expand Down
2 changes: 1 addition & 1 deletion src/ign.hh → src/gz.hh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
inline namespace SDF_VERSION_NAMESPACE {
//

/// \brief External hook to execute 'ign sdf -k' from the command line.
/// \brief External hook to execute 'gz sdf -k' from the command line.
/// \param[in] _path Path to the file to validate.
/// \return Zero on success, negative one otherwise.
extern "C" SDFORMAT_VISIBLE int cmdCheck(const char *_path);
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/parser_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ TEST(Parser, readFileConversions)
/////////////////////////////////////////////////
TEST(Parser, NameUniqueness)
{
// These tests are copies of the ones in ign_TEST.cc but use direct calls to
// name uniqueness validator functions instead of going through ign.
// These tests are copies of the ones in gz_TEST.cc but use direct calls to
// name uniqueness validator functions instead of going through gz.

// Check an SDF file with sibling elements of the same type (world)
// that have duplicate names.
Expand Down
2 changes: 1 addition & 1 deletion test/sdf/inertial_stats.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!---
Model consists of 4 cubes places symmetrically
in the XY plane. This model is used to verify the
"ign sdf --inertial-stats" tool .
"gz sdf --inertial-stats" tool .
+y
┌─┼─┐
Expand Down

0 comments on commit 15718e8

Please sign in to comment.