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

Bump main to gz-transport 15.0.0~pre1 #549

Merged
merged 2 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)
#============================================================================
# Initialize the project
#============================================================================
project(gz-transport14 VERSION 14.0.0)
project(gz-transport15 VERSION 15.0.0)

#============================================================================
# Find gz-cmake
Expand Down Expand Up @@ -33,7 +33,7 @@ cmake_dependent_option(USE_DIST_PACKAGES_FOR_PYTHON
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

gz_configure_project(VERSION_SUFFIX)
gz_configure_project(VERSION_SUFFIX pre1)

#============================================================================
# Set project-specific options
Expand Down
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Gazebo Transport 15.X

### Gazebo Transport 15.0.0 (20XX-XX-XX)

## Gazebo Transport 14.X

### Gazebo Transport 14.0.0 (2024-09-25)
Expand Down
4 changes: 2 additions & 2 deletions example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)
project(gz-transport-examples)

# Find the Gazebo Transport library
find_package(gz-transport14 QUIET REQUIRED OPTIONAL_COMPONENTS log)
set(GZ_TRANSPORT_VER ${gz-transport14_VERSION_MAJOR})
find_package(gz-transport15 QUIET REQUIRED OPTIONAL_COMPONENTS log)
set(GZ_TRANSPORT_VER ${gz-transport15_VERSION_MAJOR})

if (EXISTS "${CMAKE_SOURCE_DIR}/msgs/")
# Message generation. Only required when using custom Protobuf messages.
Expand Down
4 changes: 2 additions & 2 deletions package.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="2">
<name>gz-transport14</name>
<version>14.0.0</version>
<name>gz-transport15</name>
<version>15.0.0</version>
<description>Gazebo Transport: Provides fast and efficient asynchronous message passing, services, and data logging.</description>
<maintainer email="[email protected]">Carlos Agüero</maintainer>
<license>Apache License 2.0</license>
Expand Down
2 changes: 1 addition & 1 deletion python/examples/data_race_with_mutex.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#

from gz.msgs11.vector3d_pb2 import Vector3d
from gz.transport14 import Node
from gz.transport15 import Node

from threading import Lock
import time
Expand Down
2 changes: 1 addition & 1 deletion python/examples/data_race_without_mutex.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#

from gz.msgs11.vector3d_pb2 import Vector3d
from gz.transport14 import Node
from gz.transport15 import Node

import time

Expand Down
2 changes: 1 addition & 1 deletion python/examples/publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#! [complete]
from gz.msgs11.stringmsg_pb2 import StringMsg
from gz.msgs11.vector3d_pb2 import Vector3d
from gz.transport14 import Node
from gz.transport15 import Node

import time

Expand Down
2 changes: 1 addition & 1 deletion python/examples/requester.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#! [complete]
from gz.msgs11.stringmsg_pb2 import StringMsg
from gz.transport14 import Node
from gz.transport15 import Node

def main():
node = Node()
Expand Down
2 changes: 1 addition & 1 deletion python/examples/subscriber.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#! [complete]
from gz.msgs11.stringmsg_pb2 import StringMsg
from gz.msgs11.vector3d_pb2 import Vector3d
from gz.transport14 import Node
from gz.transport15 import Node

import time

Expand Down
2 changes: 1 addition & 1 deletion python/src/transport/_gz_transport_pybind11.cc
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ PYBIND11_MODULE(BINDINGS_MODULE_NAME, m) {
.def("has_connections",
&gz::transport::Node::Publisher::HasConnections,
"Return true if this publisher has subscribers");
} // gz-transport14 module
} // gz-transport15 module

} // python
} // transport
Expand Down
2 changes: 1 addition & 1 deletion python/test/options_TEST.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from gz.msgs11.stringmsg_pb2 import StringMsg
from gz.transport14 import Node, AdvertiseMessageOptions, SubscribeOptions, NodeOptions
from gz.transport15 import Node, AdvertiseMessageOptions, SubscribeOptions, NodeOptions

import unittest

Expand Down
2 changes: 1 addition & 1 deletion python/test/pubSub_TEST.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from gz.msgs11.stringmsg_pb2 import StringMsg
from gz.msgs11.vector3d_pb2 import Vector3d
from gz.transport14 import Node, AdvertiseMessageOptions, SubscribeOptions, TopicStatistics
from gz.transport15 import Node, AdvertiseMessageOptions, SubscribeOptions, TopicStatistics

from threading import Lock

Expand Down
2 changes: 1 addition & 1 deletion python/test/requester_TEST.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from gz.msgs11.int32_pb2 import Int32
from gz.msgs11.stringmsg_pb2 import StringMsg
from gz.transport14 import Node
from gz.transport15 import Node

import os
import subprocess
Expand Down
18 changes: 9 additions & 9 deletions tutorials/04_messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ cd ~/gz_transport_tutorial

## Publisher

Download the [publisher.cc](https://github.com/gazebosim/gz-transport/raw/gz-transport14/example/publisher.cc) file within the `gz_transport_tutorial`
Download the [publisher.cc](https://github.com/gazebosim/gz-transport/raw/main/example/publisher.cc) file within the `gz_transport_tutorial`
folder and open it with your favorite editor:

\snippet example/publisher.cc complete
Expand Down Expand Up @@ -76,7 +76,7 @@ The method *Publish()* sends a message to all the subscribers.

## Subscriber

Download the [subscriber.cc](https://github.com/gazebosim/gz-transport/raw/gz-transport14/example/subscriber.cc)
Download the [subscriber.cc](https://github.com/gazebosim/gz-transport/raw/main/example/subscriber.cc)
file into the `gz_transport_tutorial` folder and open it with your favorite editor:

\snippet example/subscriber.cc complete
Expand Down Expand Up @@ -126,7 +126,7 @@ until you hit *CTRL-C*. Note that this function captures the *SIGINT* and

## Building the code

Download the [CMakeLists.txt](https://github.com/gazebosim/gz-transport/raw/gz-transport14/example/CMakeLists.txt) file within the `gz_transport_tutorial` folder.
Download the [CMakeLists.txt](https://github.com/gazebosim/gz-transport/raw/main/example/CMakeLists.txt) file within the `gz_transport_tutorial` folder.

Once you have all your files, go ahead and create a `build/` directory within
the `gz_transport_tutorial` directory.
Expand Down Expand Up @@ -287,7 +287,7 @@ between Gazebo Transport and another protocol or if you want to just print the
content of a generic protobuf message using `DebugString()`, among other use
cases.

Download the [subscriber_generic.cc](https://github.com/gazebosim/gz-transport/raw/gz-transport14/example/subscriber_generic.cc) file within the `gz_transport_tutorial` folder and open it with your favorite editor:
Download the [subscriber_generic.cc](https://github.com/gazebosim/gz-transport/raw/main/example/subscriber_generic.cc) file within the `gz_transport_tutorial` folder and open it with your favorite editor:

```{.cpp}
#include <google/protobuf/message.h>
Expand Down Expand Up @@ -416,12 +416,12 @@ often the integration of the message generation into the build system of your
project. Next, you can find an example of a publisher and subscriber using a
custom Protobuf message integrated with CMake.

Download the [publisher_custom_msg.cc](https://github.com/gazebosim/gz-transport/raw/gz-transport14/example/publisher_custom_msg.cc)
and the [subscriber_custom_msg.cc](https://github.com/gazebosim/gz-transport/raw/gz-transport14/example/subscriber_custom_msg.cc)
Download the [publisher_custom_msg.cc](https://github.com/gazebosim/gz-transport/raw/main/example/publisher_custom_msg.cc)
and the [subscriber_custom_msg.cc](https://github.com/gazebosim/gz-transport/raw/main/example/subscriber_custom_msg.cc)
files within the `gz_transport_tutorial`. Then, create a `msgs` folder and
download the [stringmsg.proto](https://github.com/gazebosim/gz-transport/raw/gz-transport14/example/msgs/stringmsg.proto)
and the [CMakeLists.txt](https://github.com/gazebosim/gz-transport/raw/gz-transport14/example/msgs/CMakeLists.txt)
files within the `msgs` folder. Finally, we'll need the main [CMakeLists.txt](https://github.com/gazebosim/gz-transport/raw/gz-transport14/example/CMakeLists.txt)
download the [stringmsg.proto](https://github.com/gazebosim/gz-transport/raw/main/example/msgs/stringmsg.proto)
and the [CMakeLists.txt](https://github.com/gazebosim/gz-transport/raw/main/example/msgs/CMakeLists.txt)
files within the `msgs` folder. Finally, we'll need the main [CMakeLists.txt](https://github.com/gazebosim/gz-transport/raw/main/example/CMakeLists.txt)
file. You should have this file from the previous examples. Otherwise,
download and place it within the `gz_transport_tutorial` folder.

Expand Down
20 changes: 10 additions & 10 deletions tutorials/05_services.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ cd ~/gz_transport_tutorial

## Responser

Download the [responser.cc](https://github.com/gazebosim/gz-transport/raw/gz-transport14/example/responser.cc) file within the ``gz_transport_tutorial``
Download the [responser.cc](https://github.com/gazebosim/gz-transport/raw/main/example/responser.cc) file within the ``gz_transport_tutorial``
folder and open it with your favorite editor:

```{.cpp}
Expand Down Expand Up @@ -133,7 +133,7 @@ until you hit *CTRL-C*. Note that this function captures the *SIGINT* and

## Synchronous requester

Download the [requester.cc](https://github.com/gazebosim/gz-transport/raw/gz-transport14/example/requester.cc) file within the ``gz_transport_tutorial``
Download the [requester.cc](https://github.com/gazebosim/gz-transport/raw/main/example/requester.cc) file within the ``gz_transport_tutorial``
folder and open it with your favorite editor:

```{.cpp}
Expand Down Expand Up @@ -228,7 +228,7 @@ message.

## Asynchronous requester

Download the [requester_async.cc](https://github.com/gazebosim/gz-transport/raw/gz-transport14/example/requester_async.cc) file within the
Download the [requester_async.cc](https://github.com/gazebosim/gz-transport/raw/main/example/requester_async.cc) file within the
``gz_transport_tutorial`` folder and open it with your favorite editor:

```{.cpp}
Expand Down Expand Up @@ -314,7 +314,7 @@ oneway service to process service requests without sending back responses.
Oneway services don't accept any output parameters nor the requests have to wait
for the response.

Download the [responser_oneway.cc](https://github.com/gazebosim/gz-transport/raw/gz-transport14/example/responser_oneway.cc) file within the
Download the [responser_oneway.cc](https://github.com/gazebosim/gz-transport/raw/main/example/responser_oneway.cc) file within the
``gz_transport_tutorial`` folder and open it with your favorite editor:

```{.cpp}
Expand Down Expand Up @@ -389,7 +389,7 @@ This case is similar to the oneway service provider. This code can be used for
requesting a service that does not need a response back. We don't need any
output parameters in this case nor we have to wait for the response.

Download the [requester_oneway.cc](https://github.com/gazebosim/gz-transport/raw/gz-transport14/example/requester_oneway.cc) file within the
Download the [requester_oneway.cc](https://github.com/gazebosim/gz-transport/raw/main/example/requester_oneway.cc) file within the
``gz_transport_tutorial`` folder and open it with your favorite editor:

```{.cpp}
Expand Down Expand Up @@ -454,7 +454,7 @@ request was already published.
Sometimes we want to receive some result but don't have any input parameter to
send.

Download the [responser_no_input.cc](https://github.com/gazebosim/gz-transport/raw/gz-transport14/example/responser_no_input.cc)
Download the [responser_no_input.cc](https://github.com/gazebosim/gz-transport/raw/main/example/responser_no_input.cc)
file within the ``gz_transport_tutorial`` folder and open it with your
favorite editor:

Expand Down Expand Up @@ -534,7 +534,7 @@ service requests.
This case is similar to the service without input parameter. We don't send any
request.

Download the [requester_no_input.cc](https://github.com/gazebosim/gz-transport/raw/gz-transport14/example/requester_no_input.cc)
Download the [requester_no_input.cc](https://github.com/gazebosim/gz-transport/raw/main/example/requester_no_input.cc)
file within the ``gz_transport_tutorial`` folder and open it with your
favorite editor:

Expand Down Expand Up @@ -577,14 +577,14 @@ request timed out or reached the service provider and ``result`` shows if the
service was successfully executed.

We also have the async version for service request without input. You should
download [requester_async_no_input.cc](https://github.com/gazebosim/gz-transport/raw/gz-transport14/example/requester_async_no_input.cc)
download [requester_async_no_input.cc](https://github.com/gazebosim/gz-transport/raw/main/example/requester_async_no_input.cc)
file within the ``gz_transport_tutorial`` folder.

## Building the code

Download the [CMakeLists.txt](https://github.com/gazebosim/gz-transport/raw/gz-transport14/example/CMakeLists.txt) file
Download the [CMakeLists.txt](https://github.com/gazebosim/gz-transport/raw/main/example/CMakeLists.txt) file
within the ``gz_transport_tutorial`` folder. Then, create a `msgs` directory
and download [CMakeLists.txt](https://github.com/gazebosim/gz-transport/raw/gz-transport14/example/msgs/CMakeLists.txt) and [stringmsg.proto](https://github.com/gazebosim/gz-transport/raw/gz-transport14/example/msgs/stringmsg.proto) inside the
and download [CMakeLists.txt](https://github.com/gazebosim/gz-transport/raw/main/example/msgs/CMakeLists.txt) and [stringmsg.proto](https://github.com/gazebosim/gz-transport/raw/main/example/msgs/stringmsg.proto) inside the
``msgs`` directory.

Once you have all your files, go ahead and create a ``build/`` folder within
Expand Down
32 changes: 16 additions & 16 deletions tutorials/06_python_support.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ In this tutorial, we are going to show the functionalities implemented in Python
These features are brought up by creating bindings from the C++ implementation
using pybind11. It is important to note that not all of C++ features are available
yet, on this tutorial we will go over the most relevant features. For more information,
refer to the [__init__.py](https://github.com/gazebosim/gz-transport/blob/gz-transport14/python/src/__init__.py)
refer to the [__init__.py](https://github.com/gazebosim/gz-transport/blob/main/python/src/__init__.py)
file which is a wrapper for all the bindings.

For this tutorial, we will create two nodes that communicate via messages. One node
Expand All @@ -24,7 +24,7 @@ cd ~/gz_transport_tutorial

## Publisher

Download the [publisher.py](https://github.com/gazebosim/gz-transport/blob/gz-transport14/python/examples/publisher.py) file within the `gz_transport_tutorial`
Download the [publisher.py](https://github.com/gazebosim/gz-transport/blob/main/python/examples/publisher.py) file within the `gz_transport_tutorial`
folder and open it with your favorite editor:

\snippet python/examples/publisher.py complete
Expand All @@ -34,10 +34,10 @@ folder and open it with your favorite editor:
```{.py}
from gz.msgs11.stringmsg_pb2 import StringMsg
from gz.msgs11.vector3d_pb2 import Vector3d
from gz.transport14 import Node
from gz.transport15 import Node
```

The library `gz.transport14` contains all the Gazebo Transport elements that can be
The library `gz.transport15` contains all the Gazebo Transport elements that can be
used in Python. The final API we will use is contained inside the class `Node`.

The lines `from gz.msgs11.stringmsg_pb2 import StringMsg` and `from gz.msgs11.vector3d_pb2 import Vector3d`
Expand Down Expand Up @@ -89,7 +89,7 @@ each topic. The method *publish()* sends a message to all the subscribers.

## Subscriber

Download the [subscriber.py](https://github.com/gazebosim/gz-transport/blob/gz-transport14/python/examples/subscriber.py)
Download the [subscriber.py](https://github.com/gazebosim/gz-transport/blob/main/python/examples/subscriber.py)
file into the `gz_transport_tutorial` folder and open it with your favorite editor:

\snippet python/examples/subscriber.py complete
Expand All @@ -99,10 +99,10 @@ file into the `gz_transport_tutorial` folder and open it with your favorite edit
```{.py}
from gz.msgs11.stringmsg_pb2 import StringMsg
from gz.msgs11.vector3d_pb2 import Vector3d
from gz.transport14 import Node
from gz.transport15 import Node
```

Just as before, we are importing the `Node` class from the `gz.transport14` library
Just as before, we are importing the `Node` class from the `gz.transport15` library
and the generated code for the `StringMsg` and `Vector3d` protobuf messages.

```{.py}
Expand Down Expand Up @@ -240,9 +240,9 @@ in several places (publisher and subscribers).

We developed a couple of examples that demonstrate this particular issue. Take
a look at a publisher and subscriber (whithin the same node) that have race
conditions triggered in the [data_race_without_mutex.py](https://github.com/gazebosim/gz-transport/blob/gz-transport14/python/examples/data_race_without_mutex.py) file. The proposed solution to this
conditions triggered in the [data_race_without_mutex.py](https://github.com/gazebosim/gz-transport/blob/main/python/examples/data_race_without_mutex.py) file. The proposed solution to this
issue is to use the `threading` library, you can see the same example with a mutex
in the [data_race_with_mutex.py](https://github.com/gazebosim/gz-transport/blob/gz-transport14/python/examples/data_race_with_mutex.py) file.
in the [data_race_with_mutex.py](https://github.com/gazebosim/gz-transport/blob/main/python/examples/data_race_with_mutex.py) file.

You can run any of those examples by just doing the following in a terminal:
```{.sh}
Expand All @@ -266,7 +266,7 @@ We can declare the throttling option using the following code :

```{.py}
from gz.msgs11.stringmsg_pb2 import StringMsg
from gz.transport14 import Node, AdvertiseMessageOptions
from gz.transport15 import Node, AdvertiseMessageOptions

# Create a transport node and advertise a topic with throttling enabled.
node = Node()
Expand Down Expand Up @@ -310,7 +310,7 @@ We can declare the throttling option using the following code :

```{.py}
from gz.msgs11.stringmsg_pb2 import StringMsg
from gz.transport14 import Node, SubscribeOptions
from gz.transport15 import Node, SubscribeOptions

def stringmsg_cb(msg: StringMsg):
print("Received StringMsg: [{}]".format(msg.data))
Expand Down Expand Up @@ -350,7 +350,7 @@ topic without having to modify the publisher and create a new log.
We can declare the topic remapping option using the following code:

```{.py}
from gz.transport14 import Node, NodeOptions
from gz.transport15 import Node, NodeOptions

# Create a transport node and remap a topic.
nodeOpts = NodeOptions()
Expand Down Expand Up @@ -380,7 +380,7 @@ The command `gz log playback` also supports the notion of topic remapping. Run

## Service Requester

Download the [requester.py](https://github.com/gazebosim/gz-transport/blob/gz-transport14/python/examples/requester.py)
Download the [requester.py](https://github.com/gazebosim/gz-transport/blob/main/python/examples/requester.py)
file into the `gz_transport_tutorial` folder and open it with your favorite editor:

\snippet python/examples/requester.py complete
Expand All @@ -389,10 +389,10 @@ file into the `gz_transport_tutorial` folder and open it with your favorite edit

```{.py}
from gz.msgs11.stringmsg_pb2 import StringMsg
from gz.transport14 import Node
from gz.transport15 import Node
```

Just as before, we are importing the `Node` class from the `gz.transport14`
Just as before, we are importing the `Node` class from the `gz.transport15`
library and the generated code for the `StringMsg` protobuf message.

```{.py}
Expand Down Expand Up @@ -421,7 +421,7 @@ result and response of the request in some variables and printing them out.

Unfortunately, this feature is not available on Python at the moment. However,
we can use a service responser created in C++ and make a request to it from a
code in Python. Taking that into account, we will use the [response.cc](https://github.com/gazebosim/gz-transport/blob/gz-transport14/example/responser.cc) file as the service responser.
code in Python. Taking that into account, we will use the [response.cc](https://github.com/gazebosim/gz-transport/blob/main/example/responser.cc) file as the service responser.

## Running the examples

Expand Down
6 changes: 3 additions & 3 deletions tutorials/08_relay.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ install Docker following any of the existing guides available
([here](https://docs.docker.com/get-docker/)'s one).

We're going to build a Docker image and run it inside your host computer.
Download the [build.bash](https://github.com/gazebosim/gz-transport/raw/gz-transport14/docker/build.bash), [run.bash](https://github.com/gazebosim/gz-transport/raw/gz-transport14/docker/run.bash) and
[Dockerfile](https://github.com/gazebosim/gz-transport/raw/gz-transport14/docker/gz-transport/Dockerfile) files.
Download the [build.bash](https://github.com/gazebosim/gz-transport/raw/main/docker/build.bash), [run.bash](https://github.com/gazebosim/gz-transport/raw/main/docker/run.bash) and
[Dockerfile](https://github.com/gazebosim/gz-transport/raw/main/docker/gz-transport/Dockerfile) files.

```{.sh}
wget https://github.com/gazebosim/gz-transport/raw/gz-transport14/docker/gz-transport/Dockerfile -O Dockerfile
wget https://github.com/gazebosim/gz-transport/raw/main/docker/gz-transport/Dockerfile -O Dockerfile
```

Now, it's time to build the Docker image:
Expand Down
Loading