From 24c244542b2f761d66e1831e3a9838396d5d79fc Mon Sep 17 00:00:00 2001 From: methylDragon Date: Sun, 12 Jun 2022 22:06:40 -0700 Subject: [PATCH] Migrate CLI Signed-off-by: methylDragon --- CMakeLists.txt | 2 +- Changelog.md | 18 +++++++------- INSTALL_WINDOWS.md | 16 ++++++------- Migration.md | 2 +- README.md | 4 ++-- conf/CMakeLists.txt | 4 ++-- example/subscriber_stats.cc | 2 +- include/gz/transport/ReqHandler.hh | 2 +- log/src/cmd/CMakeLists.txt | 10 ++++---- log/src/cmd/cmdlog.rb.in | 6 ++--- log/src/cmd/transportlog.yaml.in | 4 ++-- log/test/integration/CMakeLists.txt | 16 ++++++------- log/test/integration/gz_log_record_force.rb | 4 ++-- .../integration/gz_log_record_no_overwrite.rb | 4 ++-- src/cmd/CMakeLists.txt | 20 ++++++++-------- src/cmd/gz.cc | 2 +- src/cmd/gz.hh | 14 +++++------ src/cmd/gz_TEST.cc | 24 +++++++++---------- src/cmd/gz_src_TEST.cc | 14 +++++------ src/cmd/service_main.cc | 2 +- src/cmd/topic_main.cc | 2 +- tutorials/02_installation.md | 6 ++--- tutorials/04_messages.md | 6 ++--- tutorials/06_security.md | 12 +++++----- tutorials/07_relay.md | 4 ++-- tutorials/10_logging.md | 24 +++++++++---------- tutorials/23_topic_statistics.md | 4 ++-- 27 files changed, 114 insertions(+), 114 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6a2b9f163..62b2ab83c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,7 +115,7 @@ gz_configure_build(QUIT_IF_BUILD_ERRORS COMPONENTS log) #============================================================================ -# ign command line support +# gz command line support #============================================================================ add_subdirectory(conf) diff --git a/Changelog.md b/Changelog.md index 2dd9c2b0e..4029b9886 100644 --- a/Changelog.md +++ b/Changelog.md @@ -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 @@ -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. @@ -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) @@ -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) @@ -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 @@ -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 @@ -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) @@ -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. @@ -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 for requesting services using the command line. +1. Added gz service --req 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. diff --git a/INSTALL_WINDOWS.md b/INSTALL_WINDOWS.md index e405b8063..bd420361f 100644 --- a/INSTALL_WINDOWS.md +++ b/INSTALL_WINDOWS.md @@ -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: @@ -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. @@ -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 diff --git a/Migration.md b/Migration.md index 35a913a88..d7f2f4250 100644 --- a/Migration.md +++ b/Migration.md @@ -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 diff --git a/README.md b/README.md index 119d6737e..e83b7e8dc 100644 --- a/README.md +++ b/README.md @@ -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). @@ -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. diff --git a/conf/CMakeLists.txt b/conf/CMakeLists.txt index 8ebc6220d..044e6a501 100644 --- a/conf/CMakeLists.txt +++ b/conf/CMakeLists.txt @@ -1,5 +1,5 @@ # Used only for internal testing. -set(gz_library_path "${CMAKE_BINARY_DIR}/test/lib/$/ruby/ignition/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}") +set(gz_library_path "${CMAKE_BINARY_DIR}/test/lib/$/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. @@ -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. diff --git a/example/subscriber_stats.cc b/example/subscriber_stats.cc index 8fe495ab4..c889b7f82 100644 --- a/example/subscriber_stats.cc +++ b/example/subscriber_stats.cc @@ -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"; diff --git a/include/gz/transport/ReqHandler.hh b/include/gz/transport/ReqHandler.hh index 82051bac1..9506ea0eb 100644 --- a/include/gz/transport/ReqHandler.hh +++ b/include/gz/transport/ReqHandler.hh @@ -306,7 +306,7 @@ namespace gz /// \class ReqHandler 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 : public IReqHandler diff --git a/log/src/cmd/CMakeLists.txt b/log/src/cmd/CMakeLists.txt index 06a9ca9d1..2f5677978 100644 --- a/log/src/cmd/CMakeLists.txt +++ b/log/src/cmd/CMakeLists.txt @@ -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") @@ -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" @@ -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( diff --git a/log/src/cmd/cmdlog.rb.in b/log/src/cmd/cmdlog.rb.in index ac8ce25f8..f37980456 100644 --- a/log/src/cmd/cmdlog.rb.in +++ b/log/src/cmd/cmdlog.rb.in @@ -38,7 +38,7 @@ 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 @@ -46,7 +46,7 @@ COMMANDS = { 'log' => 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 .tlog). \n"\ @@ -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"\ diff --git a/log/src/cmd/transportlog.yaml.in b/log/src/cmd/transportlog.yaml.in index fc801141e..b045eb3f9 100644 --- a/log/src/cmd/transportlog.yaml.in +++ b/log/src/cmd/transportlog.yaml.in @@ -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. --- diff --git a/log/test/integration/CMakeLists.txt b/log/test/integration/CMakeLists.txt index aff166310..eb3a7bf1f 100644 --- a/log/test/integration/CMakeLists.txt +++ b/log/test/integration/CMakeLists.txt @@ -64,20 +64,20 @@ foreach(source_file ${aux}) PRIVATE GZ_TRANSPORT_LOG_BUILD_PATH="$") 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" diff --git a/log/test/integration/gz_log_record_force.rb b/log/test/integration/gz_log_record_force.rb index f11d74f37..04f4c406c 100755 --- a/log/test/integration/gz_log_record_force.rb +++ b/log/test/integration/gz_log_record_force.rb @@ -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) diff --git a/log/test/integration/gz_log_record_no_overwrite.rb b/log/test/integration/gz_log_record_no_overwrite.rb index 1741c3935..cc9730f86 100755 --- a/log/test/integration/gz_log_record_no_overwrite.rb +++ b/log/test/integration/gz_log_record_no_overwrite.rb @@ -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) diff --git a/src/cmd/CMakeLists.txt b/src/cmd/CMakeLists.txt index 78dfea7e0..24393f4e7 100644 --- a/src/cmd/CMakeLists.txt +++ b/src/cmd/CMakeLists.txt @@ -5,12 +5,12 @@ 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} ) @@ -18,7 +18,7 @@ target_link_libraries(ign 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} ) @@ -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} ) @@ -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 @@ -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/$" @@ -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/$/ruby/ignition/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.rb") +set(cmd_script_generated_test "${CMAKE_BINARY_DIR}/test/lib/$/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 @@ -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) diff --git a/src/cmd/gz.cc b/src/cmd/gz.cc index e80fa3dfe..a20f07348 100644 --- a/src/cmd/gz.cc +++ b/src/cmd/gz.cc @@ -30,7 +30,7 @@ #pragma warning(pop) #endif -#include "ign.hh" +#include "gz.hh" #include "gz/transport/config.hh" #include "gz/transport/Helpers.hh" #include "gz/transport/Node.hh" diff --git a/src/cmd/gz.hh b/src/cmd/gz.hh index 57925b1b0..a48f63a3c 100644 --- a/src/cmd/gz.hh +++ b/src/cmd/gz.hh @@ -22,21 +22,21 @@ #include "gz/transport/Export.hh" -/// \brief External hook to execute 'ign topic -i' from the command line. +/// \brief External hook to execute 'gz topic -i' from the command line. /// \param[in] _topic Topic name. extern "C" void cmdTopicInfo(const char *_topic); -/// \brief External hook to execute 'ign service -i' from the command line. +/// \brief External hook to execute 'gz service -i' from the command line. /// \param[in] _service Service name. extern "C" void cmdServiceInfo(const char *_service); -/// \brief External hook to execute 'ign topic -l' from the command line. +/// \brief External hook to execute 'gz topic -l' from the command line. extern "C" void cmdTopicList(); -/// \brief External hook to execute 'ign service -l' from the command line. +/// \brief External hook to execute 'gz service -l' from the command line. extern "C" void cmdServiceList(); -/// \brief External hook to execute 'ign topic -p' from the command line. +/// \brief External hook to execute 'gz topic -p' from the command line. /// \param[in] _topic Topic name. /// \param[in] _msgType Message type. /// \param[in] _msgData The format expected is the same used by Protobuf @@ -47,7 +47,7 @@ extern "C" void cmdTopicPub(const char *_topic, const char *_msgType, const char *_msgData); -/// \brief External hook to execute 'ign service -r' from the command line. +/// \brief External hook to execute 'gz service -r' from the command line. /// \param[in] _service Service name. /// \param[in] _reqType Message type used in the request. /// \param[in] _repType Message type used in the response. @@ -78,7 +78,7 @@ extern "C" { }; } -/// \brief External hook to execute 'ign topic -e' from the command line. +/// \brief External hook to execute 'gz topic -e' from the command line. /// The _duration parameter overrides the _count parameter. /// \param[in] _topic Topic name. /// \param[in] _duration Duration (seconds) to run. A value <= 0 indicates diff --git a/src/cmd/gz_TEST.cc b/src/cmd/gz_TEST.cc index df357724c..10955e2bc 100644 --- a/src/cmd/gz_TEST.cc +++ b/src/cmd/gz_TEST.cc @@ -75,7 +75,7 @@ void topicCB(const gz::msgs::StringMsg &_msg) ////////////////////////////////////////////////// /// \brief Check 'ign topic -l' running the advertiser on a different process. -TEST(ignTest, GZ_UTILS_TEST_DISABLED_ON_MAC(TopicList)) +TEST(gzTest, GZ_UTILS_TEST_DISABLED_ON_MAC(TopicList)) { // Launch a new publisher process that advertises a topic. std::string publisher_path = testing::portablePathUnion( @@ -106,7 +106,7 @@ TEST(ignTest, GZ_UTILS_TEST_DISABLED_ON_MAC(TopicList)) ////////////////////////////////////////////////// /// \brief Check 'ign topic -i' running the advertiser on a different process. -TEST(ignTest, TopicInfo) +TEST(gzTest, TopicInfo) { // Launch a new publisher process that advertises a topic. std::string publisher_path = testing::portablePathUnion( @@ -142,7 +142,7 @@ TEST(ignTest, TopicInfo) ////////////////////////////////////////////////// /// \brief Check 'ign service -l' running the advertiser on a different /// process. -TEST(ignTest, ServiceList) +TEST(gzTest, ServiceList) { // Launch a new responser process that advertises a service. std::string replier_path = testing::portablePathUnion( @@ -173,7 +173,7 @@ TEST(ignTest, ServiceList) ////////////////////////////////////////////////// /// \brief Check 'ign service -i' running the advertiser on a different process. -TEST(ignTest, ServiceInfo) +TEST(gzTest, ServiceInfo) { // Launch a new publisher process that advertises a topic. std::string replier_path = testing::portablePathUnion( @@ -206,7 +206,7 @@ TEST(ignTest, ServiceInfo) ////////////////////////////////////////////////// /// \brief Check 'ign topic -l' running the advertiser on the same process. -TEST(ignTest, TopicListSameProc) +TEST(gzTest, TopicListSameProc) { gz::transport::Node node; @@ -237,7 +237,7 @@ TEST(ignTest, TopicListSameProc) ////////////////////////////////////////////////// /// \brief Check 'ign topic -i' running the advertiser on the same process. -TEST(ignTest, TopicInfoSameProc) +TEST(gzTest, TopicInfoSameProc) { gz::transport::Node node; @@ -270,7 +270,7 @@ TEST(ignTest, TopicInfoSameProc) ////////////////////////////////////////////////// /// \brief Check 'ign service -l' running the advertiser on the same process. -TEST(ignTest, ServiceListSameProc) +TEST(gzTest, ServiceListSameProc) { transport::Node node; EXPECT_TRUE(node.Advertise("/foo", srvEcho)); @@ -293,7 +293,7 @@ TEST(ignTest, ServiceListSameProc) ////////////////////////////////////////////////// /// \brief Check 'ign service -i' running the advertiser on the same process. -TEST(ignTest, ServiceInfoSameProc) +TEST(gzTest, ServiceInfoSameProc) { gz::transport::Node node; EXPECT_TRUE(node.Advertise("/foo", srvEcho)); @@ -319,7 +319,7 @@ TEST(ignTest, ServiceInfoSameProc) ////////////////////////////////////////////////// /// \brief Check 'ign topic -p' to send a message. -TEST(ignTest, TopicPublish) +TEST(gzTest, TopicPublish) { gz::transport::Node node; g_topicCBStr = "bad_value"; @@ -368,7 +368,7 @@ TEST(ignTest, TopicPublish) ////////////////////////////////////////////////// /// \brief Check 'ign service -r' to request a service. -TEST(ignTest, ServiceRequest) +TEST(gzTest, ServiceRequest) { gz::transport::Node node; @@ -392,7 +392,7 @@ TEST(ignTest, ServiceRequest) ////////////////////////////////////////////////// /// \brief Check 'ign topic -e' running the publisher on a separate process. -TEST(ignTest, TopicEcho) +TEST(gzTest, TopicEcho) { // Launch a new publisher process that advertises a topic. std::string publisher_path = testing::portablePathUnion( @@ -418,7 +418,7 @@ TEST(ignTest, TopicEcho) ////////////////////////////////////////////////// /// \brief Check 'ign topic -e -n 2' running the publisher on a separate /// process. -TEST(ignTest, TopicEchoNum) +TEST(gzTest, TopicEchoNum) { // Launch a new publisher process that advertises a topic. std::string publisher_path = testing::portablePathUnion( diff --git a/src/cmd/gz_src_TEST.cc b/src/cmd/gz_src_TEST.cc index b2623ef09..4398595d1 100644 --- a/src/cmd/gz_src_TEST.cc +++ b/src/cmd/gz_src_TEST.cc @@ -22,7 +22,7 @@ #include #include "gtest/gtest.h" -#include "ign.hh" +#include "gz.hh" #include "gz/transport/Node.hh" #include "gz/transport/test_config.h" @@ -73,7 +73,7 @@ bool srvEcho(const gz::msgs::Int32 &_req, gz::msgs::Int32 &_rep) ////////////////////////////////////////////////// /// \brief Check cmdTopicInfo running the advertiser on a the same process. -TEST(ignTest, cmdTopicInfo) +TEST(gzTest, cmdTopicInfo) { std::stringstream stdOutBuffer; std::stringstream stdErrBuffer; @@ -96,7 +96,7 @@ TEST(ignTest, cmdTopicInfo) ////////////////////////////////////////////////// /// \brief Check cmdServiceInfo running the advertiser on a the same process. -TEST(ignTest, cmdServiceInfo) +TEST(gzTest, cmdServiceInfo) { std::stringstream stdOutBuffer; std::stringstream stdErrBuffer; @@ -120,7 +120,7 @@ TEST(ignTest, cmdServiceInfo) ////////////////////////////////////////////////// /// \brief Check cmdTopicPub running the advertiser on a the same process. -TEST(ignTest, cmdTopicPub) +TEST(gzTest, cmdTopicPub) { std::stringstream stdOutBuffer; std::stringstream stdErrBuffer; @@ -148,7 +148,7 @@ TEST(ignTest, cmdTopicPub) ////////////////////////////////////////////////// /// \brief Check cmdServiceReq running the advertiser on a the same process. -TEST(ignTest, cmdServiceReq) +TEST(gzTest, cmdServiceReq) { std::stringstream stdOutBuffer; std::stringstream stdErrBuffer; @@ -221,7 +221,7 @@ TEST(ignTest, cmdServiceReq) ////////////////////////////////////////////////// /// \brief Check cmdTopicEcho running the advertiser on a the same process. -TEST(ignTest, cmdTopicEcho) +TEST(gzTest, cmdTopicEcho) { std::stringstream stdOutBuffer; std::stringstream stdErrBuffer; @@ -243,7 +243,7 @@ TEST(ignTest, cmdTopicEcho) } ///////////////////////////////////////////////// -TEST(ignTest, cmdTopicEchoOutputFormats) +TEST(gzTest, cmdTopicEchoOutputFormats) { std::stringstream stdOutBuffer; std::stringstream stdErrBuffer; diff --git a/src/cmd/service_main.cc b/src/cmd/service_main.cc index 4f92bdd33..2fda8c1a0 100644 --- a/src/cmd/service_main.cc +++ b/src/cmd/service_main.cc @@ -17,7 +17,7 @@ #include -#include "ign.hh" +#include "gz.hh" #include diff --git a/src/cmd/topic_main.cc b/src/cmd/topic_main.cc index e22ee872c..60308dbdb 100644 --- a/src/cmd/topic_main.cc +++ b/src/cmd/topic_main.cc @@ -17,7 +17,7 @@ #include -#include "ign.hh" +#include "gz.hh" #include diff --git a/tutorials/02_installation.md b/tutorials/02_installation.md index 2481a6d8a..211933df5 100644 --- a/tutorials/02_installation.md +++ b/tutorials/02_installation.md @@ -67,8 +67,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: @@ -210,7 +210,7 @@ Navigate to `condabin` if necessary to use the `conda` command (i.e., if Conda i Activate the Conda environment: ``` -conda activate ign-ws +conda activate gz-ws ``` Install prerequisites: diff --git a/tutorials/04_messages.md b/tutorials/04_messages.md index e713249bc..a4e2de65c 100644 --- a/tutorials/04_messages.md +++ b/tutorials/04_messages.md @@ -591,10 +591,10 @@ From terminal 1: From terminal 2 (requires Gazebo Tools): ```{.sh} -ign topic --echo -t /bar +gz topic --echo -t /bar ``` And you should receive all the messages coming in terminal 2. -The command `ign log playback` also supports the notion of topic remapping. Run -`ign log playback -h` in your terminal for further details (requires Gazebo Tools). +The command `gz log playback` also supports the notion of topic remapping. Run +`gz log playback -h` in your terminal for further details (requires Gazebo Tools). diff --git a/tutorials/06_security.md b/tutorials/06_security.md index 48c6b870b..7ee434615 100644 --- a/tutorials/06_security.md +++ b/tutorials/06_security.md @@ -42,11 +42,11 @@ First, let's test unsecure communication. This example requires 1. Open a terminal, and echo topic `/foo`. ``` -ign topic -t /foo -e +gz topic -t /foo -e ``` 2. Open a second terminal and publish a message on topic `/foo`. ``` -ign topic -t /foo -m gz.msgs.StringMsg -p 'data:"Unsecure message"' +gz topic -t /foo -m gz.msgs.StringMsg -p 'data:"Unsecure message"' ``` 3. The first terminal should see the following output. ``` @@ -55,7 +55,7 @@ data: "Unsecure message" Now let's try a secure publisher and an unsecure subscriber. -1. Leave the first terminal running `ign topic -t /foo -e`. +1. Leave the first terminal running `gz topic -t /foo -e`. 2. Setup authentication in the second terminal: ``` export GZ_TRANSPORT_USERNAME=user @@ -63,7 +63,7 @@ export GZ_TRANSPORT_PASSWORD=pass ``` 3. Now publish a message in the second terminal: ``` -ign topic -t /foo -m gz.msgs.StringMsg -p 'data:"Secure message"' +gz topic -t /foo -m gz.msgs.StringMsg -p 'data:"Secure message"' ``` 4. The first terminal should not change, which indicates that subscriber was not able to authenticate with the secure publisher. @@ -77,12 +77,12 @@ export GZ_TRANSPORT_PASSWORD=pass ``` 2. Echo the `/foo` topic in the secure third terminal. ``` -ign topic -t /foo -e +gz topic -t /foo -e ``` 3. Go back to the secure publisher in the second terminal, and re-run the publish command. ``` -ign topic -t /foo -m gz.msgs.StringMsg -p 'data:"Secure message"' +gz topic -t /foo -m gz.msgs.StringMsg -p 'data:"Secure message"' ``` 4. The third terminal, running the secure subscriber, should output the following. diff --git a/tutorials/07_relay.md b/tutorials/07_relay.md index 79efdeffd..1f46ed4f1 100644 --- a/tutorials/07_relay.md +++ b/tutorials/07_relay.md @@ -109,7 +109,7 @@ Open a terminal in your host and launch your subscriber, forcing Ignition Transport to only bind to the IP address that we found in the previous step: ``` -GZ_IP=172.23.1.7 GZ_PARTITION=relay ign topic -e -t /foo +GZ_IP=172.23.1.7 GZ_PARTITION=relay gz topic -e -t /foo ``` You shouldn't receive anything as the discovery messages are not reaching both @@ -142,7 +142,7 @@ Go back to your terminal in the host and configure the environment variable `GZ_RELAY` with the IP address used inside the container. ``` -GZ_RELAY=172.17.0.3 GZ_IP=172.23.1.7 GZ_PARTITION=relay ign topic -e -t /foo +GZ_RELAY=172.17.0.3 GZ_IP=172.23.1.7 GZ_PARTITION=relay gz topic -e -t /foo ``` Now, you should receive the messages, as your node in the host is directly diff --git a/tutorials/10_logging.md b/tutorials/10_logging.md index 0185e574b..e37ffc8ab 100644 --- a/tutorials/10_logging.md +++ b/tutorials/10_logging.md @@ -9,7 +9,7 @@ In this tutorial, we are going to describe the process of recording and playing back a collection of messages. Gazebo Transport provides two mechanisms for logging: a C++ API and a set of -command line utilities as part of the optional `ign` CLI tool (available via +command line utilities as part of the optional `gz` CLI tool (available via [Gazebo Tools](https://github.com/gazebosim/gz-tools)). We use [SQLite3](https://www.sqlite.org) to create a file containing all the messages recorded during a session. You can imagine it as a container where all the @@ -244,10 +244,10 @@ Press Ctrl+C to finish recording. Recording... ``` -From terminal 2, publish a message using `ign`: +From terminal 2, publish a message using `gz`: ```{.sh} -ign topic -t /foo -m gz.msgs.StringMsg -p 'data:"Hello log"' +gz topic -t /foo -m gz.msgs.StringMsg -p 'data:"Hello log"' ``` From terminal 1, hit `CTRL-C` in your recorder terminal to stop the recording. @@ -255,7 +255,7 @@ From terminal 1, hit `CTRL-C` in your recorder terminal to stop the recording. Moving back to terminal 2, run a subscriber: ```{.sh} -ign topic -t /foo -e +gz topic -t /foo -e ``` And from terminal 1, playback your log file: @@ -270,28 +270,28 @@ You should receive one message in terminal 2: data: "Hello log" ``` -## Using `ign` for recording and playing back +## Using `gz` for recording and playing back -As an alternative to the C++ API, we could use the `ign` suite of command line +As an alternative to the C++ API, we could use the `gz` suite of command line tools for recording and playing back messages. -Next is how you can record a set of messages using `ign`: +Next is how you can record a set of messages using `gz`: ```{.sh} -ign log record --force --file tutorial.tlog +gz log record --force --file tutorial.tlog ``` -And here's how you can play back the previous log file using `ign`: +And here's how you can play back the previous log file using `gz`: ```{.sh} -ign log playback --file tutorial.tlog +gz log playback --file tutorial.tlog ``` For further options, try running: ```{.sh} -ign log record -h +gz log record -h ``` and ```{.sh} -ign log playback -h +gz log playback -h ``` diff --git a/tutorials/23_topic_statistics.md b/tutorials/23_topic_statistics.md index 749243a41..fd3420086 100644 --- a/tutorials/23_topic_statistics.md +++ b/tutorials/23_topic_statistics.md @@ -48,7 +48,7 @@ A complete example can be found in the [subscriber_stats example program](https: With both `GZ_TRANSPORT_TOPIC_STATISTICS` set to `1` and a node enabling topic statistics, then you will be able to echo statistic -information from the command line using `ign topic -et /statistics`. +information from the command line using `gz topic -et /statistics`. It is possible to change the statistics output topic from `/statistics` to one of your choosing by specifying a topic name when enabling topic @@ -78,4 +78,4 @@ then you can test topic statistics by following these steps. 1. Terminal 1: `GZ_TRANSPORT_TOPIC_STATISTICS=1 ./examples/build/publisher` 1. Terminal 2: `GZ_TRANSPORT_TOPIC_STATISTICS=1 ./examples/build/subscriber_stats` -1. Terminal 3: `GZ_TRANSPORT_TOPIC_STATISTICS=1 ign topic -et /statistics` +1. Terminal 3: `GZ_TRANSPORT_TOPIC_STATISTICS=1 gz topic -et /statistics`