Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ign -> gz Provisional Finale: Source Migration : gz-launch #177

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions .github/ci/packages.apt
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
binutils-dev
libgflags-dev
libignition-cmake3-dev
libignition-common5-dev
libignition-fuel-tools8-dev
libignition-gazebo7-dev
libignition-gui7-dev
libignition-math7-dev
libignition-math7-eigen3-dev
libignition-msgs9-dev
libignition-physics6-dev
libignition-plugin2-dev
libignition-rendering7-dev
libignition-sensors7-dev
libignition-tools2-dev
libignition-transport12-dev
libgz-cmake3-dev
libgz-common5-dev
libgz-fuel-tools8-dev
libgz-sim7-dev
libgz-gui7-dev
libgz-math7-dev
libgz-math7-eigen3-dev
libgz-msgs9-dev
libgz-physics6-dev
libgz-plugin2-dev
libgz-rendering7-dev
libgz-sensors7-dev
libgz-tools2-dev
libgz-transport12-dev
libsdformat13-dev
libtinyxml2-dev
libwebsockets-dev
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
uses: actions/checkout@v2
- name: Compile and test
id: ci
uses: ignition-tooling/action-ignition-ci@focal
uses: gazebo-tooling/action-gz-ci@focal
with:
codecov-enabled: true
cppcheck-enabled: true
Expand All @@ -24,4 +24,4 @@ jobs:
uses: actions/checkout@v2
- name: Compile and test
id: ci
uses: ignition-tooling/action-ignition-ci@jammy
uses: gazebo-tooling/action-gz-ci@jammy
2 changes: 1 addition & 1 deletion .github/workflows/pr-collection-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ jobs:
steps:
- name: Add collection labels
if: github.event.action == 'opened'
uses: ignition-tooling/pr-collection-labeler@v1
uses: gazebo-tooling/pr-collection-labeler@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
8 changes: 3 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@ set(GZ_CMAKE_VER ${gz-cmake3_VERSION_MAJOR})
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

gz_configure_project(
REPLACE_IGNITION_INCLUDE_PATH gz/launch
VERSION_SUFFIX)
gz_configure_project(VERSION_SUFFIX pre1)

#============================================================================
# Set project-specific options
#============================================================================

set(GZ_LAUNCH_PLUGIN_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/${IGN_LIB_INSTALL_DIR}/gz-${IGN_DESIGNATION}-${PROJECT_VERSION_MAJOR}/plugins/")
set(GZ_LAUNCH_PLUGIN_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/${GZ_LIB_INSTALL_DIR}/gz-${GZ_DESIGNATION}-${PROJECT_VERSION_MAJOR}/plugins/")

#============================================================================
# Search for project-specific dependencies
Expand Down Expand Up @@ -112,7 +110,7 @@ add_subdirectory(plugins)
gz_configure_build(QUIT_IF_BUILD_ERRORS)

#============================================================================
# install example .ign files
# install example .gzlaunch files
#============================================================================
add_subdirectory(examples)

Expand Down
4 changes: 2 additions & 2 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
1. Add PKGCONFIG information to gz-tools gz_find_package
* [Pull Request 44](https://github.com/gazebosim/gz-launch/pull/44)

1. Fix factory.gz launch file
1. Fix factory.gzlaunch launch file
* [Pull Request 55](https://github.com/gazebosim/gz-launch/pull/55)

1. Use random name for manager semaphore
Expand Down Expand Up @@ -254,7 +254,7 @@

### Gazebo Launch 1.3.0 (2019-11-13)

1. Add filepath to ERB so that constants like `__FILE__` in `.ign` files work as expected
1. Add filepath to ERB so that constants like `__FILE__` in `.gzlaunch` files work as expected
* [BitBucket pull request 48](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-launch/pull-requests/48)

1. Add backward support to gz-launch to capture backtraces.
Expand Down
1 change: 1 addition & 0 deletions Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ release will remove the deprecated code.

- The shared libraries have `gz` where there used to be `ignition`.
- Using the un-migrated version is still possible due to tick-tocks, but will be removed in future versions.
- Launch files have been hard-tocked to the `.gzlaunch` extension instead of `.ign`.

## Gazebo Launch 2.2.2

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Sample launch configuration files are in the [examples directory](https://github
1. Run a configuration that launches [Gazebo](https://gazebosim.org/libs/gazebo).

```
gz launch sim.ign
gz launch sim.gzlaunch
```

## Known issue of command line tools
Expand Down Expand Up @@ -108,7 +108,7 @@ Refer to the following table for information about important directories and fil
```
gz-launch
├── examples Example launch configurations.
├── include/ignition/launch Header files.
├── include/gz/launch Header files.
├── plugins Launch plugins, one per subdirectory.
├── src Source files and unit tests.
├── test
Expand Down
4 changes: 2 additions & 2 deletions api.md.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Gazebo @IGN_DESIGNATION_CAP@
## Gazebo @GZ_DESIGNATION_CAP@

Gazebo @IGN_DESIGNATION_CAP@ is a component in Gazebo, a set of libraries
Gazebo @GZ_DESIGNATION_CAP@ is a component in Gazebo, a set of libraries
designed to rapidly develop robot and simulation applications.

## License
Expand Down
4 changes: 2 additions & 2 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
file(GLOB files "*.ign")
file(GLOB files "*.gzlaunch")
install(FILES ${files}
DESTINATION ${IGN_DATA_INSTALL_DIR}/configs)
DESTINATION ${GZ_DATA_INSTALL_DIR}/configs)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 12 additions & 12 deletions examples/sim_plugins.ign → examples/sim_plugins.gzlaunch
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version='1.0'?>
<!-- Usage: gz launch gazebo_plugins.ign [worldName:=<worldName>]
<!-- Usage: gz launch sim_plugins.gzlaunch [worldName:=<worldName>]

The [worldName] command line argument is optional. If left blank, or not
specified, then "diff_drive" is used for the world name.

Example that loads the shapes.sdf world instead of diff_drive:

gz launch gazebo_plugins.ign worldName:=shapes
gz launch sim_plugins.gzlaunch worldName:=shapes
-->
<%
# Check if worldName is not defined or is empty/nil
Expand Down Expand Up @@ -56,8 +56,8 @@
<enabled>true</enabled>
<!-- Use the <path> element to specify where to create the log file on
disk. Leaving this empty will cause Gazebo to log into the default
location of ~/.ignition/gazebo/log -->
<path>/tmp/ign-launch-demo</path>
location of ~/.gz/sim/log -->
<path>/tmp/gz-launch-demo</path>

<!-- Use the <overwrite> element to overwrite <path> in case it already
exists. Otherwise, logs will be recorded to a new path that has a
Expand Down Expand Up @@ -121,11 +121,11 @@
In this example, setting to a resource file shipped with Gazebo GUI -->
<window_icon>:/qml/images/drawer.png</window_icon>
<plugin filename="GzScene3D" name="3D View">
<ignition-gui>
<gz-gui>
<title>3D View</title>
<property type="bool" key="showTitleBar">false</property>
<property type="string" key="state">docked</property>
</ignition-gui>
</gz-gui>

<engine>ogre2</engine>
<scene>scene</scene>
Expand All @@ -134,7 +134,7 @@
<camera_pose>-6 0 6 0 0.5 0</camera_pose>
</plugin>
<plugin filename="WorldControl" name="World control">
<ignition-gui>
<gz-gui>
<title>World control</title>
<property type="bool" key="showTitleBar">false</property>
<property type="bool" key="resizable">false</property>
Expand All @@ -147,7 +147,7 @@
<line own="left" target="left"/>
<line own="bottom" target="bottom"/>
</anchors>
</ignition-gui>
</gz-gui>

<play_pause>true</play_pause>
<step>true</step>
Expand All @@ -158,7 +158,7 @@
</plugin>

<plugin filename="WorldStats" name="World stats">
<ignition-gui>
<gz-gui>
<title>World stats</title>
<property type="bool" key="showTitleBar">false</property>
<property type="bool" key="resizable">false</property>
Expand All @@ -171,7 +171,7 @@
<line own="right" target="right"/>
<line own="bottom" target="bottom"/>
</anchors>
</ignition-gui>
</gz-gui>

<sim_time>true</sim_time>
<real_time>true</real_time>
Expand All @@ -182,9 +182,9 @@

<!-- Entity tree -->
<plugin filename="EntityTree" name="Entity tree">
<ignition-gui>
<gz-gui>
<title>Entity tree</title>
</ignition-gui>
</gz-gui>
</plugin>

<!-- Transform Control -->
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion include/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
add_subdirectory(gz)
install(DIRECTORY ignition DESTINATION ${IGN_INCLUDE_INSTALL_DIR_FULL})
install(DIRECTORY ignition DESTINATION ${GZ_INCLUDE_INSTALL_DIR_FULL})
2 changes: 1 addition & 1 deletion include/gz/launch/config.hh.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#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 GZ_LAUNCH_INITIAL_CONFIG_PATH "${CMAKE_INSTALL_PREFIX}/${IGN_DATA_INSTALL_DIR}/configs"
#define GZ_LAUNCH_INITIAL_CONFIG_PATH "${CMAKE_INSTALL_PREFIX}/${GZ_DATA_INSTALL_DIR}/configs"

#define GZ_LAUNCH_PLUGIN_INSTALL_PATH "${GZ_LAUNCH_PLUGIN_INSTALL_PATH}"

Expand Down
2 changes: 1 addition & 1 deletion plugins/sim_gui/SimGui.hh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace gz
/// <plugin name="gz::launch::SimGui"
/// filename="gz-launch-simgui">
///
/// <!-- Elements parsed by ign-launch -->
/// <!-- Elements parsed by gz-launch -->
///
/// <!-- Set window title. Defaults to "Gazebo" -->
/// <window_title>Custom window title</window_title>
Expand Down
2 changes: 1 addition & 1 deletion plugins/websocket_server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ gz sim -v 4
source tree.

```
gz launch -f examples/websocket.ign -v 4
gz launch -f examples/websocket.gzlaunch -v 4
```

5. Open the `plugins/websocket_server/index.html` in a web browser.
Expand Down
2 changes: 1 addition & 1 deletion plugins/websocket_server/WebsocketServer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ void WebsocketServer::OnMessage(int _socketId, const std::string &_msg)
bool result;
unsigned int timeout = 2000;

bool executed = this->node.Request("/gazebo/worlds",
bool executed = this->node.Request("/sim/worlds",
req, timeout, rep, result);

std::string data = BUILD_MSG(this->operations[PUBLISH], frameParts[0],
Expand Down
4 changes: 2 additions & 2 deletions plugins/websocket_server/WebsocketServer.hh
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ namespace gz
/// ## Websocket Server
///
/// 1. Define a launch file by copying the following contents to a file
/// called `websocket.ign`.
/// called `websocket.gzlaunch`.
///
/// <!-- Inform gz::Launch about the JoyToTwist plugin -->
/// <plugin name="gz::launch::WebsocketServer"
Expand All @@ -140,7 +140,7 @@ namespace gz
///
/// 2. Run the launch file
///
/// `gz launch -v 4 websocket.ign`
/// `gz launch -v 4 websocket.gzlaunch`
///
/// 3. Open the [index.html](https://github.com/gazebosim/gz-launch/blob/main/plugins/websocket_server/index.html) webpage.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function buildMsg(_frameParts) {

/// \brief The main interface to the Gazebo websocket server and
/// data on Gazebo Transport.
function Ignition(options) {
function Gazebo(options) {
options = options || {};

this.socket = null;
Expand All @@ -43,11 +43,11 @@ function Ignition(options) {
this.connect(options.url, options.key);
}
}
Ignition.prototype.__proto__ = EventEmitter2.prototype;
Gazebo.prototype.__proto__ = EventEmitter2.prototype;

/// \brief Connect to the specified WebSocket.
/// \param url - WebSocket URL for Gazebo HTTPServer
Ignition.prototype.connect = function(url, key) {
Gazebo.prototype.connect = function(url, key) {
var that = this;

/// \brief Emits a 'connection' event on WebSocket connection.
Expand Down Expand Up @@ -148,7 +148,7 @@ Ignition.prototype.connect = function(url, key) {

/// \brief Send a message to the websocket server
/// \param[in] _msg Message to send
Ignition.prototype.sendMsg = function(_msg) {
Gazebo.prototype.sendMsg = function(_msg) {
var that = this;

var emitter = function(msg){
Expand All @@ -168,7 +168,7 @@ Ignition.prototype.sendMsg = function(_msg) {
/// \brief Interface to Gazebo Transport topics.
function Topic(options) {
options = options || {};
this.ign = options.ign;
this.gz = options.gz;
this.name = options.name;
this.messageType = options.messageType;
this.isAdvertised = false;
Expand All @@ -189,14 +189,14 @@ Topic.prototype.subscribe = function(_callback) {

var emitter = function(_cb) {
// Register the callback with the topic name
that.ign.on(that.name, _cb);
that.gz.on(that.name, _cb);

// Send the subscription message over the websocket.
that.ign.sendMsg(buildMsg(['sub', that.name, '', '']));
that.gz.sendMsg(buildMsg(['sub', that.name, '', '']));
}

if (!this.ign.isConnected) {
this.ign.on('connection', function() {
if (!this.gz.isConnected) {
this.gz.on('connection', function() {
emitter(_callback);
});
} else {
Expand Down
Loading