diff --git a/CMakeLists.txt b/CMakeLists.txt index a322227f..92b9d39a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,7 @@ ign_configure_project( # Set project-specific options #============================================================================ -set(IGN_LAUNCH_PLUGIN_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/${IGN_LIB_INSTALL_DIR}/ign-${IGN_DESIGNATION}-${PROJECT_VERSION_MAJOR}/plugins/") +set(GZ_LAUNCH_PLUGIN_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/${IGN_LIB_INSTALL_DIR}/ign-${IGN_DESIGNATION}-${PROJECT_VERSION_MAJOR}/plugins/") #============================================================================ # Search for project-specific dependencies diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 820e43fd..65eec816 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -56,7 +56,7 @@ further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at [https://ignitionrobotics.org/support](https://ignitionrobotics.org/support). All +reported by contacting the project team at [https://gazebosim.org/support](https://gazebosim.org/support). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 147239ce..a1c121ea 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1 +1 @@ -See the [Ignition Robotics contributing guide](https://ignitionrobotics.org/docs/all/contributing). +See the [Gazebo contributing guide](https://gazebosim.org/docs/all/contributing). diff --git a/Changelog.md b/Changelog.md index 8e62241d..84ec2a4a 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,170 +1,170 @@ -## Ignition Launch 6.x +## Gazebo Launch 6.x -### Ignition Launch 6.X.X (202X-XX-XX) +### Gazebo Launch 6.X.X (202X-XX-XX) -## Ignition Launch 5.x +## Gazebo Launch 5.x -### Ignition Launch 5.X.X (20XX-XX-XX) +### Gazebo Launch 5.X.X (20XX-XX-XX) -### Ignition Launch 5.1.0 (2022-03-21) +### Gazebo Launch 5.1.0 (2022-03-21) 1. Use exec instead of popen to run ign-launch binary - * [Pull request #151](https://github.com/ignitionrobotics/ign-launch/pull/151) + * [Pull request #151](https://github.com/gazebosim/gz-launch/pull/151) 1. Expose headless_rendering sdf tag - * [Pull request #148](https://github.com/ignitionrobotics/ign-launch/pull/148) + * [Pull request #148](https://github.com/gazebosim/gz-launch/pull/148) 1. Remove spammy CMake message - * [Pull request #142](https://github.com/ignitionrobotics/ign-launch/pull/142) + * [Pull request #142](https://github.com/gazebosim/gz-launch/pull/142) -### Ignition Launch 5.0.0 (2021-10-01) +### Gazebo Launch 5.0.0 (2021-10-01) 1. Port ign-launch to Windows - * [Pull request #120](https://github.com/ignitionrobotics/ign-launch/pull/120) + * [Pull request #120](https://github.com/gazebosim/gz-launch/pull/120) 1. Add standalone executables - * [Pull request #121](https://github.com/ignitionrobotics/ign-launch/pull/121) - * [Pull request #131](https://github.com/ignitionrobotics/ign-launch/pull/131) + * [Pull request #121](https://github.com/gazebosim/gz-launch/pull/121) + * [Pull request #131](https://github.com/gazebosim/gz-launch/pull/131) 1. Remove unused includes (fix build) - * [Pull request #119](https://github.com/ignitionrobotics/ign-launch/pull/119) + * [Pull request #119](https://github.com/gazebosim/gz-launch/pull/119) 1. Bumps dependencies for fortress - * [Pull request #110](https://github.com/ignitionrobotics/ign-launch/pull/110) + * [Pull request #110](https://github.com/gazebosim/gz-launch/pull/110) 1. Infrastructure - * [Pull request #113](https://github.com/ignitionrobotics/ign-launch/pull/113) - * [Pull request #106](https://github.com/ignitionrobotics/ign-launch/pull/106) + * [Pull request #113](https://github.com/gazebosim/gz-launch/pull/113) + * [Pull request #106](https://github.com/gazebosim/gz-launch/pull/106) -## Ignition Launch 4.x +## Gazebo Launch 4.x -### Ignition Launch 4.X.X (20XX-XX-XX) +### Gazebo Launch 4.X.X (20XX-XX-XX) -### Ignition Launch 4.1.0 (2021-10-14) +### Gazebo Launch 4.1.0 (2021-10-14) -1. All changes included in Ignition Launch 3.4.2. +1. All changes included in Gazebo Launch 3.4.2. -### Ignition Launch 4.0.0 (2021-03-30) +### Gazebo Launch 4.0.0 (2021-03-30) 1. Bump in edifice: ign-common4 - * [Pull request #90](https://github.com/ignitionrobotics/ign-launch/pull/90) + * [Pull request #90](https://github.com/gazebosim/gz-launch/pull/90) 1. Bump in edifice: sdformat11 - * [Pull request #87](https://github.com/ignitionrobotics/ign-launch/pull/87) + * [Pull request #87](https://github.com/gazebosim/gz-launch/pull/87) 1. Bump in edifice: ign-msgs7 - * [Pull request #86](https://github.com/ignitionrobotics/ign-launch/pull/86) + * [Pull request #86](https://github.com/gazebosim/gz-launch/pull/86) 1. Bump in edifice: ign-rendering5 - * [Pull request #69](https://github.com/ignitionrobotics/ign-launch/pull/69) + * [Pull request #69](https://github.com/gazebosim/gz-launch/pull/69) -## Ignition Launch 3.x +## Gazebo Launch 3.x -### Ignition Launch 3.4.2 (2021-10-14) +### Gazebo Launch 3.4.2 (2021-10-14) -1. All changes included in Ignition Launch 2.2.2. +1. All changes included in Gazebo Launch 2.2.2. -### Ignition Launch 3.4.1 (2021-07-15) +### Gazebo Launch 3.4.1 (2021-07-15) 1. Generate a better error websocket error code for `max_connections`. - * [Pull request 123](https://github.com/ignitionrobotics/ign-launch/pull/123) + * [Pull request 123](https://github.com/gazebosim/gz-launch/pull/123) -### Ignition Launch 3.4.0 (2021-06-09) +### Gazebo Launch 3.4.0 (2021-06-09) 1. Extend websocket server to support message limits and throttling. - * [Pull request 116](https://github.com/ignitionrobotics/ign-launch/pull/116) + * [Pull request 116](https://github.com/gazebosim/gz-launch/pull/116) -### Ignition Launch 3.3.0 (2021-05-06) +### Gazebo Launch 3.3.0 (2021-05-06) 1. Convert depth and thermal image data to RGB before sending over websockets - * [Pull request 112](https://github.com/ignitionrobotics/ign-launch/pull/112) + * [Pull request 112](https://github.com/gazebosim/gz-launch/pull/112) -### Ignition Launch 3.2.1 (2021-04-19) +### Gazebo Launch 3.2.1 (2021-04-19) 1. Add header to image msg. - * [Pull request 109](https://github.com/ignitionrobotics/ign-launch/pull/109) + * [Pull request 109](https://github.com/gazebosim/gz-launch/pull/109) -### Ignition Launch 3.2.0 (2021-04-12) +### Gazebo Launch 3.2.0 (2021-04-12) 1. Support unsubscribing from a topic in the websocket server. - * [Pull request 107](https://github.com/ignitionrobotics/ign-launch/pull/107) + * [Pull request 107](https://github.com/gazebosim/gz-launch/pull/107) 1. Support particle_emitters in the websocket server. - * [Pull request 104](https://github.com/ignitionrobotics/ign-launch/pull/104) + * [Pull request 104](https://github.com/gazebosim/gz-launch/pull/104) 1. Support getting topic names and message types in the websocket server. - * [Pull request 102](https://github.com/ignitionrobotics/ign-launch/pull/102) + * [Pull request 102](https://github.com/gazebosim/gz-launch/pull/102) 1. Image streaming over websocket. - * [Pull request 97](https://github.com/ignitionrobotics/ign-launch/pull/97) + * [Pull request 97](https://github.com/gazebosim/gz-launch/pull/97) -1. Treat IGN_LAUNCH_CONFIG_PATH as a path list. - * [Pull request 93](https://github.com/ignitionrobotics/ign-launch/pull/93) +1. Treat GZ_LAUNCH_CONFIG_PATH as a path list. + * [Pull request 93](https://github.com/gazebosim/gz-launch/pull/93) -### Ignition Launch 3.1.1 (2021-01-08) +### Gazebo Launch 3.1.1 (2021-01-08) 1. All changes up to and including those in version 2.2.1. -### Ignition Launch 3.1.0 (2020-12-10) +### Gazebo Launch 3.1.0 (2020-12-10) 1. All changes up to and including those in version 2.2.0. -### Ignition Launch 3.0.0 (2020-09-30) +### Gazebo Launch 3.0.0 (2020-09-30) 1. Migration from BitBucket to GitHub - * [Pull request 13](https://github.com/ignitionrobotics/ign-launch/pull/13) - * [Pull request 16](https://github.com/ignitionrobotics/ign-launch/pull/16) - * [Pull request 28](https://github.com/ignitionrobotics/ign-launch/pull/28) + * [Pull request 13](https://github.com/gazebosim/gz-launch/pull/13) + * [Pull request 16](https://github.com/gazebosim/gz-launch/pull/16) + * [Pull request 28](https://github.com/gazebosim/gz-launch/pull/28) 1. Add PKGCONFIG information to ignition-tools ign_find_package - * [Pull request 44](https://github.com/ignitionrobotics/ign-launch/pull/44) + * [Pull request 44](https://github.com/gazebosim/gz-launch/pull/44) 1. Depend on ign-msgs6, ign-transport9 - * [Pull request 39](https://github.com/ignitionrobotics/ign-launch/pull/39) + * [Pull request 39](https://github.com/gazebosim/gz-launch/pull/39) 1. Depend on ign-gazebo4, ign-gui4 * [BitBucket pull request 64](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-launch/pull-requests/64) -## Ignition Launch 2.x +## Gazebo Launch 2.x -### Ignition Launch 2.2.2 (2021-10-11) +### Gazebo Launch 2.2.2 (2021-10-11) 1. Master branch updates. - * [Pull request 98](https://github.com/ignitionrobotics/ign-launch/pull/98) + * [Pull request 98](https://github.com/gazebosim/gz-launch/pull/98) -1. Treat `IGN_LAUNCH_CONFIG_PATH` as a path list. - * [Pull request 93](https://github.com/ignitionrobotics/ign-launch/pull/93) +1. Treat `GZ_LAUNCH_CONFIG_PATH` as a path list. + * [Pull request 93](https://github.com/gazebosim/gz-launch/pull/93) 1. Remove tools/code_check and update codecov. - * [Pull request 115](https://github.com/ignitionrobotics/ign-launch/pull/115) + * [Pull request 115](https://github.com/gazebosim/gz-launch/pull/115) 1. Update gtest for Windows compilation. - * [Pull request 122](https://github.com/ignitionrobotics/ign-launch/pull/122) + * [Pull request 122](https://github.com/gazebosim/gz-launch/pull/122) 1. Remove bitbucket-pipelines.yml. - * [Pull request 128](https://github.com/ignitionrobotics/ign-launch/pull/128) + * [Pull request 128](https://github.com/gazebosim/gz-launch/pull/128) -### Ignition Launch 2.2.1 (2021-01-08) +### Gazebo Launch 2.2.1 (2021-01-08) 1. Fix env parsing by placing it before executable parsing. - * [Pull request 81](https://github.com/ignitionrobotics/ign-launch/pull/81) - * [Pull request 82](https://github.com/ignitionrobotics/ign-launch/pull/82) + * [Pull request 81](https://github.com/gazebosim/gz-launch/pull/81) + * [Pull request 82](https://github.com/gazebosim/gz-launch/pull/82) -### Ignition Launch 2.2.0 (2020-10-14) +### Gazebo Launch 2.2.0 (2020-10-14) 1. All changes up to and including those in version 1.10.0 1. Added a tutorial. - * [Pull request 48](https://github.com/ignitionrobotics/ign-launch/pull/48) + * [Pull request 48](https://github.com/gazebosim/gz-launch/pull/48) -### Ignition Launch 2.1.0 (2020-05-21) +### Gazebo Launch 2.1.0 (2020-05-21) 1. Merged ign-launch1 forward. - * [Pull request 41](https://github.com/ignitionrobotics/ign-launch/pull/31) + * [Pull request 41](https://github.com/gazebosim/gz-launch/pull/31) -### Ignition Launch 2.0.0 +### Gazebo Launch 2.0.0 -1. Use Ignition Citadel dependencies. +1. Use Gazebo Citadel dependencies. * [BitBucket pull request 47](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-launch/pull-requests/47) * [BitBucket pull request 50](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-launch/pull-requests/50) * [BitBucket pull request 53](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-launch/pull-requests/53) @@ -175,84 +175,84 @@ 1. Unversioned lib name for cmds * [BitBucket pull request 55](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-launch/pull-requests/55) -## Ignition Launch 1.x +## Gazebo Launch 1.x -### Ignition Launch 1.X.X (20XX-XX-XX) +### Gazebo Launch 1.X.X (20XX-XX-XX) -### Ignition Launch 1.10.0 (2020-09-25) +### Gazebo Launch 1.10.0 (2020-09-25) * Modernize Github Actions CI. - * [Pull request 42](https://github.com/ignitionrobotics/ign-launch/pull/42) + * [Pull request 42](https://github.com/gazebosim/gz-launch/pull/42) 1. Add PKGCONFIG information to ignition-tools ign_find_package - * [Pull Request 44](https://github.com/ignitionrobotics/ign-launch/pull/44) + * [Pull Request 44](https://github.com/gazebosim/gz-launch/pull/44) 1. Fix factory.ign launch file - * [Pull Request 55](https://github.com/ignitionrobotics/ign-launch/pull/55) + * [Pull Request 55](https://github.com/gazebosim/gz-launch/pull/55) 1. Use random name for manager semaphore - * [Pull Request 57](https://github.com/ignitionrobotics/ign-launch/pull/57) + * [Pull Request 57](https://github.com/gazebosim/gz-launch/pull/57) 1. Add support for specifying topics to record - * [Pull Request 54](https://github.com/ignitionrobotics/ign-launch/pull/54) + * [Pull Request 54](https://github.com/gazebosim/gz-launch/pull/54) 1. Fix race condition in websocket server. - * [Pull Request 68](https://github.com/ignitionrobotics/ign-launch/pull/68) + * [Pull Request 68](https://github.com/gazebosim/gz-launch/pull/68) -### Ignition Launch 1.9.0 (2020-08-13) +### Gazebo Launch 1.9.0 (2020-08-13) 1. Added HTTP handling support to websocket server and a metrics HTTP endpoint to monitor websocket server status. - * [Pull Request 49](https://github.com/ignitionrobotics/ign-launch/pull/49) + * [Pull Request 49](https://github.com/gazebosim/gz-launch/pull/49) -### Ignition Launch 1.8.0 (2020-07-28) +### Gazebo Launch 1.8.0 (2020-07-28) 1. Added `` to the websocket server that supports specifying the maximum allowed websocket connections. - * [Pull Request 40](https://github.com/ignitionrobotics/ign-launch/pull/40) + * [Pull Request 40](https://github.com/gazebosim/gz-launch/pull/40) -### Ignition Launch 1.7.1 (2020-06-23) +### Gazebo Launch 1.7.1 (2020-06-23) 1. Improve websocket performance by throttling the busy loop, and fix empty SSL XML elements. - * [Pull Request 37](https://github.com/ignitionrobotics/ign-launch/pull/37) + * [Pull Request 37](https://github.com/gazebosim/gz-launch/pull/37) -### Ignition Launch 1.7.0 (2020-06-16) +### Gazebo Launch 1.7.0 (2020-06-16) 1. Added SSL to websocket server. - * [Pull Request 34](https://github.com/ignitionrobotics/ign-launch/pull/34) + * [Pull Request 34](https://github.com/gazebosim/gz-launch/pull/34) -### Ignition Launch 1.6.0 (2020-06-11) +### Gazebo Launch 1.6.0 (2020-06-11) 1. Improved websockets by: adding simple authentication, access to protobuf message definitions, access to scene and world information, and definition of custom message framing. - * [Pull Request 22](https://github.com/ignitionrobotics/ign-launch/pull/22) - * [Pull Request 21](https://github.com/ignitionrobotics/ign-launch/pull/21) - * [Pull Request 17](https://github.com/ignitionrobotics/ign-launch/pull/17) - * [Pull Request 33](https://github.com/ignitionrobotics/ign-launch/pull/33) + * [Pull Request 22](https://github.com/gazebosim/gz-launch/pull/22) + * [Pull Request 21](https://github.com/gazebosim/gz-launch/pull/21) + * [Pull Request 17](https://github.com/gazebosim/gz-launch/pull/17) + * [Pull Request 33](https://github.com/gazebosim/gz-launch/pull/33) -### Ignition Launch 1.5.0 (2020-05-20) +### Gazebo Launch 1.5.0 (2020-05-20) 1. Added support for spawning multiple entities in the same simulation step. - * [Pull Request 30](https://github.com/ignitionrobotics/ign-launch/pull/30) + * [Pull Request 30](https://github.com/gazebosim/gz-launch/pull/30) -### Ignition Launch 1.4.2 (2020-05-18) +### Gazebo Launch 1.4.2 (2020-05-18) 1. Use the new GUI API of ign-gazebo. This adds support for saving worlds to SDFormat from the GUI. - * [Pull Request 19](https://github.com/ignitionrobotics/ign-launch/pull/19) + * [Pull Request 19](https://github.com/gazebosim/gz-launch/pull/19) -### Ignition Launch 1.4.1 (2019-12-05) +### Gazebo Launch 1.4.1 (2019-12-05) 1. Unversioned lib name for cmds * [BitBucket pull request 56](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-launch/pull-requests/56) -### Ignition Launch 1.4.0 (2019-11-26) +### Gazebo Launch 1.4.0 (2019-11-26) 1. Default GUI config for Launch * [BitBucket pull request 51](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-launch/pull-requests/51) -### Ignition Launch 1.3.0 (2019-11-13) +### Gazebo Launch 1.3.0 (2019-11-13) 1. Add filepath to ERB so that constants like `__FILE__` in `.ign` files work as expected * [BitBucket pull request 48](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-launch/pull-requests/48) @@ -260,12 +260,12 @@ 1. Add backward support to ign-launch to capture backtraces. * [BitBucket pull request 41](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-launch/pull-requests/41) -### Ignition Launch 1.2.3 (2019-09-09) +### Gazebo Launch 1.2.3 (2019-09-09) 1. Add QML import path to IgnGazebo modules. * [BitBucket pull request 42](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-launch/pull-requests/42) -### Ignition Launch 1.2.2 +### Gazebo Launch 1.2.2 1. Add support for console logging. * [BitBucket pull request 40](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-launch/pull-requests/40) @@ -273,12 +273,12 @@ 1. Support setting custom window icons. * [BitBucket pull request 39](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-launch/pull-requests/39) -### Ignition Launch 1.2.1 +### Gazebo Launch 1.2.1 1. Eliminate potential deadlock from SIGCHLD signal handler * [BitBucket pull request 36](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-launch/pull-requests/36) -### Ignition Launch 1.2.0 +### Gazebo Launch 1.2.0 1. Support for custom random seed in the GazeboServer plugin. * [BitBucket pull request 33](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-launch/pull-requests/33) @@ -286,17 +286,17 @@ 1. Allow specifying a custom window title * [BitBucket pull request 32](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-launch/pull-requests/32) -### Ignition Launch 1.1.0 (2019-06-11) +### Gazebo Launch 1.1.0 (2019-06-11) 1. Added command line parameters of the form :=. These parameters are passed to ERB. * [BitBucket pull request 27](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-launch/pull-requests/27) -### Ignition Launch 1.0.1 (2019-05-22) +### Gazebo Launch 1.0.1 (2019-05-22) 1. Fix GazeboFactory set performer topic * [BitBucket pull request 26](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-launch/pull-requests/26) -### Ignition Launch 1.0.0 (2019-05-21) +### Gazebo Launch 1.0.0 (2019-05-21) 1. Enable logging with `` tag in ign launch file. * [BitBucket pull request 23](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-launch/pull-requests/23) @@ -320,9 +320,9 @@ * [BitBucket pull request 15](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-launch/pull-requests/15) * [BitBucket pull request 18](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-launch/pull-requests/18) -## Ignition Launch 0.x +## Gazebo Launch 0.x 1. Install examples folder. * [BitBucket pull request 14](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-launch/pull-requests/14) -### Ignition Launch 0.2.0 +### Gazebo Launch 0.2.0 diff --git a/Migration.md b/Migration.md index 7d5de6f4..a14c23e0 100644 --- a/Migration.md +++ b/Migration.md @@ -5,11 +5,23 @@ Deprecated code produces compile-time warnings. These warning serve as notification to users that their code should be upgraded. The next major release will remove the deprecated code. -## Ignition Launch 2.2.2 +## Gazebo Launch 5.X to 6.X -- Environment variable `IGN_LAUNCH_CONFIG_PATH` started to be treated as a path +- The `ignition` namespace is deprecated and will be removed in future versions. + Use `gz` instead. + +- Header files under `ignition/...` are deprecated and will be removed in future versions. + Use `gz/...` instead. + +- Migrate `IGN_LAUNCH_PLUGIN_PATH` environment variable to `GZ_LAUNCH_PLUGIN_PATH` for finding + plugin. + With tick-tock. + +## Gazebo Launch 2.2.2 + +- Environment variable `GZ_LAUNCH_CONFIG_PATH` started to be treated as a path list (colon-separated on Linux, semicolon-separated on Windows). Before, only a single path could be set here, and setting a path list would break the whole launch file lookup functionality. -## Ignition Launch 0.X to N.M +## Gazebo Launch 0.X to N.M diff --git a/README.md b/README.md index 1242d698..e4c26158 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,21 @@ -# Ignition Launch : Run and manage programs and plugins +# Gazebo Launch : Run and manage programs and plugins **Maintainer:** nate AT openrobotics DOT org -[![GitHub open issues](https://img.shields.io/github/issues-raw/ignitionrobotics/ign-launch.svg)](https://github.com/ignitionrobotics/ign-launch/issues) -[![GitHub open pull requests](https://img.shields.io/github/issues-pr-raw/ignitionrobotics/ign-launch.svg)](https://github.com/ignitionrobotics/ign-launch/pulls) +[![GitHub open issues](https://img.shields.io/github/issues-raw/gazebosim/gz-launch.svg)](https://github.com/gazebosim/gz-launch/issues) +[![GitHub open pull requests](https://img.shields.io/github/issues-pr-raw/gazebosim/gz-launch.svg)](https://github.com/gazebosim/gz-launch/pulls) [![Discourse topics](https://img.shields.io/discourse/https/community.gazebosim.org/topics.svg)](https://community.gazebosim.org) [![Hex.pm](https://img.shields.io/hexpm/l/plug.svg)](https://www.apache.org/licenses/LICENSE-2.0) Build | Status -- | -- -Test coverage | [![codecov](https://codecov.io/gh/ignitionrobotics/ign-launch/branch/main/graph/badge.svg)](https://codecov.io/gh/ignitionrobotics/ign-launch) +Test coverage | [![codecov](https://codecov.io/gh/gazebosim/gz-launch/branch/main/graph/badge.svg)](https://codecov.io/gh/gazebosim/gz-launch) Ubuntu Focal | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=ignition_launch-ci-main-focal-amd64)](https://build.osrfoundation.org/job/ignition_launch-ci-main-focal-amd64) Homebrew | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=ignition_launch-ci-main-homebrew-amd64)](https://build.osrfoundation.org/job/ignition_launch-ci-main-homebrew-amd64) Windows | [![Build Status](https://build.osrfoundation.org/job/ign_launch-ign-5-win/badge/icon)](https://build.osrfoundation.org/job/ign_launch-ign-5-win/) -Ignition Launch, a component of [Ignition -Robotics](https://ignitionrobotics.org), provides a command line interface +Gazebo Launch, a component of [Ignition +Robotics](https://gazebosim.org), provides a command line interface to run and manager application and plugins. # Table of Contents @@ -42,7 +42,7 @@ to run and manager application and plugins. # Features -Ignition Launch is used to run and manage plugins and programs. A +Gazebo Launch is used to run and manage plugins and programs. A configuration script can be used to specify which programs and plugins to execute. Alternatively, individual programs and plugins can be run from the command line. Example configuration scripts are located in the `examples` @@ -55,15 +55,15 @@ directory. # Install -See the [installation tutorial](https://ignitionrobotics.org/api/launch/5.0/install.html). +See the [installation tutorial](https://gazebosim.org/api/launch/5.0/install.html). # Usage -Sample launch configuration files are in the [examples directory](https://github.com/ignitionrobotics/ign-launch/blob/main/examples/). +Sample launch configuration files are in the [examples directory](https://github.com/gazebosim/gz-launch/blob/main/examples/). **Example** -1. Run a configuration that launches [Gazebo](https://ignitionrobotics.org/libs/gazebo). +1. Run a configuration that launches [Gazebo](https://gazebosim.org/libs/gazebo). ``` ign launch gazebo.ign @@ -75,10 +75,10 @@ In the event that the installation is a mix of Debian and from source, command line tools from `ign-tools` may not work correctly. A workaround for a single package is to define the environment variable -`IGN_CONFIG_PATH` to point to the location of the Ignition library installation, +`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 IGN_CONFIG_PATH=/usr/local/share/ignition +export GZ_CONFIG_PATH=/usr/local/share/ignition ``` However, that environment variable only takes a single path, which means if the @@ -93,14 +93,14 @@ ln -s /usr/local/share/ignition/fuel4.yaml . ln -s /usr/local/share/ignition/transport7.yaml . ln -s /usr/local/share/ignition/transportlog7.yaml . ... -export IGN_CONFIG_PATH=$HOME/.ignition/tools/configs +export GZ_CONFIG_PATH=$HOME/.ignition/tools/configs ``` -This issue is tracked [here](https://github.com/ignitionrobotics/ign-tools/issues/8). +This issue is tracked [here](https://github.com/gazebosim/gz-tools/issues/8). # Documentation -See the [installation tutorial](https://ignitionrobotics.org/api/launch/5.0/install.html). +See the [installation tutorial](https://gazebosim.org/api/launch/5.0/install.html). # Folder Structure @@ -124,17 +124,17 @@ ign-launch # Contributing -Please see the [contribution guide](https://ignitionrobotics.org/docs/all/contributing). +Please see the [contribution guide](https://gazebosim.org/docs/all/contributing). # Code of Conduct Please see -[CODE_OF_CONDUCT.md](https://github.com/ignitionrobotics/ign-gazebo/blob/main/CODE_OF_CONDUCT.md). +[CODE_OF_CONDUCT.md](https://github.com/gazebosim/gz-sim/blob/main/CODE_OF_CONDUCT.md). # Versioning -This library uses [Semantic Versioning](https://semver.org/). Additionally, this library is part of the [Ignition Robotics project](https://ignitionrobotics.org) which periodically releases a versioned set of compatible and complimentary libraries. See the [Ignition Robotics website](https://ignitionrobotics.org) for version and release information. +This library uses [Semantic Versioning](https://semver.org/). Additionally, this library is part of the [Gazebo project](https://gazebosim.org) which periodically releases a versioned set of compatible and complimentary libraries. See the [Gazebo website](https://gazebosim.org) for version and release information. # License -This library is licensed under [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0). See also the [LICENSE](https://github.com/ignitionrobotics/ign-launch/blob/main/LICENSE) file. +This library is licensed under [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0). See also the [LICENSE](https://github.com/gazebosim/gz-launch/blob/main/LICENSE) file. diff --git a/api.md.in b/api.md.in index d25ca916..e73693e3 100644 --- a/api.md.in +++ b/api.md.in @@ -1,6 +1,6 @@ ## Ignition @IGN_DESIGNATION_CAP@ -Ignition @IGN_DESIGNATION_CAP@ is a component in Ignition Robotics, a set of libraries +Ignition @IGN_DESIGNATION_CAP@ is a component in Gazebo, a set of libraries designed to rapidly develop robot and simulation applications. ## License diff --git a/examples/factory.ign b/examples/factory.ign index cfb978a2..d06bc214 100644 --- a/examples/factory.ign +++ b/examples/factory.ign @@ -1,6 +1,6 @@ - x2 @@ -11,7 +11,7 @@ https://fuel.ignitionrobotics.org/1.0/openrobotics/models/X2 UGV/1 + name="gz::sim::systems::DiffDrive"> front_left_wheel_joint rear_left_wheel_joint front_right_wheel_joint @@ -22,7 +22,7 @@ + name="gz::sim::systems::JointStatePublisher"> diff --git a/examples/gazebo_plugins.ign b/examples/gazebo_plugins.ign index 477eb21d..6fdb1254 100644 --- a/examples/gazebo_plugins.ign +++ b/examples/gazebo_plugins.ign @@ -19,7 +19,7 @@ - /dev/input/js0 false @@ -30,7 +30,7 @@ - /joy /model/vehicle_green/cmd_vel @@ -38,14 +38,14 @@ - /joy /model/vehicle_blue/cmd_vel - <%= worldName %>.sdf true @@ -79,18 +79,18 @@ + name="gz::sim::systems::Physics"> + name="gz::sim::systems::SceneBroadcaster"> + name="gz::sim::systems::DiffDrive"> left_wheel_joint right_wheel_joint 1.25 @@ -100,7 +100,7 @@ + name="gz::sim::systems::DiffDrive"> left_wheel_joint right_wheel_joint 1.25 @@ -111,14 +111,14 @@ - - Ignition Launch + Gazebo Launch + In this example, setting to a resource file shipped with Gazebo GUI --> :/qml/images/drawer.png diff --git a/examples/multi_factory.ign b/examples/multi_factory.ign index 1f338232..48df749b 100644 --- a/examples/multi_factory.ign +++ b/examples/multi_factory.ign @@ -1,6 +1,6 @@ - x2 diff --git a/examples/plugins.ign b/examples/plugins.ign index 6fcd3867..7df01887 100644 --- a/examples/plugins.ign +++ b/examples/plugins.ign @@ -3,7 +3,7 @@ - /dev/input/js0 false @@ -14,7 +14,7 @@ - /joy /model/vehicle_green/cmd_vel @@ -22,12 +22,12 @@ - - + /joy - + /model/vehicle_blue/cmd_vel diff --git a/examples/websocket.ign b/examples/websocket.ign index 25442e3a..29097c24 100644 --- a/examples/websocket.ign +++ b/examples/websocket.ign @@ -1,9 +1,9 @@ - - 30 9002 diff --git a/include/gz/launch/Plugin.hh b/include/gz/launch/Plugin.hh index f9baf314..3409c9b1 100644 --- a/include/gz/launch/Plugin.hh +++ b/include/gz/launch/Plugin.hh @@ -21,12 +21,12 @@ #include #include -namespace ignition +namespace gz { namespace launch { // Inline bracket to help doxygen filtering. - inline namespace IGNITION_LAUNCH_VERSION_NAMESPACE { + inline namespace GZ_LAUNCH_VERSION_NAMESPACE { /// \brief Base class for launch plugins. class Plugin { @@ -38,8 +38,8 @@ namespace ignition }; /// \brief Pointer to a launch plugin. - using PluginPtr = ignition::plugin::SpecializedPluginPtr< - ignition::launch::Plugin>; + using PluginPtr = gz::plugin::SpecializedPluginPtr< + gz::launch::Plugin>; } } } diff --git a/include/gz/launch/config.hh.in b/include/gz/launch/config.hh.in index dbc80216..fbd2d814 100644 --- a/include/gz/launch/config.hh.in +++ b/include/gz/launch/config.hh.in @@ -1,19 +1,37 @@ +/* + * Copyright (C) 2022 Open Source Robotics Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + /* Config.hh. Generated by CMake for @PROJECT_NAME@. */ +#ifndef GZ_LAUNCH_CONFIG_HH_ +#define GZ_LAUNCH_CONFIG_HH_ + /* Version number */ -#define IGNITION_LAUNCH_MAJOR_VERSION ${PROJECT_VERSION_MAJOR} -#define IGNITION_LAUNCH_MINOR_VERSION ${PROJECT_VERSION_MINOR} -#define IGNITION_LAUNCH_PATCH_VERSION ${PROJECT_VERSION_PATCH} +#define GZ_LAUNCH_MAJOR_VERSION ${PROJECT_VERSION_MAJOR} +#define GZ_LAUNCH_MINOR_VERSION ${PROJECT_VERSION_MINOR} +#define GZ_LAUNCH_PATCH_VERSION ${PROJECT_VERSION_PATCH} -#define IGNITION_LAUNCH_VERSION "${PROJECT_VERSION}" -#define IGNITION_LAUNCH_VERSION_FULL "${PROJECT_VERSION_FULL}" +#define GZ_LAUNCH_VERSION "${PROJECT_VERSION}" +#define GZ_LAUNCH_VERSION_FULL "${PROJECT_VERSION_FULL}" -#define IGNITION_LAUNCH_VERSION_HEADER "${PROJECT_NAME_LOWER}, version ${PROJECT_VERSION_FULL}\nCopyright (C) 2019 Open Source Robotics Foundation.\nReleased under the Apache 2.0 License.\n\n" +#define GZ_LAUNCH_VERSION_HEADER "Gazebo Launch, version ${PROJECT_VERSION_FULL}\nCopyright (C) 2019 Open Source Robotics Foundation.\nReleased under the Apache 2.0 License.\n\n" -#define IGNITION_LAUNCH_INITIAL_CONFIG_PATH "${CMAKE_INSTALL_PREFIX}/${IGN_DATA_INSTALL_DIR}/configs" +#define GZ_LAUNCH_INITIAL_CONFIG_PATH "${CMAKE_INSTALL_PREFIX}/${IGN_DATA_INSTALL_DIR}/configs" -#define IGNITION_LAUNCH_PLUGIN_INSTALL_PATH "${IGN_LAUNCH_PLUGIN_INSTALL_PATH}" +#define GZ_LAUNCH_PLUGIN_INSTALL_PATH "${GZ_LAUNCH_PLUGIN_INSTALL_PATH}" -#cmakedefine BUILD_TYPE_PROFILE 1 -#cmakedefine BUILD_TYPE_DEBUG 1 -#cmakedefine BUILD_TYPE_RELEASE 1 +#endif diff --git a/include/ignition/launch.hh b/include/ignition/launch.hh index e5234bb4..f98a82e2 100644 --- a/include/ignition/launch.hh +++ b/include/ignition/launch.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/launch/Export.hh b/include/ignition/launch/Export.hh index ce04efed..6d8f9e22 100644 --- a/include/ignition/launch/Export.hh +++ b/include/ignition/launch/Export.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/launch/Plugin.hh b/include/ignition/launch/Plugin.hh index f0425b68..2167e569 100644 --- a/include/ignition/launch/Plugin.hh +++ b/include/ignition/launch/Plugin.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/launch/config.hh b/include/ignition/launch/config.hh index 32104d75..4ca2fa85 100644 --- a/include/ignition/launch/config.hh +++ b/include/ignition/launch/config.hh @@ -15,4 +15,34 @@ * */ +#ifndef IGNITION_LAUNCH__CONFIG_HH_ +#define IGNITION_LAUNCH__CONFIG_HH_ + #include + +#define IGNITION_LAUNCH_MAJOR_VERSION GZ_LAUNCH_MAJOR_VERSION +#define IGNITION_LAUNCH_MINOR_VERSION GZ_LAUNCH_MINOR_VERSION +#define IGNITION_LAUNCH_PATCH_VERSION GZ_LAUNCH_PATCH_VERSION + +#define IGNITION_LAUNCH_VERSION GZ_LAUNCH_VERSION +#define IGNITION_LAUNCH_VERSION_FULL GZ_LAUNCH_VERSION_FULL + +#define IGNITION_LAUNCH_VERSION_HEADER GZ_LAUNCH_VERSION_HEADER + +#define IGNITION_LAUNCH_INITIAL_CONFIG_PATH GZ_LAUNCH_INITIAL_CONFIG_PATH + +#define IGNITION_LAUNCH_PLUGIN_INSTALL_PATH GZ_LAUNCH_PLUGIN_INSTALL_PATH + +namespace gz +{ +} + +namespace ignition +{ + #ifndef SUPPRESS_IGNITION_HEADER_DEPRECATION + #pragma message("ignition namespace is deprecated! Use gz instead!") + #endif + using namespace gz; +} + +#endif diff --git a/plugins/gazebo_factory/CMakeLists.txt b/plugins/gazebo_factory/CMakeLists.txt index f391d932..0d639c79 100644 --- a/plugins/gazebo_factory/CMakeLists.txt +++ b/plugins/gazebo_factory/CMakeLists.txt @@ -13,4 +13,4 @@ target_link_libraries(${plugin_lower} ignition-plugin${IGN_PLUGIN_MAJOR_VER}::core ) -install (TARGETS ${plugin} DESTINATION ${IGN_LAUNCH_PLUGIN_INSTALL_PATH}) +install (TARGETS ${plugin} DESTINATION ${GZ_LAUNCH_PLUGIN_INSTALL_PATH}) diff --git a/plugins/gazebo_factory/GazeboFactory.cc b/plugins/gazebo_factory/GazeboFactory.cc index 8790ac79..519230c2 100644 --- a/plugins/gazebo_factory/GazeboFactory.cc +++ b/plugins/gazebo_factory/GazeboFactory.cc @@ -15,19 +15,19 @@ * */ -#include -#include +#include +#include -#include -#include +#include +#include #include "GazeboFactory.hh" -using namespace ignition; -using namespace ignition::launch; +using namespace gz; +using namespace gz::launch; ///////////////////////////////////////////////// GazeboFactory::GazeboFactory() - : ignition::launch::Plugin() + : gz::launch::Plugin() { } @@ -74,7 +74,7 @@ void GazeboFactory::ProcessSpawn(const tinyxml2::XMLElement *_elem) // Error if no world was found. if (worlds.empty()) { - ignerr << "No simulation worlds were found. Unable to run the factory. " + gzerr << "No simulation worlds were found. Unable to run the factory. " << "Is Gazebo running?\n"; return; } @@ -82,7 +82,7 @@ void GazeboFactory::ProcessSpawn(const tinyxml2::XMLElement *_elem) // Warning if multiple worlds were found. if (worlds.size() > 1) { - ignwarn << "Multiple simulation worlds were found. Using the first, " + gzwarn << "Multiple simulation worlds were found. Using the first, " << " which has the name[" << *worlds.begin() << "]\n"; } @@ -123,7 +123,7 @@ void GazeboFactory::ProcessSpawn(const tinyxml2::XMLElement *_elem) elem = _elem->FirstChildElement("pose"); if (elem) { - ignition::math::Pose3d pose; + gz::math::Pose3d pose; std::stringstream stream; stream << elem->GetText(); stream >> pose; @@ -162,7 +162,7 @@ bool GazeboFactory::Load(const tinyxml2::XMLElement *_elem) if (executed && result && rep.data()) { - igndbg << "Factory service call succeeded.\n"; + gzdbg << "Factory service call succeeded.\n"; if (!this->worldPerformers[msg.first].empty()) { IGN_SLEEP_S(2); @@ -192,17 +192,17 @@ bool GazeboFactory::Load(const tinyxml2::XMLElement *_elem) { if (result && !rep.data()) { - ignerr << "Factory service call completed, but returned a false value." + gzerr << "Factory service call completed, but returned a false value." << "You may have an invalid request. Check the configuration.\n"; } else { - ignerr << "Factory service call failed.\n"; + gzerr << "Factory service call failed.\n"; } } else { - ignerr << "Factory service call timed out.\n"; + gzerr << "Factory service call timed out.\n"; } } } diff --git a/plugins/gazebo_factory/GazeboFactory.hh b/plugins/gazebo_factory/GazeboFactory.hh index 1f9b56dd..ae47d480 100644 --- a/plugins/gazebo_factory/GazeboFactory.hh +++ b/plugins/gazebo_factory/GazeboFactory.hh @@ -14,22 +14,22 @@ * limitations under the License. * */ -#ifndef IGNITION_LAUNCH_GAZEBOFACTORY_HH_ -#define IGNITION_LAUNCH_GAZEBOFACTORY_HH_ +#ifndef GZ_LAUNCH_GAZEBOFACTORY_HH_ +#define GZ_LAUNCH_GAZEBOFACTORY_HH_ #include -#include -#include -#include "ignition/launch/Plugin.hh" +#include +#include +#include "gz/launch/Plugin.hh" -namespace ignition +namespace gz { namespace launch { /// \brief Spawns entities into simulation. /// /// # Example usage - /// /// /// @@ -50,7 +50,7 @@ namespace ignition /// https://fuel.ignitionrobotics.org/1.0/openrobotics/models/X2 UGV/1 /// /// + /// name="gz::sim::systems::StatePublisher"> /// /// /// @@ -59,7 +59,7 @@ namespace ignition /// ... /// /// - class GazeboFactory : public ignition::launch::Plugin + class GazeboFactory : public gz::launch::Plugin { /// \brief Constructor. public: GazeboFactory(); @@ -90,6 +90,6 @@ namespace ignition } // Register the plugin -IGNITION_ADD_PLUGIN(ignition::launch::GazeboFactory, ignition::launch::Plugin) +IGNITION_ADD_PLUGIN(gz::launch::GazeboFactory, gz::launch::Plugin) #endif diff --git a/plugins/gazebo_gui/CMakeLists.txt b/plugins/gazebo_gui/CMakeLists.txt index 7aa2ca83..21b24ae6 100644 --- a/plugins/gazebo_gui/CMakeLists.txt +++ b/plugins/gazebo_gui/CMakeLists.txt @@ -16,4 +16,4 @@ target_link_libraries(${plugin_lower} ignition-plugin${IGN_PLUGIN_MAJOR_VER}::core ) -install (TARGETS ${plugin} DESTINATION ${IGN_LAUNCH_PLUGIN_INSTALL_PATH}) +install (TARGETS ${plugin} DESTINATION ${GZ_LAUNCH_PLUGIN_INSTALL_PATH}) diff --git a/plugins/gazebo_gui/GazeboGui.cc b/plugins/gazebo_gui/GazeboGui.cc index 30b60cd2..84f48617 100644 --- a/plugins/gazebo_gui/GazeboGui.cc +++ b/plugins/gazebo_gui/GazeboGui.cc @@ -17,20 +17,20 @@ #include -#include -#include -#include -#include -#include "ignition/gazebo/gui/Gui.hh" +#include +#include +#include +#include +#include "gz/sim/gui/Gui.hh" #include "GazeboGui.hh" -using namespace ignition; -using namespace ignition::launch; +using namespace gz; +using namespace gz::launch; ///////////////////////////////////////////////// GazeboGui::GazeboGui() - : ignition::launch::Plugin() + : gz::launch::Plugin() { } @@ -47,18 +47,18 @@ bool GazeboGui::Load(const tinyxml2::XMLElement *_elem) // Set default config file for Launch std::string defaultConfigPath; - ignition::common::env(IGN_HOMEDIR, defaultConfigPath); - defaultConfigPath = ignition::common::joinPaths(defaultConfigPath, + gz::common::env(IGN_HOMEDIR, defaultConfigPath); + defaultConfigPath = gz::common::joinPaths(defaultConfigPath, ".ignition", "launch"); - auto defaultConfigFile = ignition::common::joinPaths(defaultConfigPath, + auto defaultConfigFile = gz::common::joinPaths(defaultConfigPath, "gui.config"); // Check if there's a default config file under // ~/.ignition/launch and use that. If there isn't, create it - if (!ignition::common::exists(defaultConfigFile)) + if (!gz::common::exists(defaultConfigFile)) { - ignition::common::createDirectories(defaultConfigPath); + gz::common::createDirectories(defaultConfigPath); std::ofstream configFile(defaultConfigFile); if (configFile.is_open()) @@ -86,19 +86,19 @@ bool GazeboGui::Load(const tinyxml2::XMLElement *_elem) " \n" << "\n"; configFile.close(); - ignmsg << "Saved file [" << defaultConfigFile << "]" << std::endl; + gzmsg << "Saved file [" << defaultConfigFile << "]" << std::endl; } else { - ignerr << "Unable to open file [" << defaultConfigFile << "]" + gzerr << "Unable to open file [" << defaultConfigFile << "]" << std::endl; } } - auto app = gazebo::gui::createGui(argc, argv, defaultConfigFile.c_str(), + auto app = sim::gui::createGui(argc, argv, defaultConfigFile.c_str(), defaultConfigFile.c_str(), false); - auto win = app->findChild()->QuickWindow(); + auto win = app->findChild()->QuickWindow(); // Customize window std::string windowTitle{"Gazebo"}; @@ -122,7 +122,7 @@ bool GazeboGui::Load(const tinyxml2::XMLElement *_elem) std::string name = nameStr == nullptr ? "" : nameStr; if (name.empty()) { - ignerr << "A GazeboGui plugin is missing the name attribute. " + gzerr << "A GazeboGui plugin is missing the name attribute. " << "Skipping this plugin.\n"; continue; } @@ -132,14 +132,14 @@ bool GazeboGui::Load(const tinyxml2::XMLElement *_elem) std::string file = fileStr == nullptr ? "" : fileStr; if (file.empty()) { - ignerr << "A GazeboServer plugin with name[" << name << "] is " + gzerr << "A GazeboServer plugin with name[" << name << "] is " << "missing the filename attribute. Skipping this plugin.\n"; continue; } app->LoadPlugin(file, elem); } - igndbg << "Running the GazeboGui plugin.\n"; + gzdbg << "Running the GazeboGui plugin.\n"; // This blocks until the window is closed or we receive a SIGINT app->exec(); diff --git a/plugins/gazebo_gui/GazeboGui.hh b/plugins/gazebo_gui/GazeboGui.hh index 0956ad5d..5a1bf183 100644 --- a/plugins/gazebo_gui/GazeboGui.hh +++ b/plugins/gazebo_gui/GazeboGui.hh @@ -14,19 +14,19 @@ * limitations under the License. * */ -#ifndef IGNITION_LAUNCH_GAZEBOGUI_HH_ -#define IGNITION_LAUNCH_GAZEBOGUI_HH_ +#ifndef GZ_LAUNCH_GAZEBOGUI_HH_ +#define GZ_LAUNCH_GAZEBOGUI_HH_ #include -#include -#include -#include +#include +#include +#include -namespace ignition +namespace gz { namespace launch { - /// \brief Runs the Ignition Gazebo GUI. + /// \brief Runs the Gazebo GUI. /// /// The plugin ignores GUI configuration coming from the SDF /// world file or saved in ~/.ignition/gazebo/gui.config. Instead, @@ -38,7 +38,7 @@ namespace ignition /// /// /// - /// /// /// @@ -52,11 +52,11 @@ namespace ignition /// Defaults to the Ignition logo. --> /// full/path/to/window/icon.png /// - /// + /// /// /// /// - class GazeboGui : public ignition::launch::Plugin + class GazeboGui : public gz::launch::Plugin { /// \brief Constructor. public: GazeboGui(); @@ -72,6 +72,6 @@ namespace ignition } // Register the plugin -IGNITION_ADD_PLUGIN(ignition::launch::GazeboGui, ignition::launch::Plugin) +IGNITION_ADD_PLUGIN(gz::launch::GazeboGui, gz::launch::Plugin) #endif diff --git a/plugins/gazebo_server/CMakeLists.txt b/plugins/gazebo_server/CMakeLists.txt index 0a617d00..684ccbe4 100644 --- a/plugins/gazebo_server/CMakeLists.txt +++ b/plugins/gazebo_server/CMakeLists.txt @@ -13,4 +13,4 @@ target_link_libraries(${plugin_lower} ignition-plugin${IGN_PLUGIN_MAJOR_VER}::core ) -install (TARGETS ${plugin} DESTINATION ${IGN_LAUNCH_PLUGIN_INSTALL_PATH}) +install (TARGETS ${plugin} DESTINATION ${GZ_LAUNCH_PLUGIN_INSTALL_PATH}) diff --git a/plugins/gazebo_server/GazeboServer.cc b/plugins/gazebo_server/GazeboServer.cc index 950cdc85..a26d8a7c 100644 --- a/plugins/gazebo_server/GazeboServer.cc +++ b/plugins/gazebo_server/GazeboServer.cc @@ -15,12 +15,12 @@ * */ -#include +#include #include #include "GazeboServer.hh" -using namespace ignition; -using namespace ignition::launch; +using namespace gz; +using namespace gz::launch; ///////////////////////////////////////////////// void copyElement(sdf::ElementPtr _sdf, const tinyxml2::XMLElement *_xml) @@ -52,14 +52,14 @@ void copyElement(sdf::ElementPtr _sdf, const tinyxml2::XMLElement *_xml) ///////////////////////////////////////////////// GazeboServer::GazeboServer() - : ignition::launch::Plugin() + : gz::launch::Plugin() { } ///////////////////////////////////////////////// bool GazeboServer::Load(const tinyxml2::XMLElement *_elem) { - gazebo::ServerConfig serverConfig; + sim::ServerConfig serverConfig; const tinyxml2::XMLElement *elem; // Get the world file @@ -116,7 +116,7 @@ bool GazeboServer::Load(const tinyxml2::XMLElement *_elem) // Update compressed file path to name of recording directory path std::string cmpPath = std::string(recordPathMod); - if (!std::string(1, cmpPath.back()).compare(ignition::common::separator(""))) + if (!std::string(1, cmpPath.back()).compare(gz::common::separator(""))) // Remove the separator at end of path cmpPath = cmpPath.substr(0, cmpPath.length() - 1); cmpPath += ".zip"; @@ -132,47 +132,47 @@ bool GazeboServer::Load(const tinyxml2::XMLElement *_elem) { // Update compressed file path to name of recording directory path cmpPath = std::string(recordPathMod); - if (!std::string(1, cmpPath.back()).compare(ignition::common::separator( + if (!std::string(1, cmpPath.back()).compare(gz::common::separator( ""))) // Remove the separator at end of path cmpPath = cmpPath.substr(0, cmpPath.length() - 1); cmpPath += ".zip"; // Check if path or compressed file with same prefix exists - if (ignition::common::exists(recordPathMod) || - ignition::common::exists(cmpPath)) + if (gz::common::exists(recordPathMod) || + gz::common::exists(cmpPath)) { // Overwrite if flag specified if (overwrite) { bool recordMsg = false, cmpMsg = false; // Remove files before initializing console log files on top of them - if (ignition::common::exists(recordPathMod)) + if (gz::common::exists(recordPathMod)) { recordMsg = true; - ignition::common::removeAll(recordPathMod); + gz::common::removeAll(recordPathMod); } - if (ignition::common::exists(cmpPath)) + if (gz::common::exists(cmpPath)) { cmpMsg = true; - ignition::common::removeFile(cmpPath); + gz::common::removeFile(cmpPath); } // Create log file before printing any messages so they can be logged - ignLogInit(recordPathMod, "server_console.log"); + gzLogInit(recordPathMod, "server_console.log"); if (recordMsg) { - ignmsg << "Log path already exists on disk! Existing files will be " + gzmsg << "Log path already exists on disk! Existing files will be " << "overwritten." << std::endl; - ignmsg << "Removing existing path [" << recordPathMod << "]\n"; + gzmsg << "Removing existing path [" << recordPathMod << "]\n"; } if (cmpMsg) { - ignwarn << "Compressed log path already exists on disk! Existing " + gzwarn << "Compressed log path already exists on disk! Existing " << "files will be overwritten." << std::endl; - ignmsg << "Removing existing compressed file [" << cmpPath << "]\n"; + gzmsg << "Removing existing compressed file [" << cmpPath << "]\n"; } } // Otherwise rename to unique path @@ -180,41 +180,41 @@ bool GazeboServer::Load(const tinyxml2::XMLElement *_elem) { // Remove the separator at end of path if (!std::string(1, recordPathMod.back()).compare( - ignition::common::separator(""))) + gz::common::separator(""))) recordPathMod = recordPathMod.substr(0, recordPathMod.length() - 1); - recordPathMod = ignition::common::uniqueDirectoryPath(recordPathMod); + recordPathMod = gz::common::uniqueDirectoryPath(recordPathMod); cmpPath = std::string(recordPathMod); // Remove the separator at end of path if (!std::string(1, cmpPath.back()).compare( - ignition::common::separator(""))) + gz::common::separator(""))) cmpPath = cmpPath.substr(0, cmpPath.length() - 1); cmpPath += ".zip"; // If compressed file exists, rename again - if (ignition::common::exists(cmpPath)) + if (gz::common::exists(cmpPath)) { - cmpPath = ignition::common::uniqueFilePath(recordPathMod, "zip"); + cmpPath = gz::common::uniqueFilePath(recordPathMod, "zip"); size_t extIdx = cmpPath.find_last_of("."); recordPathMod = cmpPath.substr(0, extIdx); } - ignLogInit(recordPathMod, "server_console.log"); - ignwarn << "Log path already exists on disk! " + gzLogInit(recordPathMod, "server_console.log"); + gzwarn << "Log path already exists on disk! " << "Recording instead to [" << recordPathMod << "]" << std::endl; - ignwarn << "Compressed log path already exists on disk! " + gzwarn << "Compressed log path already exists on disk! " << "Recording instead to [" << cmpPath << "]" << std::endl; } } else { - ignLogInit(recordPathMod, "server_console.log"); + gzLogInit(recordPathMod, "server_console.log"); } } else { - ignLogInit(recordPathMod, "server_console.log"); + gzLogInit(recordPathMod, "server_console.log"); } serverConfig.SetLogRecordPath(recordPathMod); @@ -229,11 +229,11 @@ bool GazeboServer::Load(const tinyxml2::XMLElement *_elem) serverConfig.SetLogRecordCompressPath(cmpPath); } - ignmsg << "Logging to [" << recordPathMod << "]" << std::endl; + gzmsg << "Logging to [" << recordPathMod << "]" << std::endl; } if (serverConfig.UseLogRecord()) - ignmsg << "Recording to [" << recordPathMod << "]\n"; + gzmsg << "Recording to [" << recordPathMod << "]\n"; // Set whether to use a custom random seed elem = _elem->FirstChildElement("seed"); @@ -244,11 +244,11 @@ bool GazeboServer::Load(const tinyxml2::XMLElement *_elem) if (result == tinyxml2::XML_SUCCESS) { serverConfig.SetSeed(seed); - ignmsg << "Using seed [" << seed << "]" << std::endl; + gzmsg << "Using seed [" << seed << "]" << std::endl; } else { - ignerr << "Unable to parse [" << elem->GetText() << "] as a seed." + gzerr << "Unable to parse [" << elem->GetText() << "] as a seed." << " Make sure it's an unsigned int" << std::endl; } } @@ -262,11 +262,11 @@ bool GazeboServer::Load(const tinyxml2::XMLElement *_elem) if (result == tinyxml2::XML_SUCCESS) { serverConfig.SetUpdateRate(updateRate); - ignmsg << "Using update rate [" << updateRate << "]" << std::endl; + gzmsg << "Using update rate [" << updateRate << "]" << std::endl; } else { - ignerr << "Unable to parse [" << elem->GetText() << "] as an update rate." + gzerr << "Unable to parse [" << elem->GetText() << "] as an update rate." << " Make sure it's an unsigned int" << std::endl; } } @@ -289,7 +289,7 @@ bool GazeboServer::Load(const tinyxml2::XMLElement *_elem) std::string name = nameStr == nullptr ? "" : nameStr; if (name.empty()) { - ignerr << "A GazeboServer plugin is missing the name attribute. " + gzerr << "A GazeboServer plugin is missing the name attribute. " << "Skipping this plugin.\n"; continue; } @@ -299,7 +299,7 @@ bool GazeboServer::Load(const tinyxml2::XMLElement *_elem) std::string file = fileStr == nullptr ? "" : fileStr; if (file.empty()) { - ignerr << "A GazeboServer plugin with name[" << name << "] is " + gzerr << "A GazeboServer plugin with name[" << name << "] is " << "missing the filename attribute. Skipping this plugin.\n"; continue; } @@ -309,7 +309,7 @@ bool GazeboServer::Load(const tinyxml2::XMLElement *_elem) std::string entityName = entityNameStr == nullptr ? "" : entityNameStr; if (entityName.empty()) { - ignerr << "A GazeboServer plugin with name[" << name << "] and " + gzerr << "A GazeboServer plugin with name[" << name << "] and " << "filename[" << file << "] is missing the entity_name attribute. " << "Skipping this plugin.\n"; continue; @@ -320,7 +320,7 @@ bool GazeboServer::Load(const tinyxml2::XMLElement *_elem) std::string entityType = entityTypeStr == nullptr ? "" : entityTypeStr; if (entityType.empty()) { - ignerr << "A GazeboServer plugin with name[" << name << "] and " + gzerr << "A GazeboServer plugin with name[" << name << "] and " << "filename[" << file << "] is missing the entity_type attribute. " << "Skipping this plugin.\n"; continue; @@ -344,9 +344,9 @@ bool GazeboServer::Load(const tinyxml2::XMLElement *_elem) } // Create and run the simulation server - this->server.reset(new gazebo::Server(serverConfig)); + this->server.reset(new sim::Server(serverConfig)); this->server->Run(false, 0, !run); - igndbg << "Loaded GazeboServer plugin.\n"; + gzdbg << "Loaded GazeboServer plugin.\n"; return true; } diff --git a/plugins/gazebo_server/GazeboServer.hh b/plugins/gazebo_server/GazeboServer.hh index 2ba46fba..1a5f9195 100644 --- a/plugins/gazebo_server/GazeboServer.hh +++ b/plugins/gazebo_server/GazeboServer.hh @@ -14,23 +14,23 @@ * limitations under the License. * */ -#ifndef IGNITION_LAUNCH_GAZEBOSERVER_HH_ -#define IGNITION_LAUNCH_GAZEBOSERVER_HH_ +#ifndef GZ_LAUNCH_GAZEBOSERVER_HH_ +#define GZ_LAUNCH_GAZEBOSERVER_HH_ #include -#include -#include -#include "ignition/launch/Plugin.hh" +#include +#include +#include "gz/launch/Plugin.hh" -namespace ignition +namespace gz { namespace launch { - /// \brief Runs the Ignition Gazebo server. + /// \brief Runs the Gazebo server. /// /// # Example usage /// - /// /// /// diff_drive.sdf @@ -39,12 +39,12 @@ namespace ignition /// + /// name="gz::sim::systems::v0::Physics"> /// /// /// /// - class GazeboServer : public ignition::launch::Plugin + class GazeboServer : public gz::launch::Plugin { /// \brief Constructor. public: GazeboServer(); @@ -57,12 +57,12 @@ namespace ignition const tinyxml2::XMLElement *_elem) override final; /// \brief Private data pointer - private: std::unique_ptr server; + private: std::unique_ptr server; }; } } // Register the plugin -IGNITION_ADD_PLUGIN(ignition::launch::GazeboServer, ignition::launch::Plugin) +IGNITION_ADD_PLUGIN(gz::launch::GazeboServer, gz::launch::Plugin) #endif diff --git a/plugins/joy_to_twist/CMakeLists.txt b/plugins/joy_to_twist/CMakeLists.txt index 378c3450..2e56e81a 100644 --- a/plugins/joy_to_twist/CMakeLists.txt +++ b/plugins/joy_to_twist/CMakeLists.txt @@ -11,4 +11,4 @@ target_link_libraries(${plugin} ignition-transport${IGN_TRANSPORT_MAJOR_VER}::core ) -install (TARGETS ${plugin} DESTINATION ${IGN_LAUNCH_PLUGIN_INSTALL_PATH}) +install (TARGETS ${plugin} DESTINATION ${GZ_LAUNCH_PLUGIN_INSTALL_PATH}) diff --git a/plugins/joy_to_twist/JoyToTwist.cc b/plugins/joy_to_twist/JoyToTwist.cc index 551531ce..17aa68c8 100644 --- a/plugins/joy_to_twist/JoyToTwist.cc +++ b/plugins/joy_to_twist/JoyToTwist.cc @@ -23,23 +23,23 @@ #endif -#include -#include -#include -#include +#include +#include +#include +#include #include "JoyToTwist.hh" -using namespace ignition::launch; +using namespace gz::launch; ////////////////////////////////////////////////// // String to vector helper function. void setVectorFromString(const std::string &_str, - ignition::math::Vector3d &_v) + gz::math::Vector3d &_v) { - std::string str = ignition::common::trimmed(_str); + std::string str = gz::common::trimmed(_str); - std::vector parts = ignition::common::split(str, " "); + std::vector parts = gz::common::split(str, " "); if (parts.size() == 3) { _v.X(std::stod(parts[0])); @@ -50,7 +50,7 @@ void setVectorFromString(const std::string &_str, ///////////////////////////////////////////////// JoyToTwist::JoyToTwist() - : ignition::launch::Plugin() + : gz::launch::Plugin() { } @@ -106,10 +106,10 @@ bool JoyToTwist::Load(const tinyxml2::XMLElement *_elem) if (elem) setVectorFromString(elem->GetText(), this->scaleAngularTurbo); - this->cmdVelPub = this->node.Advertise( + this->cmdVelPub = this->node.Advertise( this->outputTopic); - igndbg << "Loaded JoyToTwist plugin with the following parameters:\n" + gzdbg << "Loaded JoyToTwist plugin with the following parameters:\n" << " input_topic: " << this->inputTopic << std::endl << " output_topic: " << this->outputTopic << std::endl; this->running = true; @@ -119,12 +119,12 @@ bool JoyToTwist::Load(const tinyxml2::XMLElement *_elem) } ////////////////////////////////////////////////// -void JoyToTwist::OnJoy(const ignition::msgs::Joy &_msg) +void JoyToTwist::OnJoy(const gz::msgs::Joy &_msg) { if (!this->running) return; - ignition::msgs::Twist cmdVelMsg; + gz::msgs::Twist cmdVelMsg; // Turbo mode if (this->enableTurboButton >= 0 && _msg.buttons(this->enableTurboButton)) { diff --git a/plugins/joy_to_twist/JoyToTwist.hh b/plugins/joy_to_twist/JoyToTwist.hh index 517e802e..4af2d6bb 100644 --- a/plugins/joy_to_twist/JoyToTwist.hh +++ b/plugins/joy_to_twist/JoyToTwist.hh @@ -14,34 +14,34 @@ * limitations under the License. * */ -#ifndef IGNITION_LAUNCH_JOYTOTWIST_HH_ -#define IGNITION_LAUNCH_JOYTOTWIST_HH_ +#ifndef GZ_LAUNCH_JOYTOTWIST_HH_ +#define GZ_LAUNCH_JOYTOTWIST_HH_ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -namespace ignition +namespace gz { namespace launch { - /// \brief Converts ignition::msgs::Joystick messages to - /// ignition::msgs::Twist. + /// \brief Converts gz::msgs::Joystick messages to + /// gz::msgs::Twist. /// /// # Example usage /// - /// - /// + /// /// + /// gz::msgs::Joystick messages --> /// /joy /// - /// + /// /// /model/vehicle_blue/cmd_vel /// /// /// 4 /// - class JoyToTwist : public ignition::launch::Plugin + class JoyToTwist : public gz::launch::Plugin { /// \brief Constructor public: JoyToTwist(); @@ -88,24 +88,24 @@ namespace ignition /// \brief Handle joystick messages. /// \param[in] _msg Joystick message. - private: void OnJoy(const ignition::msgs::Joy &_msg); + private: void OnJoy(const gz::msgs::Joy &_msg); private: int enableButton = 0; private: int enableTurboButton = -1; - private: ignition::math::Vector3d axisLinear{1.0, 0.0, 0.0}; - private: ignition::math::Vector3d scaleLinear{0.5, 0.0, 0.0}; - private: ignition::math::Vector3d scaleLinearTurbo{0.5, 0.0, 0.0}; + private: gz::math::Vector3d axisLinear{1.0, 0.0, 0.0}; + private: gz::math::Vector3d scaleLinear{0.5, 0.0, 0.0}; + private: gz::math::Vector3d scaleLinearTurbo{0.5, 0.0, 0.0}; - private: ignition::math::Vector3d axisAngular{0.0, 0.0, 0.0}; - private: ignition::math::Vector3d scaleAngular{0.0, 0.0, 0.5}; - private: ignition::math::Vector3d scaleAngularTurbo{0.0, 0.0, 0.5}; + private: gz::math::Vector3d axisAngular{0.0, 0.0, 0.0}; + private: gz::math::Vector3d scaleAngular{0.0, 0.0, 0.5}; + private: gz::math::Vector3d scaleAngularTurbo{0.0, 0.0, 0.5}; private: bool sentDisableMsg = false; private: bool running = false; private: std::thread *joyThread = nullptr; - private: ignition::transport::Node node; - private: ignition::transport::Node::Publisher cmdVelPub; + private: gz::transport::Node node; + private: gz::transport::Node::Publisher cmdVelPub; private: std::string inputTopic = "/joy"; private: std::string outputTopic = "/cmd_vel"; @@ -114,6 +114,6 @@ namespace ignition } // Register the plugin -IGNITION_ADD_PLUGIN(ignition::launch::JoyToTwist, ignition::launch::Plugin) +IGNITION_ADD_PLUGIN(gz::launch::JoyToTwist, gz::launch::Plugin) #endif diff --git a/plugins/joystick/CMakeLists.txt b/plugins/joystick/CMakeLists.txt index 5cc14ffd..9b5b0f0e 100644 --- a/plugins/joystick/CMakeLists.txt +++ b/plugins/joystick/CMakeLists.txt @@ -11,4 +11,4 @@ target_link_libraries(${plugin} ignition-plugin${IGN_PLUGIN_MAJOR_VER}::core ) -install (TARGETS ${plugin} DESTINATION ${IGN_LAUNCH_PLUGIN_INSTALL_PATH}) +install (TARGETS ${plugin} DESTINATION ${GZ_LAUNCH_PLUGIN_INSTALL_PATH}) diff --git a/plugins/joystick/Joystick.cc b/plugins/joystick/Joystick.cc index 4e1ddd03..3b8723f3 100644 --- a/plugins/joystick/Joystick.cc +++ b/plugins/joystick/Joystick.cc @@ -19,19 +19,19 @@ #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "Joystick.hh" -using namespace ignition::launch; +using namespace gz::launch; ///////////////////////////////////////////////// Joystick::Joystick() - : ignition::launch::Plugin() + : gz::launch::Plugin() { } @@ -72,11 +72,11 @@ bool Joystick::Load(const tinyxml2::XMLElement *_elem) { try { - deadzone = ignition::math::clamp(std::stof(elem->GetText()), 0.0f, 0.9f); + deadzone = gz::math::clamp(std::stof(elem->GetText()), 0.0f, 0.9f); } catch(...) { - ignerr << " is not a valid floating point number, " + gzerr << " is not a valid floating point number, " "using 0.05\n"; } } @@ -92,7 +92,7 @@ bool Joystick::Load(const tinyxml2::XMLElement *_elem) } catch(...) { - ignerr << " is not a valid floating point number, using 60Hz\n"; + gzerr << " is not a valid floating point number, using 60Hz\n"; } } @@ -113,7 +113,7 @@ bool Joystick::Load(const tinyxml2::XMLElement *_elem) } catch(...) { - ignerr << " is not a valid floating point number, " + gzerr << " is not a valid floating point number, " << "using 1000Hz\n"; } } @@ -127,7 +127,7 @@ bool Joystick::Load(const tinyxml2::XMLElement *_elem) // not a critical error, but doesn't make a whole lot of sense. if (this->interval < this->accumulationInterval) { - ignwarn << "The publication rate of [" << 1.0 / this->interval + gzwarn << "The publication rate of [" << 1.0 / this->interval << " Hz] is greater than the accumulation rate of [" << 1.0 / this->accumulationInterval << " Hz]. Timing behavior is ill defined.\n"; @@ -149,7 +149,7 @@ bool Joystick::Load(const tinyxml2::XMLElement *_elem) } else { - ignerr << "Unable to open joystick at [" << deviceFilename + gzerr << "Unable to open joystick at [" << deviceFilename << "] Attempting again\n"; } @@ -168,12 +168,12 @@ bool Joystick::Load(const tinyxml2::XMLElement *_elem) this->axisScale = -1.0f / (1.0f - deadzone) / 32767.0f; // Create the publisher of joy messages - this->pub = this->node.Advertise("/joy"); + this->pub = this->node.Advertise("/joy"); this->run = true; this->joyThread = new std::thread(std::bind(&Joystick::Run, this)); - igndbg << "Loaded Joystick plugin with the following parameters:\n" + gzdbg << "Loaded Joystick plugin with the following parameters:\n" << " device: " << deviceFilename << std::endl << " sticky_buttons: " << this->stickyButtons << std::endl << " dead_zone: " << deadzone << std::endl @@ -192,9 +192,9 @@ void Joystick::Run() bool accumulate = false; bool accumulating = false; - ignition::msgs::Joy joyMsg; - ignition::msgs::Joy lastJoyMsg; - ignition::msgs::Joy stickyButtonsJoyMsg; + gz::msgs::Joy joyMsg; + gz::msgs::Joy lastJoyMsg; + gz::msgs::Joy stickyButtonsJoyMsg; while (this->run) { @@ -222,7 +222,7 @@ void Joystick::Run() { if (read(this->joyFd, &event, sizeof(js_event)) == -1 && errno != EAGAIN) { - ignwarn << "Joystick read failed, might be closed\n"; + gzwarn << "Joystick read failed, might be closed\n"; return; } @@ -243,7 +243,7 @@ void Joystick::Run() // Update the button joyMsg.set_buttons(event.number, - !ignition::math::equal(value, 0.0f) ? 1 : 0); + !gz::math::equal(value, 0.0f) ? 1 : 0); // For initial events, wait a bit before sending to try to catch // all the initial events. @@ -277,7 +277,7 @@ void Joystick::Run() } default: { - ignwarn << "Unknown event type: time[" << event.time << "] " + gzwarn << "Unknown event type: time[" << event.time << "] " << "value[" << value << "] " << "type[" << event.type << "h] " << "number["<< event.number << "]" << std::endl; diff --git a/plugins/joystick/Joystick.hh b/plugins/joystick/Joystick.hh index c70bf3bc..4fdc69bc 100644 --- a/plugins/joystick/Joystick.hh +++ b/plugins/joystick/Joystick.hh @@ -14,25 +14,25 @@ * limitations under the License. * */ -#ifndef IGNITION_LAUNCH_JOYSTICK_HH_ -#define IGNITION_LAUNCH_JOYSTICK_HH_ +#ifndef GZ_LAUNCH_JOYSTICK_HH_ +#define GZ_LAUNCH_JOYSTICK_HH_ #include -#include -#include -#include +#include +#include +#include -namespace ignition +namespace gz { namespace launch { /// \brief Reads from a USB joystick device and outputs - /// ignition::msgs::Joystick messages. + /// gz::msgs::Joystick messages. /// /// # Example usage /// - /// - /// + /// /// /// @@ -49,7 +49,7 @@ namespace ignition /// 1000 /// - class Joystick : public ignition::launch::Plugin + class Joystick : public gz::launch::Plugin { /// \brief Constructor public: Joystick(); @@ -73,13 +73,13 @@ namespace ignition private: float accumulationInterval = 0.001f; private: std::thread *joyThread = nullptr; - private: ignition::transport::Node node; - private: ignition::transport::Node::Publisher pub; + private: gz::transport::Node node; + private: gz::transport::Node::Publisher pub; }; } } // Register the plugin -IGNITION_ADD_PLUGIN(ignition::launch::Joystick, ignition::launch::Plugin) +IGNITION_ADD_PLUGIN(gz::launch::Joystick, gz::launch::Plugin) #endif diff --git a/plugins/websocket_server/CMakeLists.txt b/plugins/websocket_server/CMakeLists.txt index 6e1513e2..5daa76be 100644 --- a/plugins/websocket_server/CMakeLists.txt +++ b/plugins/websocket_server/CMakeLists.txt @@ -25,5 +25,5 @@ if (websockets_FOUND) ignition-transport${IGN_TRANSPORT_MAJOR_VER}::core ) - install (TARGETS ${plugin} DESTINATION ${IGN_LAUNCH_PLUGIN_INSTALL_PATH}) + install (TARGETS ${plugin} DESTINATION ${GZ_LAUNCH_PLUGIN_INSTALL_PATH}) endif() diff --git a/plugins/websocket_server/MessageDefinitions.hh.in b/plugins/websocket_server/MessageDefinitions.hh.in index c6038d00..28f71120 100644 --- a/plugins/websocket_server/MessageDefinitions.hh.in +++ b/plugins/websocket_server/MessageDefinitions.hh.in @@ -14,10 +14,10 @@ * limitations under the License. * */ -#ifndef IGNITION_LAUNCH_WEBSOCKETSERVER_MESSAGEDEFINITIONS_HH_ -#define IGNITION_LAUNCH_WEBSOCKETSERVER_MESSAGEDEFINITIONS_HH_ +#ifndef GZ_LAUNCH_WEBSOCKETSERVER_MESSAGEDEFINITIONS_HH_ +#define GZ_LAUNCH_WEBSOCKETSERVER_MESSAGEDEFINITIONS_HH_ -namespace ignition +namespace gz { namespace launch { @@ -25,7 +25,7 @@ namespace ignition /// server. /// /// \todo Get this information from a running simulation. The problem - /// right now is that Ignition Transport does not show subscribers. + /// right now is that Gazebo Transport does not show subscribers. static const std::string kWebSocketServerMessageDefinitions = R"protos(@WEBSOCKETSERVER_MESSAGE_DEFINITIONS@)protos"; } diff --git a/plugins/websocket_server/README.md b/plugins/websocket_server/README.md index 3f1f8c0d..3cb456a7 100644 --- a/plugins/websocket_server/README.md +++ b/plugins/websocket_server/README.md @@ -1,6 +1,6 @@ # Get Started -1. [Install ignition-acropolis](https://ignitionrobotics.org/docs/acropolis/install). +1. [Install ignition-acropolis](https://gazebosim.org/docs/acropolis/install). 2. Compile and install ign-launch from source. You will have to `sudo make install` so that `ign-tools` find the launch.yaml files. diff --git a/plugins/websocket_server/WebsocketServer.cc b/plugins/websocket_server/WebsocketServer.cc index 4d495349..cdecdb40 100644 --- a/plugins/websocket_server/WebsocketServer.cc +++ b/plugins/websocket_server/WebsocketServer.cc @@ -16,16 +16,16 @@ */ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "MessageDefinitions.hh" #include "WebsocketServer.hh" -using namespace ignition::launch; +using namespace gz::launch; /// \brief Construct a websocket frame header. /// \param[in] _op The operation string. @@ -143,13 +143,13 @@ int httpCallback(struct lws *_wsi, case LWS_CALLBACK_HTTP: { char *URI = (char *) _in; - igndbg << "Requested URI: " << URI << "\n"; + gzdbg << "Requested URI: " << URI << "\n"; // Router // Server metrics if (strcmp(URI, "/metrics") == 0) { - igndbg << "Handling /metrics\n"; + gzdbg << "Handling /metrics\n"; // TODO Support a proper way to output metrics @@ -170,7 +170,7 @@ int httpCallback(struct lws *_wsi, // Check that no characters were discarded if (n - int(buflen) > 0) { - ignwarn << "Discarded " + gzwarn << "Discarded " << n - int(buflen) << "characters when preparing metrics.\n"; } @@ -188,7 +188,7 @@ int httpCallback(struct lws *_wsi, // Return a 404 if no route was matched else { - igndbg << "Resource not found.\n"; + gzdbg << "Resource not found.\n"; lws_return_http_status(_wsi, HTTP_STATUS_NOT_FOUND, "Not Found"); } break; @@ -232,7 +232,7 @@ int rootCallback(struct lws *_wsi, { // Open connections. case LWS_CALLBACK_ESTABLISHED: - igndbg << "LWS_CALLBACK_ESTABLISHED\n"; + gzdbg << "LWS_CALLBACK_ESTABLISHED\n"; self->OnConnect(fd); // This will generate a LWS_CALLBACK_SERVER_WRITEABLE event when the // connection is writable. @@ -241,12 +241,12 @@ int rootCallback(struct lws *_wsi, // Close connections. case LWS_CALLBACK_CLOSED: - igndbg << "LWS_CALLBACK_CLOSED\n"; + gzdbg << "LWS_CALLBACK_CLOSED\n"; self->OnDisconnect(fd); break; case LWS_CALLBACK_HTTP: - igndbg << "LWS_CALLBACK_HTTP\n"; + gzdbg << "LWS_CALLBACK_HTTP\n"; return httpCallback(_wsi, _reason, _user, _in, _len); break; @@ -266,7 +266,7 @@ int rootCallback(struct lws *_wsi, if (charsSent < msgSize) { - ignerr << "Error writing to socket\n"; + gzerr << "Error writing to socket\n"; } else { @@ -286,13 +286,13 @@ int rootCallback(struct lws *_wsi, // Handle incoming messages case LWS_CALLBACK_RECEIVE: - igndbg << "LWS_CALLBACK_RECEIVE\n"; + gzdbg << "LWS_CALLBACK_RECEIVE\n"; // Prevent too many connections. if (self->maxConnections >= 0 && self->connections.size()+1 > self->maxConnections) { - ignerr << "Skipping new connection, limit of " + gzerr << "Skipping new connection, limit of " << self->maxConnections << " has been reached\n"; // This will return an error code of 1008 with a reason of @@ -317,7 +317,7 @@ int rootCallback(struct lws *_wsi, ///////////////////////////////////////////////// WebsocketServer::WebsocketServer() - : ignition::launch::Plugin() + : gz::launch::Plugin() { } @@ -358,7 +358,7 @@ bool WebsocketServer::Load(const tinyxml2::XMLElement *_elem) } catch (...) { - ignerr << "Unable to convert " << elem->GetText() + gzerr << "Unable to convert " << elem->GetText() << " to a double. Default hz of " << hz << " will be used.\n"; } @@ -394,11 +394,11 @@ bool WebsocketServer::Load(const tinyxml2::XMLElement *_elem) } catch (...) { - ignerr << "Failed to convert port[" << elem->GetText() << "] to integer." + gzerr << "Failed to convert port[" << elem->GetText() << "] to integer." << std::endl; } } - igndbg << "Using port[" << port << "]\n"; + gzdbg << "Using port[" << port << "]\n"; // Get the maximum connection count, if present. elem = _elem->FirstChildElement("max_connections"); @@ -410,10 +410,10 @@ bool WebsocketServer::Load(const tinyxml2::XMLElement *_elem) } catch (...) { - ignerr << "Failed to convert max_connections[" << elem->GetText() + gzerr << "Failed to convert max_connections[" << elem->GetText() << "] to integer." << std::endl; } - igndbg << "Using maximum connection count of " + gzdbg << "Using maximum connection count of " << this->maxConnections << std::endl; } @@ -429,10 +429,10 @@ bool WebsocketServer::Load(const tinyxml2::XMLElement *_elem) } else { - ignerr << "Failed to parse queue_size_per_connection[" + gzerr << "Failed to parse queue_size_per_connection[" << elem->GetText() << "]." << std::endl; } - igndbg << "Using connection msg queue size of " + gzdbg << "Using connection msg queue size of " << this->queueSizePerConnection << std::endl; } @@ -453,12 +453,12 @@ bool WebsocketServer::Load(const tinyxml2::XMLElement *_elem) if (result == tinyxml2::XML_SUCCESS && limit >= 0) { this->msgTypeSubscriptionLimit[msgType] = limit; - igndbg << "Setting msg type subscription limit[" << msgType + gzdbg << "Setting msg type subscription limit[" << msgType << ", " << limit << "]" << std::endl; } else { - ignerr << "Failed to parse subscription limit[" + gzerr << "Failed to parse subscription limit[" << msgType << ", " << limitElem->GetText() << "]." << std::endl; } } @@ -520,17 +520,17 @@ bool WebsocketServer::Load(const tinyxml2::XMLElement *_elem) if (!sslCertFile.empty() && !sslPrivateKeyFile.empty()) { // Fail if the certificate file cannot be opened. - if (!ignition::common::exists(sslCertFile)) + if (!gz::common::exists(sslCertFile)) { - ignerr << "SSL certificate file[" << sslCertFile + gzerr << "SSL certificate file[" << sslCertFile << "] does not exist. Quitting.\n"; return false; } // Fail if the private key file cannot be opened. - if (!ignition::common::exists(sslPrivateKeyFile)) + if (!gz::common::exists(sslPrivateKeyFile)) { - ignerr << "SSL private key file[" << sslPrivateKeyFile + gzerr << "SSL private key file[" << sslPrivateKeyFile << "] does not exist. Quitting.\n"; return false; } @@ -543,7 +543,7 @@ bool WebsocketServer::Load(const tinyxml2::XMLElement *_elem) } else if (sslCertFile.empty() || sslPrivateKeyFile.empty()) { - ignwarn << "Partial SSL configuration specified. Please specify: " + gzwarn << "Partial SSL configuration specified. Please specify: " << "\t\n" << "\t PATH_TO_CERT_FILE\n" << "\t PATH_TO_KEY_FILE\n" @@ -560,7 +560,7 @@ bool WebsocketServer::Load(const tinyxml2::XMLElement *_elem) this->context = lws_create_context(&info); if( !this->context ) - ignerr << "Unable to create websocket server\n"; + gzerr << "Unable to create websocket server\n"; this->run = true; this->thread = new std::thread(std::bind(&WebsocketServer::Run, this)); @@ -594,13 +594,13 @@ void WebsocketServer::QueueMessage(Connection *_connection, static bool warned{false}; if (!warned) { - ignwarn << "Queue size reached for connection" << std::endl; + gzwarn << "Queue size reached for connection" << std::endl; } } } else { - ignerr << "Null pointer to a conection. This should not happen.\n"; + gzerr << "Null pointer to a conection. This should not happen.\n"; } } @@ -651,7 +651,7 @@ void WebsocketServer::OnDisconnect(int _socketId) { iter->second.erase(_socketId); - // Unsubscribe from the Ignition Transport topic if there are no more + // Unsubscribe from the Gazebo Transport topic if there are no more // websocket connections. if (iter->second.empty()) this->node.Unsubscribe(iter->first); @@ -673,7 +673,7 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) // Count the number of commas to handle a frame like "sub,,," std::count(_msg.begin(), _msg.end(), ',') != 3) { - ignerr << "Received an invalid frame with " << frameParts.size() + gzerr << "Received an invalid frame with " << frameParts.size() << "components when 4 is expected.\n"; return; } @@ -694,7 +694,7 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) key == this->adminAuthorizationKey; } - igndbg << "Authorization request received on socket[" << _socketId << "]. " + gzdbg << "Authorization request received on socket[" << _socketId << "]. " << "Authorized[" << this->connections[_socketId]->authorized << "]\n"; std::string result = @@ -706,25 +706,25 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) if (!this->connections[_socketId]->authorized) { - igndbg << "Unauthorized request received on socket[" << _socketId << "]\n"; + gzdbg << "Unauthorized request received on socket[" << _socketId << "]\n"; return; } // Handle the case where the client requests the message definitions. if (frameParts[0] == "protos") { - igndbg << "Protos request received\n"; + gzdbg << "Protos request received\n"; std::string allProtos = "syntax = \"proto3\";\n"; - allProtos += "package ignition.msgs;\n"; + allProtos += "package gz.msgs;\n"; std::vector types; - ignition::msgs::Factory::Types(types); + gz::msgs::Factory::Types(types); // Get all the messages, and build a single proto to send to the client. for (auto const &type : types) { - auto msg = ignition::msgs::Factory::New(type); + auto msg = gz::msgs::Factory::New(type); if (msg) { auto descriptor = msg->GetDescriptor(); @@ -732,13 +732,13 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) allProtos += descriptor->DebugString(); else { - ignerr << "Failed to get the descriptor for message[" + gzerr << "Failed to get the descriptor for message[" << type << "]\n"; } } else { - ignerr << "Failed to build message[" << type << "].\n"; + gzerr << "Failed to build message[" << type << "].\n"; } } @@ -747,8 +747,8 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) } else if (frameParts[0] == "topics") { - igndbg << "Topic list request recieved\n"; - ignition::msgs::StringMsg_V msg; + gzdbg << "Topic list request recieved\n"; + gz::msgs::StringMsg_V msg; std::vector topics; @@ -760,7 +760,7 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) msg.add_data(topic); std::string data = BUILD_MSG(this->operations[PUBLISH], frameParts[0], - std::string("ignition.msgs.StringMsg_V"), msg.SerializeAsString()); + std::string("gz.msgs.StringMsg_V"), msg.SerializeAsString()); // Queue the message for delivery. this->QueueMessage(this->connections[_socketId].get(), @@ -768,8 +768,8 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) } else if (frameParts[0] == "topics-types") { - igndbg << "Topic and message type list request recieved\n"; - ignition::msgs::Publishers msg; + gzdbg << "Topic and message type list request recieved\n"; + gz::msgs::Publishers msg; std::vector topics; @@ -790,7 +790,7 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) } std::string data = BUILD_MSG(this->operations[PUBLISH], frameParts[0], - std::string("ignition.msgs.Publishers"), msg.SerializeAsString()); + std::string("gz.msgs.Publishers"), msg.SerializeAsString()); // Queue the message for delivery. this->QueueMessage(this->connections[_socketId].get(), @@ -798,11 +798,11 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) } else if (frameParts[0] == "worlds") { - igndbg << "World info request recieved\n"; - ignition::msgs::Empty req; + gzdbg << "World info request recieved\n"; + gz::msgs::Empty req; req.set_unused(true); - ignition::msgs::StringMsg_V rep; + gz::msgs::StringMsg_V rep; bool result; unsigned int timeout = 2000; @@ -810,7 +810,7 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) req, timeout, rep, result); std::string data = BUILD_MSG(this->operations[PUBLISH], frameParts[0], - std::string("ignition.msgs.StringMsg_V"), rep.SerializeAsString()); + std::string("gz.msgs.StringMsg_V"), rep.SerializeAsString()); // Queue the message for delivery. this->QueueMessage(this->connections[_socketId].get(), @@ -818,12 +818,12 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) } else if (frameParts[0] == "scene") { - igndbg << "Scene info request recieved for world[" + gzdbg << "Scene info request recieved for world[" << frameParts[1] << "]\n"; - ignition::msgs::Empty req; + gz::msgs::Empty req; req.set_unused(true); - ignition::msgs::Scene rep; + gz::msgs::Scene rep; bool result; unsigned int timeout = 2000; @@ -833,27 +833,27 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) bool executed = this->node.Request(serviceName, req, timeout, rep, result); if (!executed || !result) { - ignerr << "Failed to get the scene information for " << frameParts[1] + gzerr << "Failed to get the scene information for " << frameParts[1] << " world.\n"; } std::string data = BUILD_MSG(this->operations[PUBLISH], frameParts[0], - std::string("ignition.msgs.Scene"), rep.SerializeAsString()); + std::string("gz.msgs.Scene"), rep.SerializeAsString()); // Queue the message for delivery. this->QueueMessage(this->connections[_socketId].get(), data.c_str(), data.length()); } - /// \todo(nkoeng) Deprecate this in Ignition Fortress, and instruct users + /// \todo(nkoeng) Deprecate this in Gazebo Fortress, and instruct users /// to rely on the "scene" message. else if (frameParts[0] == "particle_emitters") { - igndbg << "Particle emitter request received for world[" + gzdbg << "Particle emitter request received for world[" << frameParts[1] << "]\n"; - ignition::msgs::Empty req; + gz::msgs::Empty req; req.set_unused(true); - ignition::msgs::ParticleEmitter_V rep; + gz::msgs::ParticleEmitter_V rep; bool result; unsigned int timeout = 2000; @@ -863,12 +863,12 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) bool executed = this->node.Request(serviceName, req, timeout, rep, result); if (!executed || !result) { - ignerr << "Failed to get the particle emitter information for " + gzerr << "Failed to get the particle emitter information for " << frameParts[1] << " world.\n"; } std::string data = BUILD_MSG(this->operations[PUBLISH], frameParts[0], - std::string("ignition.msgs.ParticleEmitter_V"), + std::string("gz.msgs.ParticleEmitter_V"), rep.SerializeAsString()); // Queue the message for delivery. @@ -888,7 +888,7 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) this->topicTimestamps[topic] = std::chrono::steady_clock::now() - this->publishPeriod; - igndbg << "Subscribe request to topic[" << frameParts[1] << "]\n"; + gzdbg << "Subscribe request to topic[" << frameParts[1] << "]\n"; this->node.SubscribeRaw(topic, std::bind(&WebsocketServer::OnWebsocketSubscribedMessage, this, std::placeholders::_1, @@ -916,7 +916,7 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) this->node.TopicInfo(queryTopic, publishers); for (auto pub: publishers) { - if (pub.MsgTypeName() == "ignition.msgs.Image") + if (pub.MsgTypeName() == "gz.msgs.Image") { imageTopics.insert(queryTopic); break; @@ -926,12 +926,12 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) if (!imageTopics.count(topic)) { - igndbg << "Could not find topic: " << topic << " to stream" + gzdbg << "Could not find topic: " << topic << " to stream" << std::endl; return; } - igndbg << "Subscribe request to image topic[" << frameParts[1] << "]\n"; + gzdbg << "Subscribe request to image topic[" << frameParts[1] << "]\n"; this->node.Subscribe(frameParts[1], &WebsocketServer::OnWebsocketSubscribedImageMessage, this); } @@ -939,7 +939,7 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) { std::string topic = frameParts[1]; - igndbg << "Unsubscribe request for topic[" << topic << "]\n"; + gzdbg << "Unsubscribe request for topic[" << topic << "]\n"; std::map>::iterator topicConnectionIter = this->topicConnections.find(topic); @@ -956,25 +956,25 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) // check and update subscription count this->UpdateMsgTypeSubscriptionCount(topic, _socketId, false); - // Only unsubscribe from the Ignition Transport topic if there are no + // Only unsubscribe from the Gazebo Transport topic if there are no // more websocket connections. if (topicConnectionIter->second.empty()) { - igndbg << "Unsubscribing from Ignition Transport Topic[" + gzdbg << "Unsubscribing from Gazebo Transport Topic[" << frameParts[1] << "]\n"; this->node.Unsubscribe(frameParts[1]); } } else { - ignwarn << "The websocket server is not subscribed to topic[" + gzwarn << "The websocket server is not subscribed to topic[" << topic << "]. Unable to unsubscribe from the topic\n"; } } else if (frameParts[0] == "throttle") { std::string topic = frameParts[1]; - igndbg << "Throttle request for topic[" << topic << "]\n"; + gzdbg << "Throttle request for topic[" << topic << "]\n"; if (!topic.empty()) { try @@ -987,7 +987,7 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) } catch (...) { - ignwarn << "Unable to set topic rate for topic[" << topic + gzwarn << "Unable to set topic rate for topic[" << topic << "]" << std::endl; } } @@ -997,7 +997,7 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg) ////////////////////////////////////////////////// void WebsocketServer::OnWebsocketSubscribedMessage( const char *_data, const size_t _size, - const ignition::transport::MessageInfo &_info) + const gz::transport::MessageInfo &_info) { std::map>::const_iterator iter = this->topicConnections.find(_info.Topic()); @@ -1051,8 +1051,8 @@ void WebsocketServer::OnWebsocketSubscribedMessage( ////////////////////////////////////////////////// void WebsocketServer::OnWebsocketSubscribedImageMessage( - const ignition::msgs::Image &_msg, - const ignition::transport::MessageInfo &_info) + const gz::msgs::Image &_msg, + const gz::transport::MessageInfo &_info) { std::map>::const_iterator iter = this->topicConnections.find(_info.Topic()); @@ -1184,7 +1184,7 @@ bool WebsocketServer::UpdateMsgTypeSubscriptionCount(const std::string &_topic, } if (limitReached) { - ignwarn << "Msg type subscription limit reached[" << msgType + gzwarn << "Msg type subscription limit reached[" << msgType << ", " << limitIt->second << "] for connection[" << _socketId << "]" << std::endl; return false; @@ -1192,7 +1192,7 @@ bool WebsocketServer::UpdateMsgTypeSubscriptionCount(const std::string &_topic, } else { - ignwarn << "Unable to find connection[" << _socketId << "]" + gzwarn << "Unable to find connection[" << _socketId << "]" << " when setting subscription limit." << std::endl; return false; } diff --git a/plugins/websocket_server/WebsocketServer.hh b/plugins/websocket_server/WebsocketServer.hh index bf9820c9..f820e5cb 100644 --- a/plugins/websocket_server/WebsocketServer.hh +++ b/plugins/websocket_server/WebsocketServer.hh @@ -14,26 +14,26 @@ * limitations under the License. * */ -#ifndef IGNITION_LAUNCH_WEBSOCKETSERVER_HH_ -#define IGNITION_LAUNCH_WEBSOCKETSERVER_HH_ +#ifndef GZ_LAUNCH_WEBSOCKETSERVER_HH_ +#define GZ_LAUNCH_WEBSOCKETSERVER_HH_ #include #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include -namespace ignition +namespace gz { namespace launch { /// \brief Reads from a USB joystick device and outputs - /// ignition::msgs::WebsocketServer messages. + /// gz::msgs::WebsocketServer messages. /// /// # Plugin parameters /// @@ -90,7 +90,7 @@ namespace ignition /// /// The `operation` component is mandatory and must be one of: /// 1. "sub": Subscribe to the topic in the `topic_name` component, - /// 2. "pub": Publish a message from the Ignition Transport topic in + /// 2. "pub": Publish a message from the Gazebo Transport topic in /// the `topic_name` component, /// 3. "topics": Get the list of available topics, /// 4. "topics-types": Get the list of available topics and their @@ -106,11 +106,11 @@ namespace ignition /// Transport topic. /// /// The `message_type` component is mandatory for the "pub" operation. If - /// present it names the Ignition Message type, such as - /// "ignition.msgs.Clock". + /// present it names the Gazebo Message type, such as + /// "gz.msgs.Clock". /// /// The `payload` component is mandatory for the "pub" operation. If - /// present, it contains a serialized string of an Ignition Message. + /// present, it contains a serialized string of a Gazebo Message. /// /// ## Example frames /// @@ -121,7 +121,7 @@ namespace ignition /// 3. Subscribe to the "/clock" topic: `sub,/clock,,` /// /// 4. Websocket server publishing data on the "/clock" topic: - /// `pub,/clock,ignition.msgs.Clock,` + /// `pub,/clock,gz.msgs.Clock,` /// /// # Example usage /// @@ -130,8 +130,8 @@ namespace ignition /// 1. Define a launch file by copying the following contents to a file /// called `websocket.ign`. /// - /// - /// + /// /// /// @@ -142,9 +142,9 @@ namespace ignition /// /// `ign launch -v 4 websocket.ign` /// - /// 3. Open the [index.html](https://github.com/ignitionrobotics/ign-launch/blob/main/plugins/websocket_server/index.html) webpage. + /// 3. Open the [index.html](https://github.com/gazebosim/gz-launch/blob/main/plugins/websocket_server/index.html) webpage. /// - class WebsocketServer : public ignition::launch::Plugin + class WebsocketServer : public gz::launch::Plugin { /// \brief Constructor public: WebsocketServer(); @@ -160,14 +160,14 @@ namespace ignition private: void OnWebsocketSubscribedMessage(const char *_data, const size_t _size, - const ignition::transport::MessageInfo &_info); + const gz::transport::MessageInfo &_info); /// \brief Callback when an image is received on a topic /// \param[in] _msg Image msg /// \param[in] _info ign transport message info private: void OnWebsocketSubscribedImageMessage( - const ignition::msgs::Image &_msg, - const ignition::transport::MessageInfo &_info); + const gz::msgs::Image &_msg, + const gz::transport::MessageInfo &_info); /// \brief Callback that is triggered when a new connection is /// established. @@ -195,7 +195,7 @@ namespace ignition public: bool UpdateMsgTypeSubscriptionCount(const std::string &_topic, int _socketId, bool _subscribe); - private: ignition::transport::Node node; + private: gz::transport::Node node; private: bool run = true; private: std::thread *thread = nullptr; @@ -222,7 +222,7 @@ namespace ignition std::chrono::time_point> topicTimestamps; /// \brief The number of subscriptions of a msg type this connection - /// has. The key is the msg type, e.g. ignition.msgs.Image, and the + /// has. The key is the msg type, e.g. gz.msgs.Image, and the /// value is the subscription count public: std::map msgTypeSubscriptionCount; }; @@ -246,7 +246,7 @@ namespace ignition /// \brief The limit placed on the number of subscriptions per msg type /// for each connection. The key is the msg type, e.g. - /// ignition.msgs.Image, and the value is the subscription limit + /// gz.msgs.Image, and the value is the subscription limit public: std::map msgTypeSubscriptionLimit; /// \brief Run loop mutex. @@ -317,6 +317,6 @@ namespace ignition } // Register the plugin -IGNITION_ADD_PLUGIN(ignition::launch::WebsocketServer, ignition::launch::Plugin) +IGNITION_ADD_PLUGIN(gz::launch::WebsocketServer, gz::launch::Plugin) #endif diff --git a/plugins/websocket_server/combined.proto b/plugins/websocket_server/combined.proto index a0d72f2d..d7249957 100644 --- a/plugins/websocket_server/combined.proto +++ b/plugins/websocket_server/combined.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package ignition.msgs; +package gz.msgs; message Time { int64 sec = 1; diff --git a/plugins/websocket_server/ign.js b/plugins/websocket_server/ign.js index 9cb622d6..c5a6c422 100644 --- a/plugins/websocket_server/ign.js +++ b/plugins/websocket_server/ign.js @@ -26,7 +26,7 @@ function buildMsg(_frameParts) { } /// \brief The main interface to the Ignition websocket server and -/// data on Ignition Transport. +/// data on Gazebo Transport. function Ignition(options) { options = options || {}; @@ -46,7 +46,7 @@ function Ignition(options) { Ignition.prototype.__proto__ = EventEmitter2.prototype; /// \brief Connect to the specified WebSocket. -/// \param url - WebSocket URL for Ignition HTTPServer +/// \param url - WebSocket URL for Gazebo HTTPServer Ignition.prototype.connect = function(url, key) { var that = this; @@ -95,7 +95,7 @@ Ignition.prototype.connect = function(url, key) { // Request the list of worlds on start. // \todo Switch this to a service call when this issue is // resolved: - // https://github.com/ignitionrobotics/ign-transport/issues/135 + // https://github.com/gazebosim/gz-transport/issues/135 that.socket.send(buildMsg(['worlds','','',''])); } }; @@ -165,7 +165,7 @@ Ignition.prototype.sendMsg = function(_msg) { } }; -/// \brief Interface to Ignition Transport topics. +/// \brief Interface to Gazebo Transport topics. function Topic(options) { options = options || {}; this.ign = options.ign; diff --git a/plugins/websocket_server/index-old.html b/plugins/websocket_server/index-old.html index cf238618..b1ee5ed3 100644 --- a/plugins/websocket_server/index-old.html +++ b/plugins/websocket_server/index-old.html @@ -9,7 +9,7 @@ var wsUri = "ws://localhost:9002"; var output; var proto = "syntax = \"proto3\";\ - package ignition.msgs;\ + package gz.msgs;\ message Time {\ int64 sec = 1;\ int32 nsec = 2;\ diff --git a/plugins/websocket_server/index.html b/plugins/websocket_server/index.html index 52e5fcf8..b138aa77 100644 --- a/plugins/websocket_server/index.html +++ b/plugins/websocket_server/index.html @@ -28,7 +28,7 @@ ign.on('worlds', function(_worlds) { // \todo Switch this to a service call when this issue is // resolved: - // https://github.com/ignitionrobotics/ign-transport/issues/135 + // https://github.com/gazebosim/gz-transport/issues/135 ign.once('scene', function(_sceneInfo) { // console.log(_sceneInfo); for (var i = 0; i < _sceneInfo.model.length; ++i) { @@ -43,7 +43,7 @@ var clockSub = new Topic({ ign: ign, name: '/clock', - messageType : 'ignition.msgs.Clock', + messageType : 'gz.msgs.Clock', callback: function(msg) { var output = document.getElementById('output'); output.innerHTML = 'Clock: ' + msg.sim.sec + '.' + msg.sim.nsec; @@ -54,7 +54,7 @@ var poseSub = new Topic({ ign: ign, name: '/world/shapes/dynamic_pose/info', - messageType : 'ignition.msgs.Pose_V', + messageType : 'gz.msgs.Pose_V', callback: function(msg) { for (var i = 0; i < msg.pose.length; ++i) { var entity = scene.getByName(msg.pose[i].name); diff --git a/src/Manager.cc b/src/Manager.cc index 4e17272f..9942f39d 100644 --- a/src/Manager.cc +++ b/src/Manager.cc @@ -50,18 +50,18 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#include "ignition/launch/config.hh" -#include "ignition/launch/Plugin.hh" +#include "gz/launch/config.hh" +#include "gz/launch/Plugin.hh" #include "vendor/backward.hpp" -using namespace ignition::launch; +using namespace gz::launch; using namespace std::chrono_literals; #ifdef _WIN32 @@ -156,7 +156,7 @@ class Executable }; /// \brief Private data variables for the Ignition class. -class ignition::launch::ManagerPrivate +class gz::launch::ManagerPrivate { /// \brief Constructor. public: ManagerPrivate(); @@ -304,12 +304,12 @@ Manager::Manager() this->dataPtr->myself = this->dataPtr.get(); std::string homePath; - ignition::common::env(IGN_HOMEDIR, homePath); + gz::common::env(IGN_HOMEDIR, homePath); // Make sure to initialize logging. - ignLogInit(ignition::common::joinPaths(homePath, ".ignition"), "launch.log"); + gzLogInit(gz::common::joinPaths(homePath, ".ignition"), "launch.log"); if (!this->dataPtr->sigHandler->Initialized()) - ignerr << "signal(2) failed while setting up for SIGINT" << std::endl; + gzerr << "signal(2) failed while setting up for SIGINT" << std::endl; } ///////////////////////////////////////////////// @@ -396,7 +396,7 @@ ManagerPrivate::ManagerPrivate() 0644, 1); if (this->stoppedChildSem == SEM_FAILED) { - ignerr << "Error initializing semaphore " << this->stoppedChildSemName + gzerr << "Error initializing semaphore " << this->stoppedChildSemName << ": " << strerror(errno) << std::endl; } #else @@ -404,7 +404,7 @@ ManagerPrivate::ManagerPrivate() NULL, 0, LONG_MAX, this->stoppedChildSemName.c_str()); if (this->stoppedChildSem == nullptr) { - ignerr << "Error initializing semaphore " << this->stoppedChildSemName + gzerr << "Error initializing semaphore " << this->stoppedChildSemName << ": " << GetLastErrorAsString() << std::endl; } #endif @@ -412,7 +412,7 @@ ManagerPrivate::ManagerPrivate() #ifndef _WIN32 // Register a signal handler to capture child process death events. if (signal(SIGCHLD, ManagerPrivate::OnSigChild) == SIG_ERR) - ignerr << "signal(2) failed while setting up for SIGCHLD" << std::endl; + gzerr << "signal(2) failed while setting up for SIGCHLD" << std::endl; // Register backward signal handler for other signals std::vector signals = @@ -444,20 +444,20 @@ ManagerPrivate::~ManagerPrivate() #ifndef _WIN32 if (sem_close(this->stoppedChildSem) == -1) { - ignerr << "Failed to close semaphore " << this->stoppedChildSemName + gzerr << "Failed to close semaphore " << this->stoppedChildSemName << ": " << strerror(errno) << std::endl; } if (sem_unlink(this->stoppedChildSemName.c_str()) == -1) { - ignerr << "Failed to unlink semaphore " << this->stoppedChildSemName + gzerr << "Failed to unlink semaphore " << this->stoppedChildSemName << ": " << strerror(errno) << std::endl; } #else int retVal = CloseHandle(this->stoppedChildSem) ? 0 : -1; if (retVal == -1) { - ignerr << "Failed to close semaphore: " << strerror(errno) + gzerr << "Failed to close semaphore: " << strerror(errno) << std::endl; } #endif @@ -484,7 +484,7 @@ bool ManagerPrivate::Stop() int retVal = ReleaseSemaphore(this->stoppedChildSem, 1, nullptr); if (retVal != 0) { - ignerr << "Error Releasing Semaphore " + gzerr << "Error Releasing Semaphore " << GetLastErrorAsString() << std::endl; } #endif @@ -497,7 +497,7 @@ bool ManagerPrivate::Stop() ///////////////////////////////////////////////// void ManagerPrivate::OnSigIntTerm(int _sig) { - igndbg << "OnSigIntTerm Received signal[" << _sig << "]\n"; + gzdbg << "OnSigIntTerm Received signal[" << _sig << "]\n"; this->Stop(); } @@ -536,7 +536,7 @@ void ManagerPrivate::RestartLoop() if ((sigemptyset(&chldmask) == -1) || (sigaddset(&chldmask, SIGCHLD) == -1)) { - ignerr << "Failed to initialize signal mask: " + gzerr << "Failed to initialize signal mask: " << strerror(errno) << std::endl; return; } @@ -548,7 +548,7 @@ void ManagerPrivate::RestartLoop() if (s == -1) { if (errno != EINTR) - ignwarn << "sem_wait error: " + gzwarn << "sem_wait error: " << strerror(errno) << std::endl; continue; } @@ -556,7 +556,7 @@ void ManagerPrivate::RestartLoop() // Block SIGCHLD while consuming queue. if (sigprocmask(SIG_BLOCK, &chldmask, NULL) == -1) { - ignerr << "Failed to setup block for SIGCHLD: " + gzerr << "Failed to setup block for SIGCHLD: " << strerror(errno) << std::endl; continue; } @@ -578,7 +578,7 @@ void ManagerPrivate::RestartLoop() { if (iter->pid == p) { - igndbg << "Death of process[" << p << "] with name[" + gzdbg << "Death of process[" << p << "] with name[" << iter->name << "].\n"; // Restart if autoRestart is enabled @@ -592,7 +592,7 @@ void ManagerPrivate::RestartLoop() if (!restartExec.name.empty() && !restartExec.command.empty()) { - igndbg << "Restarting process with name[" << restartExec.name << "]\n"; + gzdbg << "Restarting process with name[" << restartExec.name << "]\n"; this->RunExecutable(restartExec); } @@ -602,7 +602,7 @@ void ManagerPrivate::RestartLoop() // Unblock SIGCHLD if (sigprocmask(SIG_UNBLOCK, &chldmask, NULL) == -1) { - ignerr << "Failed to unblock SIGCHLD: " << strerror(errno) << std::endl; + gzerr << "Failed to unblock SIGCHLD: " << strerror(errno) << std::endl; continue; } } @@ -639,7 +639,7 @@ void ManagerPrivate::RestartLoop() { if (iter->pi == p) { - igndbg << "Death of process[" << p << "] with name [" + gzdbg << "Death of process[" << p << "] with name [" << iter->name << "].\n"; // Restart if autoRestart is enabled @@ -653,7 +653,7 @@ void ManagerPrivate::RestartLoop() if (!restartExec.name.empty() && !restartExec.command.empty()) { - igndbg << "Restarting process with name[" << restartExec.name << "]\n"; + gzdbg << "Restarting process with name[" << restartExec.name << "]\n"; this->RunExecutable(restartExec); } @@ -671,7 +671,7 @@ bool ManagerPrivate::ParseConfig(const std::string &_config) // Load the XML configuration file into TinyXML if (xmlDoc.Parse(_config.c_str()) != tinyxml2::XML_SUCCESS) { - ignerr << "Unable to parse configuration. Your XML might be invalid.\n"; + gzerr << "Unable to parse configuration. Your XML might be invalid.\n"; return false; } @@ -679,7 +679,7 @@ bool ManagerPrivate::ParseConfig(const std::string &_config) tinyxml2::XMLElement *root = xmlDoc.FirstChildElement("ignition"); if (!root) { - ignerr << "Invalid config file,m issing element\n"; + gzerr << "Invalid config file,m issing element\n"; return false; } // Keep the environment variables in memory. See manpage for putenv. @@ -723,7 +723,7 @@ bool ManagerPrivate::RunExecutable(const std::string &_name, // Check for empty if (_cmd.empty()) { - ignerr << "Empty command.\n"; + gzerr << "Empty command.\n"; return false; } #ifdef _WIN32 @@ -738,7 +738,7 @@ bool ManagerPrivate::RunExecutable(const std::string &_name, sizeof(MYDATA)); if (pDataArray == nullptr) { - ignerr << "allocation fails " << GetLastErrorAsString() << '\n'; + gzerr << "allocation fails " << GetLastErrorAsString() << '\n'; return false; } @@ -768,7 +768,7 @@ bool ManagerPrivate::RunExecutable(const std::string &_name, // Run the command, replacing the current process image if (_spawnv(_P_WAIT , cstrings[0], &cstrings[0]) < 0) { - ignerr << "Unable to run command[" + gzerr << "Unable to run command[" << std::accumulate( pDataArray->_cmd.begin(), pDataArray->_cmd.end(), @@ -779,7 +779,7 @@ bool ManagerPrivate::RunExecutable(const std::string &_name, if (!ReleaseSemaphore(pDataArray->stoppedChildSem, 1, nullptr)) { - ignerr << "Error Releasing Semaphore " + gzerr << "Error Releasing Semaphore " << GetLastErrorAsString() << std::endl; } @@ -796,7 +796,7 @@ bool ManagerPrivate::RunExecutable(const std::string &_name, nullptr, 0, dontThreadOnMe, pDataArray, 0, nullptr); if (thread == nullptr) { - ignerr << "Error creating thread on Windows " + gzerr << "Error creating thread on Windows " << GetLastErrorAsString() << '\n'; } else @@ -815,7 +815,7 @@ bool ManagerPrivate::RunExecutable(const std::string &_name, // If parent process... if (pid) { - igndbg << "Forked a process for [" << _name << "] command[" + gzdbg << "Forked a process for [" << _name << "] command[" << std::accumulate(_cmd.begin(), _cmd.end(), std::string("")) << "]\n" << std::flush; @@ -849,7 +849,7 @@ bool ManagerPrivate::RunExecutable(const std::string &_name, // Run the command, replacing the current process image if (execvp(cstrings[0], &cstrings[0]) < 0) { - ignerr << "Unable to run command[" + gzerr << "Unable to run command[" << std::accumulate( _cmd.begin(), _cmd.end(), @@ -882,7 +882,7 @@ void ManagerPrivate::ShutdownExecutables() int retVal = ReleaseSemaphore(myself->stoppedChildSem, 1, nullptr); if (retVal != 0) { - ignerr << "Error Releasing Semaphore: " + gzerr << "Error Releasing Semaphore: " << GetLastErrorAsString() << std::endl; } #endif @@ -900,7 +900,7 @@ void ManagerPrivate::ShutdownExecutables() int retVal = ReleaseSemaphore(myself->stoppedChildSem, 1, nullptr); if (retVal != 0) { - ignerr << "Error Releasing Semaphore: " + gzerr << "Error Releasing Semaphore: " << GetLastErrorAsString() << std::endl; } })); @@ -909,7 +909,7 @@ void ManagerPrivate::ShutdownExecutables() // Shutdown the processes for (const Executable &exec : this->executables) { - igndbg << "Killing the process[" << exec.name + gzdbg << "Killing the process[" << exec.name #ifndef _WIN32 << "] with PID[" << exec.pid << "]\n"; kill(exec.pid, SIGINT); @@ -926,20 +926,20 @@ void ManagerPrivate::ShutdownExecutables() #endif { #ifndef _WIN32 - igndbg << "Killing the wrapped plugin PID[" << pid << "]\n"; + gzdbg << "Killing the wrapped plugin PID[" << pid << "]\n"; kill(pid, SIGINT); #else - igndbg << "Killing the wrapped plugin PID[" << pid.dwProcessId << "]\n"; + gzdbg << "Killing the wrapped plugin PID[" << pid.dwProcessId << "]\n"; TerminateProcess(pid.hProcess, 0); #endif } - igndbg << "Waiting for each process to end\n"; + gzdbg << "Waiting for each process to end\n"; // Wait for all the monitors to stop for (std::thread &m : monitors) m.join(); - igndbg << "All finished\n"; + gzdbg << "All finished\n"; } ////////////////////////////////////////////////// @@ -960,7 +960,7 @@ void ManagerPrivate::ParseExecutables(const tinyxml2::XMLElement *_elem) if (nameStr.empty()) { valid = false; - ignerr << "Invalid configuration file, " + gzerr << "Invalid configuration file, " << "missing name attribute for the " << i << " element." << std::endl; } @@ -971,14 +971,14 @@ void ManagerPrivate::ParseExecutables(const tinyxml2::XMLElement *_elem) if (!cmdElem) { valid = false; - ignerr << "Invalid configuration file, " + gzerr << "Invalid configuration file, " << "missing child element " << " of \n"; } else { std::vector parts = - ignition::common::split(cmdElem->GetText(), " "); + gz::common::split(cmdElem->GetText(), " "); std::move(parts.begin(), parts.end(), std::back_inserter(cmdParts)); } @@ -988,7 +988,7 @@ void ManagerPrivate::ParseExecutables(const tinyxml2::XMLElement *_elem) "auto_restart"); if (restartElem && restartElem->GetText()) { - std::string txt = ignition::common::lowercase(restartElem->GetText()); + std::string txt = gz::common::lowercase(restartElem->GetText()); autoRestart = txt == "true" || txt == "1" || txt == "t"; } @@ -998,7 +998,7 @@ void ManagerPrivate::ParseExecutables(const tinyxml2::XMLElement *_elem) { if (!this->RunExecutable(nameStr, cmdParts, autoRestart, localEnvs)) { - ignerr << "Unable to run executable named[" << nameStr << "] in " + gzerr << "Unable to run executable named[" << nameStr << "] in " << "configuration file.\n"; } } @@ -1028,7 +1028,7 @@ std::list ManagerPrivate::ParseEnvs( // Expand env var contents, such as $LD_LIBRARY_PATH if (!value.empty() && value.at(0) == '$') { - ignition::common::env(value.substr(1), value); + gz::common::env(value.substr(1), value); } result.push_back(name + "=" + value); @@ -1048,7 +1048,7 @@ void ManagerPrivate::LoadPlugin(const tinyxml2::XMLElement *_elem) std::string name = nameStr == nullptr ? "" : nameStr; if (name.empty()) { - ignerr << "Invalid config file, " + gzerr << "Invalid config file, " << "missing a name attribute for a plugin." << std::endl; return; } @@ -1058,13 +1058,13 @@ void ManagerPrivate::LoadPlugin(const tinyxml2::XMLElement *_elem) std::string file = fileStr == nullptr ? "" : fileStr; if (file.empty()) { - ignerr << "Invalid config file, " + gzerr << "Invalid config file, " << "missing filename attribute for plugin with name[" << name << "]" << std::endl; return; } - if (name == "ignition::launch::GazeboServer") + if (name == "gz::launch::GazeboServer") { #ifdef _WIN32 _putenv_s("RMT_PORT", "1500"); @@ -1072,7 +1072,7 @@ void ManagerPrivate::LoadPlugin(const tinyxml2::XMLElement *_elem) setenv("RMT_PORT", "1500", 1); #endif } - else if (name == "ignition::launch::GazeboGui") + else if (name == "gz::launch::GazeboGui") { #ifdef _WIN32 _putenv_s("RMT_PORT", "1501"); @@ -1081,22 +1081,23 @@ void ManagerPrivate::LoadPlugin(const tinyxml2::XMLElement *_elem) #endif } - ignition::common::SystemPaths systemPaths; - systemPaths.SetPluginPathEnv("IGN_LAUNCH_PLUGIN_PATH"); - systemPaths.AddPluginPaths(IGNITION_LAUNCH_PLUGIN_INSTALL_PATH); + gz::common::SystemPaths systemPaths; + systemPaths.SetPluginPathEnv("GZ_LAUNCH_PLUGIN_PATH"); + systemPaths.AddPluginPaths(GZ_LAUNCH_PLUGIN_INSTALL_PATH); // Add LD_LIBRARY_PATH #ifdef __linux__ std::string libPath; - ignition::common::env("LD_LIBRARY_PATH", libPath); + gz::common::env("LD_LIBRARY_PATH", libPath); systemPaths.AddPluginPaths(libPath); #endif // Add in the gazebo plugin path for convenience std::string homePath; - ignition::common::env(IGN_HOMEDIR, homePath); + gz::common::env(IGN_HOMEDIR, homePath); + systemPaths.AddPluginPaths( - ignition::common::joinPaths(homePath, ".ignition", "gazebo", "plugins")); + gz::common::joinPaths(homePath, ".gz", "sim", "plugins")); std::string pathToLib; if (common::exists(file)) @@ -1106,8 +1107,28 @@ void ManagerPrivate::LoadPlugin(const tinyxml2::XMLElement *_elem) if (pathToLib.empty()) { - ignerr << "Failed to find the path to library[" << file << "]. " - << "Try adding the path to the IGN_LAUNCH_PLUGIN_PATH environment " + // TODO(CH3): Deprecated. Remove on ticktock. + // This tries to find one more time with IGN_LAUNCH_PLUGIN_PATH instead of + // GZ_LAUNCH_PLUGIN_PATH + systemPaths.SetPluginPathEnv("IGN_LAUNCH_PLUGIN_PATH"); + + systemPaths.AddPluginPaths( + gz::common::joinPaths(homePath, ".ignition", "gazebo", "plugins")); + + pathToLib = systemPaths.FindSharedLibrary(file); + + if (!pathToLib.empty()) + { + gzwarn << "Found plugin [" << pathToLib + << "] using deprecated environment variable [IGN_LAUNCH_PLUGIN_PATH]." + " Please use [GZ_LAUNCH_PLUGIN_PATH] instead." << std::endl; + } + } + + if (pathToLib.empty()) + { + gzerr << "Failed to find the path to library[" << file << "]. " + << "Try adding the path to the GZ_LAUNCH_PLUGIN_PATH environment " << "variable.\n"; return; } @@ -1116,25 +1137,25 @@ void ManagerPrivate::LoadPlugin(const tinyxml2::XMLElement *_elem) std::unordered_set localPlugins = loader.LoadLib(pathToLib); if (localPlugins.empty()) { - ignerr << "Failed to load plugin [" << pathToLib << "] library\n"; + gzerr << "Failed to load plugin [" << pathToLib << "] library\n"; return; } std::unordered_set validPlugins = - loader.PluginsImplementing(); + loader.PluginsImplementing(); if (validPlugins.count(name) == 0) { std::string availablePlugins; for (const std::string &vp : validPlugins) availablePlugins += vp + " "; - ignerr << "Failed to find implementation with name[" << name << "] in " + gzerr << "Failed to find implementation with name[" << name << "] in " << file << ". Available implementations include: " << availablePlugins << std::endl; return; } - igndbg << "Loading plugin. Name[" << name + gzdbg << "Loading plugin. Name[" << name << "] File[" << file << "]" << std::endl; PluginPtr plugin = loader.Instantiate(name); diff --git a/src/Manager.hh b/src/Manager.hh index a44a22a7..63d3297f 100644 --- a/src/Manager.hh +++ b/src/Manager.hh @@ -14,27 +14,27 @@ * limitations under the License. * */ -#ifndef IGNITION_LAUNCH_MANAGER_HH_ -#define IGNITION_LAUNCH_MANAGER_HH_ +#ifndef GZ_LAUNCH_MANAGER_HH_ +#define GZ_LAUNCH_MANAGER_HH_ #include #include -// #include +// #include -#include +#include -namespace ignition +namespace gz { namespace launch { // Inline bracket to help doxygen filtering. - inline namespace IGNITION_LAUNCH_VERSION_NAMESPACE { + inline namespace GZ_LAUNCH_VERSION_NAMESPACE { // Forward declaration of the private data class class ManagerPrivate; /// \brief Class for starting and managing programs and plugins. - class IGNITION_LAUNCH_VISIBLE Manager + class GZ_LAUNCH_VISIBLE Manager { /// \brief Constructor. public: Manager(); diff --git a/src/Manager_TEST.cc b/src/Manager_TEST.cc index ba6f7ffd..a28e4df5 100644 --- a/src/Manager_TEST.cc +++ b/src/Manager_TEST.cc @@ -16,10 +16,10 @@ */ #include -#include -#include +#include +#include -#include +#include #include @@ -41,9 +41,9 @@ class ManagerTest : public ::testing::Test bool RemoveTestScript(std::string _testScriptPath) { // Remove the file if it already exists - if (ignition::common::isFile(_testScriptPath)) + if (gz::common::isFile(_testScriptPath)) { - if (!ignition::common::removeFile(_testScriptPath)) + if (!gz::common::removeFile(_testScriptPath)) { return false; } @@ -77,7 +77,7 @@ type nul > %TEST_VAR% ///////////////////////////////////////////////// TEST_F(ManagerTest, RunEmptyConfig) { - ignition::launch::Manager mgr; + gz::launch::Manager mgr; // Expect false because no config file was set. EXPECT_FALSE(mgr.RunConfig("")); @@ -91,7 +91,7 @@ TEST_F(ManagerTest, MissingIgnition) " ign-gazebo-server" ""; - ignition::launch::Manager mgr; + gz::launch::Manager mgr; // Stop the manager after a short pause. EXPECT_FALSE(mgr.RunConfig(config)); @@ -105,7 +105,7 @@ TEST_F(ManagerTest, RunBadXml) " executable>"; - ignition::launch::Manager mgr; + gz::launch::Manager mgr; // Stop the manager after a short pause. EXPECT_FALSE(mgr.RunConfig(config)); @@ -129,7 +129,7 @@ TEST_F(ManagerTest, RunLs) " " ")"; - ignition::launch::Manager mgr; + gz::launch::Manager mgr; // We should be able to run the ls command. This does not check the // output. @@ -147,9 +147,9 @@ TEST_F(ManagerTest, RunEnvPre) std::string(getenv("localappdata")) + "\\Temp\\ign-launch-env-test-pre"; #endif - if (ignition::common::isFile(testPath)) + if (gz::common::isFile(testPath)) { - ASSERT_TRUE(ignition::common::removeFile(testPath)); + ASSERT_TRUE(gz::common::removeFile(testPath)); } ASSERT_TRUE(WriteTestScript(testScriptPath)); @@ -166,11 +166,11 @@ TEST_F(ManagerTest, RunEnvPre) )"; - ignition::launch::Manager mgr; + gz::launch::Manager mgr; EXPECT_TRUE(mgr.RunConfig(config)); - EXPECT_TRUE(ignition::common::isFile(testPath)); - EXPECT_TRUE(ignition::common::removeFile(testPath)); + EXPECT_TRUE(gz::common::isFile(testPath)); + EXPECT_TRUE(gz::common::removeFile(testPath)); EXPECT_TRUE(RemoveTestScript(testScriptPath)); } @@ -185,9 +185,9 @@ TEST_F(ManagerTest, RunEnvPost) std::string(getenv("localappdata")) + "\\Temp\\ign-launch-env-test-post"; #endif - if (ignition::common::isFile(testPath)) + if (gz::common::isFile(testPath)) { - ASSERT_TRUE(ignition::common::removeFile(testPath)); + ASSERT_TRUE(gz::common::removeFile(testPath)); } ASSERT_TRUE(WriteTestScript(testScriptPath)); @@ -204,18 +204,18 @@ TEST_F(ManagerTest, RunEnvPost) )"; - ignition::launch::Manager mgr; + gz::launch::Manager mgr; EXPECT_TRUE(mgr.RunConfig(config)); - EXPECT_TRUE(ignition::common::isFile(testPath)); - EXPECT_TRUE(ignition::common::removeFile(testPath)); + EXPECT_TRUE(gz::common::isFile(testPath)); + EXPECT_TRUE(gz::common::removeFile(testPath)); EXPECT_TRUE(RemoveTestScript(testScriptPath)); } ///////////////////////////////////////////////// int main(int argc, char **argv) { - ignition::common::Console::SetVerbosity(4); + gz::common::Console::SetVerbosity(4); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } diff --git a/src/cmd/CMakeLists.txt b/src/cmd/CMakeLists.txt index a92f202a..30cadc32 100644 --- a/src/cmd/CMakeLists.txt +++ b/src/cmd/CMakeLists.txt @@ -36,8 +36,8 @@ foreach(test ${test_list}) # auxiliary files from. Using a generator expression here is useful for # multi-configuration generators, like Visual Studio. target_compile_definitions(${test} PRIVATE - "DETAIL_IGN_TRANSPORT_TEST_DIR=\"$\"" - "IGN_TEST_LIBRARY_PATH=\"$\"") + "DETAIL_GZ_TRANSPORT_TEST_DIR=\"$\"" + "GZ_TEST_LIBRARY_PATH=\"$\"") endforeach() @@ -46,7 +46,7 @@ if (TARGET UNIT_ign_TEST) UNIT_ign_TEST PROPERTIES ENVIRONMENT - "IGN_CONFIG_PATH=${CMAKE_BINARY_DIR}/test/conf/$" + "GZ_CONFIG_PATH=${CMAKE_BINARY_DIR}/test/conf/$" ) endif() diff --git a/src/cmd/ign.cc b/src/cmd/ign.cc index ce80f9cd..96b212f9 100644 --- a/src/cmd/ign.cc +++ b/src/cmd/ign.cc @@ -15,33 +15,33 @@ * */ #include -#include +#include -#include "ignition/launch/config.hh" +#include "gz/launch/config.hh" #include "ign.hh" #include "../Manager.hh" ////////////////////////////////////////////////// extern "C" char *ignitionVersion() { - return strdup(IGNITION_LAUNCH_VERSION_FULL); + return strdup(GZ_LAUNCH_VERSION_FULL); } ////////////////////////////////////////////////// extern "C" const char *configPath() { - return IGNITION_LAUNCH_INITIAL_CONFIG_PATH; + return GZ_LAUNCH_INITIAL_CONFIG_PATH; } ////////////////////////////////////////////////// extern "C" void cmdVerbosity(const int _verbosity) { - ignition::common::Console::SetVerbosity(_verbosity); + gz::common::Console::SetVerbosity(_verbosity); } ////////////////////////////////////////////////// extern "C" int run(const char *_config) { - ignition::launch::Manager mgr; + gz::launch::Manager mgr; return mgr.RunConfig(_config); } diff --git a/src/cmd/ign.hh b/src/cmd/ign.hh index e5c99133..1a5a1719 100644 --- a/src/cmd/ign.hh +++ b/src/cmd/ign.hh @@ -14,10 +14,10 @@ * limitations under the License. * */ -#ifndef IGNITION_LAUNCH_IGN_HH_ -#define IGNITION_LAUNCH_IGN_HH_ +#ifndef GZ_LAUNCH_GZ_HH_ +#define GZ_LAUNCH_GZ_HH_ -#include "ignition/launch/Export.hh" +#include "gz/launch/Export.hh" /// \brief External hook to read the library version. /// \return C-string representing the version. Ex.: 0.1.2 diff --git a/src/cmd/ign_TEST.cc b/src/cmd/ign_TEST.cc index 6542daa9..5f22bbc7 100644 --- a/src/cmd/ign_TEST.cc +++ b/src/cmd/ign_TEST.cc @@ -21,9 +21,9 @@ #include -#include +#include -#include "ignition/launch/test_config.hh" // NOLINT(build/include) +#include "gz/launch/test_config.hh" // NOLINT(build/include) #ifdef _WIN32 #define popen _popen @@ -54,7 +54,7 @@ std::string customExecStr(std::string _cmd) std::string get_config_path(const std::string filename) { - return(ignition::common::joinPaths( + return(gz::common::joinPaths( std::string(PROJECT_SOURCE_PATH), "test", "config", filename)); } diff --git a/src/cmd/launch_main.cc b/src/cmd/launch_main.cc index e8f52b76..661033d7 100644 --- a/src/cmd/launch_main.cc +++ b/src/cmd/launch_main.cc @@ -16,12 +16,12 @@ * */ -#include -#include +#include +#include -#include +#include -#include "ignition/launch/config.hh" +#include "gz/launch/config.hh" #include "ign.hh" #ifdef _WIN32 @@ -80,20 +80,20 @@ void runLaunchCommand(const LaunchOptions &_opt) if (!launchfile.empty()) { // If the launch file is not a file, then look in the paths set by the - // IGN_LAUNCH_CONFIG_PATH environment variable. - if (!ignition::common::isFile(launchfile)) + // GZ_LAUNCH_CONFIG_PATH environment variable. + if (!gz::common::isFile(launchfile)) { std::string configPathEnv; - ignition::common::env("IGN_LAUNCH_CONFIG_PATH", configPathEnv, true); + gz::common::env("GZ_LAUNCH_CONFIG_PATH", configPathEnv, true); if (!configPathEnv.empty()) { std::vector paths = - ignition::common::split(configPathEnv, ":"); + gz::common::split(configPathEnv, ":"); for (const std::string &path : paths) { std::string filePath = - ignition::common::joinPaths(path, launchfile); - if (ignition::common::isFile(filePath)) + gz::common::joinPaths(path, launchfile); + if (gz::common::isFile(filePath)) { launchfile = filePath; break; @@ -101,9 +101,9 @@ void runLaunchCommand(const LaunchOptions &_opt) } } - if (!ignition::common::isFile(launchfile)) + if (!gz::common::isFile(launchfile)) { - ignerr << "File [" + launchfile + "] does not exists" + gzerr << "File [" + launchfile + "] does not exists" << std::endl; exit(-1); } @@ -112,14 +112,14 @@ void runLaunchCommand(const LaunchOptions &_opt) std::string cmd = "erb "; for (auto & arg : _opt.more_comms) { - auto tokens = ignition::common::split(arg, ":="); + auto tokens = gz::common::split(arg, ":="); if (tokens.size() == 2) { cmd += " " + tokens[0] + "=" + tokens[1]; } else { - ignerr << "This argument [" << arg << "] is wrong for erb" + gzerr << "This argument [" << arg << "] is wrong for erb" << std::endl; exit(1); } diff --git a/test/integration/deprecated_TEST.cc b/test/integration/deprecated_TEST.cc new file mode 100644 index 00000000..5b99bc6d --- /dev/null +++ b/test/integration/deprecated_TEST.cc @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2022 Open Source Robotics Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ + +#include + +#define SUPPRESS_IGNITION_HEADER_DEPRECATION + +#include +#include + +///////////////////////////////////////////////// +// Make sure the ignition namespace still works +TEST(Deprecated, IgnitionNamespace) +{ + ignition::launch::Plugin plugin; +} + +#undef SUPPRESS_IGNITION_HEADER_DEPRECATION diff --git a/test/integration/faulty_plugins.cc b/test/integration/faulty_plugins.cc index cb86e8a2..98d0187d 100644 --- a/test/integration/faulty_plugins.cc +++ b/test/integration/faulty_plugins.cc @@ -32,7 +32,7 @@ std::string getConfig(const std::string &_pluginName) bool runConfig(const std::string &_config) { - ignition::launch::Manager mgr; + gz::launch::Manager mgr; return mgr.RunConfig(_config); } diff --git a/test/integration/plugins/bad_plugins.cc b/test/integration/plugins/bad_plugins.cc index ce17e847..c18c88f4 100644 --- a/test/integration/plugins/bad_plugins.cc +++ b/test/integration/plugins/bad_plugins.cc @@ -16,11 +16,11 @@ */ #include "bad_plugins.hh" -#include +#include #include -SegfaultOnLoad::SegfaultOnLoad(): ignition::launch::Plugin() {} +SegfaultOnLoad::SegfaultOnLoad(): gz::launch::Plugin() {} bool SegfaultOnLoad::Load(const tinyxml2::XMLElement * /*_elem*/) { @@ -31,4 +31,4 @@ bool SegfaultOnLoad::Load(const tinyxml2::XMLElement * /*_elem*/) return true; } -IGNITION_ADD_PLUGIN(SegfaultOnLoad, ignition::launch::Plugin) +IGNITION_ADD_PLUGIN(SegfaultOnLoad, gz::launch::Plugin) diff --git a/test/integration/plugins/bad_plugins.hh b/test/integration/plugins/bad_plugins.hh index 214e95b1..f803e36c 100644 --- a/test/integration/plugins/bad_plugins.hh +++ b/test/integration/plugins/bad_plugins.hh @@ -15,10 +15,10 @@ * */ -#include -#include "ignition/launch/Plugin.hh" +#include +#include "gz/launch/Plugin.hh" -class SegfaultOnLoad : public ignition::launch::Plugin +class SegfaultOnLoad : public gz::launch::Plugin { public: SegfaultOnLoad(); public: virtual bool Load( diff --git a/test/test_config.hh.in b/test/test_config.hh.in index 0c86ddfd..0eae91f9 100644 --- a/test/test_config.hh.in +++ b/test/test_config.hh.in @@ -14,8 +14,8 @@ * limitations under the License. * */ -#ifndef IGNITION_LAUNCH_TEST_CONFIG_HH_ -#define IGNITION_LAUNCH_TEST_CONFIG_HH_ +#ifndef GZ_LAUNCH_TEST_CONFIG_HH_ +#define GZ_LAUNCH_TEST_CONFIG_HH_ #define PROJECT_SOURCE_PATH "${PROJECT_SOURCE_DIR}" #define PROJECT_BINARY_PATH "${CMAKE_BINARY_DIR}" diff --git a/tutorials/install.md b/tutorials/install.md index 9a794a99..7f119a3b 100644 --- a/tutorials/install.md +++ b/tutorials/install.md @@ -2,9 +2,9 @@ # Install -These instructions are for installing only Ignition Launch. If you're interested +These instructions are for installing only Gazebo Launch. If you're interested in using all the Ignition libraries, not only Igniton Launch, check out this -[Ignition installation](https://ignitionrobotics.org/docs/latest/install). +[Ignition installation](https://gazebosim.org/docs/latest/install). We recommend following the binary install instructions to get up and running as quickly and painlessly as possible. @@ -38,7 +38,7 @@ On macOS, add OSRF packages: brew tap osrf/simulation ``` -Install Ignition GUI: +Install Gazebo GUI: ``` brew install ignition-launch<#> ``` @@ -79,7 +79,7 @@ necessary prerequisites followed by building from source. 1. Clone the repository ```sh - git clone https://github.com/ignitionrobotics/ign-launch + git clone https://github.com/gazebosim/gz-launch ``` 2. Configure and build @@ -88,7 +88,7 @@ necessary prerequisites followed by building from source. cd ign-launch; mkdir build; cd build; cmake ..; make ``` -3. Optionally, install Ignition Launch +3. Optionally, install Gazebo Launch ```sh sudo make install @@ -98,7 +98,7 @@ necessary prerequisites followed by building from source. 1. Clone the repository ``` - git clone https://github.com/ignitionrobotics/ign-launch -b ign-launch<#> + git clone https://github.com/gazebosim/gz-launch -b ign-launch<#> ``` Be sure to replace `<#>` with a number value, such as 4 or 5, depending on which version you need. @@ -126,7 +126,7 @@ necessary prerequisites followed by building from source. # Documentation -API and tutorials can be found at [https://ignitionrobotics.org/libs/launch](https://ignitionrobotics.org/libs/launch). +API and tutorials can be found at [https://gazebosim.org/libs/launch](https://gazebosim.org/libs/launch). You can also generate the documentation from a clone of this repository by following these steps. @@ -139,7 +139,7 @@ You can also generate the documentation from a clone of this repository by follo 2. Clone the repository ``` - git clone https://github.com/ignitionrobotics/ign-launch + git clone https://github.com/gazebosim/gz-launch ``` 3. Configure and build the documentation. diff --git a/tutorials/tutorial.md b/tutorials/tutorial.md index 42e3d0a3..0aef546d 100644 --- a/tutorials/tutorial.md +++ b/tutorials/tutorial.md @@ -1,6 +1,6 @@ \page basics Ignition launch tutorial -Ignition Launch is used to run and manage plugins and programs. A configuration script can be used to specify which programs and plugins to execute. Alternatively, individual programs and plugins can be run from the command line. +Gazebo Launch is used to run and manage plugins and programs. A configuration script can be used to specify which programs and plugins to execute. Alternatively, individual programs and plugins can be run from the command line. In this tutorial we will explain the configuration scripts in the `examples` directory. @@ -62,10 +62,10 @@ There is a lookup process happening if the specified file is not an absolute path. It searches for a file with the given name in paths as follows: 1. current directory -1. all paths specified in environment variable `IGN_LAUNCH_CONFIG_PATH` +1. all paths specified in environment variable `GZ_LAUNCH_CONFIG_PATH` 1. a hardcoded install location (usually `/usr/share/ignition/ignition-launchN/configs/`) -The `IGN_LAUNCH_CONFIG_PATH` environment variable can contain either a single +The `GZ_LAUNCH_CONFIG_PATH` environment variable can contain either a single path or a path list (_new since 2.2.2_). Path list is a colon-separated (on UNIX) or semicolon-separated (on Windows) list of absolute paths. \ No newline at end of file