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

ign -> gz CLI Migration : gz-transport #321

Merged
merged 2 commits into from
Jun 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ gz_configure_build(QUIT_IF_BUILD_ERRORS
COMPONENTS log)

#============================================================================
# ign command line support
# gz command line support
#============================================================================
add_subdirectory(conf)

Expand Down
18 changes: 9 additions & 9 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
1. Fix Homebrew warning (backport from Fortress).
* [Github pull request 268](https://github.com/gazebosim/gz-transport/pull/268)

1. Use standalone executables with ign tool.
1. Use standalone executables with gz tool.
* [Github pull request 216](https://github.com/gazebosim/gz-transport/pull/216)

1. Make zmq check for post 4.3.1 not to include 4.3.1
Expand Down Expand Up @@ -372,7 +372,7 @@

1. Added a `-n` argument to the echo command line tool, where `-n` can be used
to specify the number of messages to echo and then exit. Made the
`ign.hh` header file private (not installed).
`gz.hh` header file private (not installed).
* [BitBucket pull request 367](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-transport/pull-requests/367)

1. Added start of C interface, currently it supports only pub/sub.
Expand All @@ -390,7 +390,7 @@

### Gazebo Transport 6.X.X

1. Ignore EPERM and ENOBUFS errors during discovery, generalize cmake for ign tool files
1. Ignore EPERM and ENOBUFS errors during discovery, generalize cmake for gz tool files
* [BitBucket pull request 380](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-transport/pull-requests/380)
* [Issue 106](https://github.com/gazebosim/gz-transport/issues/106)

Expand Down Expand Up @@ -424,7 +424,7 @@
1. Added the ability to Pause/Resume playback from the log replayer.
* [BitBucket pull request 334](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-transport/pull-requests/334)

1. Added support for topic remapping when running "ign log playback". Note that
1. Added support for topic remapping when running "gz log playback". Note that
the string ":=" is not allowed now as part of a partition, namespace or topic
anymore.
* [BitBucket pull request 331](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-transport/pull-requests/331)
Expand Down Expand Up @@ -458,7 +458,7 @@
1. Added inline versioned namespace to the main library
* [BitBucket pull request 301](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-transport/pull-requests/301)

1. Added --force option to 'ign log record'
1. Added --force option to 'gz log record'
* [BitBucket pull request 325](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-transport/pull-requests/325)

## Gazebo Transport 4
Expand Down Expand Up @@ -547,7 +547,7 @@
1. Workaround for the ghost Msbuild warning in Jenkins plugin
* [BitBucket pull request 205](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-transport/pull-requests/205)

1. Added tests for ign.cc
1. Added tests for gz.cc
* [BitBucket pull request 209](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-transport/pull-requests/209)

1. Remove manual setting of flags for dynamic linking of the Windows CRT library
Expand All @@ -571,7 +571,7 @@
1. SubscriptionHandler.hh fix std::move compiler warning
* [BitBucket pull request 222](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-transport/pull-requests/222)

1. Fix ign topic|service fails on MacOS X if system integrity protection is enabled
1. Fix gz topic|service fails on MacOS X if system integrity protection is enabled
* [BitBucket pull request 227](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-transport/pull-requests/227)
* [Issue 72](https://github.com/gazebosim/gz-transport/issues/72)

Expand All @@ -589,7 +589,7 @@
check if a Publisher has subscribers.
* [BitBucket pull request 190](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-transport/pull-requests/190)

1. Add ign topic --echo command line tool.
1. Add gz topic --echo command line tool.
* [BitBucket pull request 189](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-transport/pull-requests/189)

1. Support a generic callback signature for receiving messages of any type.
Expand All @@ -610,7 +610,7 @@
set the received message rate on the subscriber side.
* [BitBucket pull request 174](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-transport/pull-requests/174)

1. Added ign service --req <args ...> for requesting services using the command line.
1. Added gz service --req <args ...> for requesting services using the command line.
* [BitBucket pull request 172](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-transport/pull-requests/172)

1. Do not allow to advertise a topic that is currently advertised on the same node.
Expand Down
16 changes: 8 additions & 8 deletions INSTALL_WINDOWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ need to [disable the Windows firewall](http://windows.microsoft.com/en-us/window

1. Make a directory to work in, e.g.:

mkdir ign-ws
cd ign-ws
mkdir gz-ws
cd gz-ws

1. Download the following dependencies into that directory:

Expand All @@ -36,11 +36,11 @@ need to [disable the Windows firewall](http://windows.microsoft.com/en-us/window
directory structure, where a directory with the name of the zip contains the
directory that has the source files. Here is an example:

ign-ws/cppzmq-noarch/cppzmq
gz-ws/cppzmq-noarch/cppzmq

The correct structure is

ign-ws/cppzmq
gz-ws/cppzmq

To fix this problem, manually move the nested directories up one level.

Expand Down Expand Up @@ -85,18 +85,18 @@ directory that has the source files. Here is an example:
nmake install


You should now have an installation of ign-transport in ign-ws/ign-transport/build/install.
You should now have an installation of ign-transport in gz-ws/ign-transport/build/install.

1. Before running any executables, you need to modify your `PATH` to include the
directories including your DLL dependencies to let Windows find dynamic libs
(similar to `LD_LIBRARY_PATH` on Linux). Don't put quotes around the path, even
if it contains spaces. E.g., if you're working in `C:\My Stuff\ign-ws`:
if it contains spaces. E.g., if you're working in `C:\My Stuff\gz-ws`:

set PATH=%PATH%;C:\My Stuff\ign-ws\ZeroMQ 4.0.4\bin;C:\My Stuff\ign-ws\ign-msgs\build\install\Release\lib
set PATH=%PATH%;C:\My Stuff\gz-ws\ZeroMQ 4.0.4\bin;C:\My Stuff\gz-ws\ign-msgs\build\install\Release\lib

1. Now build the examples:

cd ign-ws\ign-transport\example
cd gz-ws\ign-transport\example
mkdir build
cd build
..\configure
Expand Down
2 changes: 1 addition & 1 deletion Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ release will remove the deprecated code.

### Removed

1. The `ign.hh` file is not longer installed.
1. The `gz.hh` file is not longer installed.
* [BitBucket pull request 367](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-transport/pull-requests/367)

## Gazebo Transport 4.X to 5.X
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ A workaround is to define the environment variable
`GZ_CONFIG_PATH` to point to the location of the Ignition library installation,
where the YAML file for the package is found, such as
```
export GZ_CONFIG_PATH=/usr/local/share/ignition
export GZ_CONFIG_PATH=/usr/local/share/gz
```

This issue is tracked [here](https://github.com/gazebosim/gz-tools/issues/61).
Expand All @@ -85,7 +85,7 @@ Visit the [documentation page](https://gazebosim.org/api/transport/11.0/index.ht

```
ign-transport
├── conf Configuration file for the integration with the `ign` CLI tool.
├── conf Configuration file for the integration with the `gz` CLI tool.
├── docker Dockerfile with ign-transport installed and scripts to build and run the code.
├── example Example programs that use most of the Gazebo Transport API.
├── include Header files that get installed.
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/$<CONFIG>/ruby/ignition/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}")
set(gz_library_path "${CMAKE_BINARY_DIR}/test/lib/$<CONFIG>/ruby/gz/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}")

# Generate a configuration file for internal testing.
# Note that the major version of the library is included in the name.
Expand All @@ -13,7 +13,7 @@ file(GENERATE
INPUT "${CMAKE_CURRENT_BINARY_DIR}/${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.yaml.configured")

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

# 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 example/subscriber_stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ int main(int argc, char **argv)
std::string topic = "/foo";

// Statistics are published on the `/statistics` topic. You echo the
// statistics output using `ign topic -et /statistics`.
// statistics output using `gz topic -et /statistics`.
if (!node.EnableStats(topic, true))
{
std::cout << "Unable to enable stats\n";
Expand Down
2 changes: 1 addition & 1 deletion include/gz/transport/ReqHandler.hh
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ namespace gz

/// \class ReqHandler<google::protobuf::Message> ReqHandler.hh
/// \brief Template specialization for google::protobuf::Message.
/// This is only used by some ign command line tools.
/// This is only used by some gz command line tools.
template <> class ReqHandler<google::protobuf::Message,
google::protobuf::Message>
: public IReqHandler
Expand Down
10 changes: 5 additions & 5 deletions log/src/cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#===============================================================================
# Generate the ruby script for internal testing.
# Note that the major version of the library is included in the name.
# TODO(anyone): We do not currently have tests for the `ign log` command, so this is currently going unused.
set(cmd_log_ruby_test_dir "${CMAKE_BINARY_DIR}/log/test/lib/ruby/ignition")
# TODO(anyone): We do not currently have tests for the `gz log` command, so this is currently going unused.
set(cmd_log_ruby_test_dir "${CMAKE_BINARY_DIR}/log/test/lib/ruby/gz")
set(cmd_log_script_generated_test "${cmd_log_ruby_test_dir}/cmdlog${PROJECT_VERSION_MAJOR}.rb")
set(cmd_log_script_configured_test "${cmd_log_script_generated_test}.configured")

Expand All @@ -20,7 +20,7 @@ file(GENERATE
INPUT "${cmd_log_script_configured_test}")

# Used for internal testing.
set(ign_log_ruby_path "${cmd_log_script_generated_test}")
set(gz_log_ruby_path "${cmd_log_script_generated_test}")

configure_file(
"transportlog.yaml.in"
Expand All @@ -47,10 +47,10 @@ file(GENERATE
OUTPUT "${cmd_log_script_generated}"
INPUT "${cmd_log_script_configured}")

install(FILES ${cmd_log_script_generated} DESTINATION lib/ruby/ignition)
install(FILES ${cmd_log_script_generated} DESTINATION lib/ruby/gz)

# Used for the installed version.
set(ign_log_ruby_path "${CMAKE_INSTALL_PREFIX}/lib/ruby/ignition/cmdlog${PROJECT_VERSION_MAJOR}")
set(gz_log_ruby_path "${CMAKE_INSTALL_PREFIX}/lib/ruby/gz/cmdlog${PROJECT_VERSION_MAJOR}")

set(transportlog_configured "${CMAKE_CURRENT_BINARY_DIR}/transportlog${PROJECT_VERSION_MAJOR}.yaml")
configure_file(
Expand Down
6 changes: 3 additions & 3 deletions log/src/cmd/cmdlog.rb.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ COMMON_OPTIONS =

COMMANDS = { 'log' =>
"Record and playback Gazebo Transport topics. \n\n"\
" ign log record|playback [options] \n"\
" gz log record|playback [options] \n"\
" \n"\
"Options: \n\n" +
COMMON_OPTIONS
}

SUBCOMMANDS = { 'record' =>
"Record Gazebo Transport topics. \n\n"\
" ign log record [options] \n"\
" gz log record [options] \n"\
" \n"\
"Options: \n\n"\
" --file FILE Log file name (default <datetime>.tlog). \n"\
Expand All @@ -56,7 +56,7 @@ SUBCOMMANDS = { 'record' =>
COMMON_OPTIONS,
'playback' =>
"Playback previously recorded Gazebo Transport topics. \n\n"\
" ign log playback [options] \n"\
" gz log playback [options] \n"\
" \n"\
"Required Flags: \n\n"\
" --file FILE Log file name. \n"\
Expand Down
4 changes: 2 additions & 2 deletions log/src/cmd/transportlog.yaml.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
--- # Subcommands available inside ignition-transport-log.
format: 1.0.0
library_name: ignition-transport-log
library_name: gz-transport-log
library_version: @PROJECT_VERSION_FULL@
library_path: @ign_log_ruby_path@
library_path: @gz_log_ruby_path@
commands:
- log : Record or playback topics.
---
16 changes: 8 additions & 8 deletions log/test/integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,20 @@ foreach(source_file ${aux})
PRIVATE GZ_TRANSPORT_LOG_BUILD_PATH="$<TARGET_FILE_DIR:${BINARY_NAME}>")
endforeach()

# ign log CLI test
# gz log CLI test
if (IGNITION-TOOLS_BINARY_DIRS)
set(GZ_CONFIG_PATH "${CMAKE_BINARY_DIR}/log/test/lib/ruby/ignition")
set(GZ_CONFIG_PATH "${CMAKE_BINARY_DIR}/log/test/lib/ruby/gz")

add_test(ign_log_record_no_overwrite
ruby ${CMAKE_CURRENT_SOURCE_DIR}/ign_log_record_no_overwrite.rb
add_test(gz_log_record_no_overwrite
ruby ${CMAKE_CURRENT_SOURCE_DIR}/gz_log_record_no_overwrite.rb
)

add_test(ign_log_record_force
ruby ${CMAKE_CURRENT_SOURCE_DIR}/ign_log_record_force.rb
add_test(gz_log_record_force
ruby ${CMAKE_CURRENT_SOURCE_DIR}/gz_log_record_force.rb
)
set_tests_properties(
ign_log_record_no_overwrite
ign_log_record_force
gz_log_record_no_overwrite
gz_log_record_force
PROPERTIES
ENVIRONMENT
"GZ_CONFIG_PATH=${GZ_CONFIG_PATH};GZ_TRANSPORT_LOG_SQL_PATH=${PROJECT_SOURCE_DIR}/log/sql"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

require 'open3'

testfile = 'ign_log_record_force.tlog'
testfile = 'gz_log_record_force.tlog'
File.write(testfile, 'not empty file')

_, stdout, stderr, wait_thr =
Open3.popen3("ign log record --force --file #{testfile}")
Open3.popen3("gz log record --force --file #{testfile}")

sleep(2)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

require 'open3'

testfile = 'ign_log_record_no_overwrite.tlog'
testfile = 'gz_log_record_no_overwrite.tlog'
File.write(testfile, 'not empty file')

stdout, stderr, status = Open3.capture3("ign log record --file #{testfile}")
stdout, stderr, status = Open3.capture3("gz log record --file #{testfile}")

File.delete(testfile)

Expand Down
20 changes: 10 additions & 10 deletions src/cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ gz_get_libsources_and_unittests(sources gtest_sources)
# Skip command line tests for Windows, see
# https://github.com/gazebosim/gz-transport/issues/104
if (MSVC)
list(REMOVE_ITEM gtest_sources ign_TEST.cc)
list(REMOVE_ITEM gtest_sources gz_TEST.cc)
endif()

# Make a small static lib of command line functions
add_library(ign STATIC ign.cc)
target_link_libraries(ign
add_library(gz STATIC gz.cc)
target_link_libraries(gz
${PROJECT_LIBRARY_TARGET_NAME}
)

# Build topic CLI executable
set(topic_executable ign-transport-topic)
add_executable(${topic_executable} topic_main.cc)
target_link_libraries(${topic_executable}
ign
gz
ignition-utils${IGN_UTILS_VER}::cli
${PROJECT_LIBRARY_TARGET_NAME}
)
Expand All @@ -28,7 +28,7 @@ install(TARGETS ${topic_executable} DESTINATION ${IGN_LIB_INSTALL_DIR}/ignition/
set(service_executable ign-transport-service)
add_executable(${service_executable} service_main.cc)
target_link_libraries(${service_executable}
ign
gz
ignition-utils${IGN_UTILS_VER}::cli
${PROJECT_LIBRARY_TARGET_NAME}
)
Expand All @@ -40,7 +40,7 @@ gz_build_tests(TYPE UNIT SOURCES ${gtest_sources}
LIB_DEPS ${EXTRA_TEST_LIB_DEPS})

foreach(test ${test_list})
target_link_libraries(${test} ign)
target_link_libraries(${test} gz)

# Inform each test of its output directory so it knows where to call the
# auxiliary files from. Using a generator expression here is useful for
Expand All @@ -51,9 +51,9 @@ foreach(test ${test_list})

endforeach()

if (TARGET UNIT_ign_TEST)
if (TARGET UNIT_gz_TEST)
set_tests_properties(
UNIT_ign_TEST
UNIT_gz_TEST
PROPERTIES
ENVIRONMENT
"GZ_CONFIG_PATH=${CMAKE_BINARY_DIR}/test/conf/$<CONFIG>"
Expand All @@ -64,7 +64,7 @@ endif()
# Generate the ruby script for internal testing.
# Note that the major version of the library is included in the name.
# Ex: cmdtransport0.rb
set(cmd_script_generated_test "${CMAKE_BINARY_DIR}/test/lib/$<CONFIG>/ruby/ignition/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.rb")
set(cmd_script_generated_test "${CMAKE_BINARY_DIR}/test/lib/$<CONFIG>/ruby/gz/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.rb")
set(cmd_script_configured_test "${CMAKE_CURRENT_BINARY_DIR}/test_cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.rb.configured")

# Set the library_location variable to the full path of the library file within
Expand Down Expand Up @@ -105,4 +105,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)
Loading