Skip to content

Commit

Permalink
Merge branch 'gz-transport14' into jrivero/t14_statistic_win
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
  • Loading branch information
j-rivero committed Sep 26, 2024
2 parents cf8d745 + 8e27a44 commit 490975b
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 22 deletions.
4 changes: 2 additions & 2 deletions tutorials/02_installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ sudo make uninstall

### Prerequisites

First, follow the [gz-cmake](https://github.com/gazebosim/gz-cmake) tutorial for installing Conda, Visual Studio, CMake, etc., prerequisites, and creating a Conda environment.
First, follow the [source installation](https://gazebosim.org/docs/ionic/install_windows_src/) tutorial until step 5 included for installing Conda, Visual Studio, CMake, etc., prerequisites, and creating a Conda environment.

Navigate to `condabin` if necessary to use the `conda` command (i.e., if Conda is not in your `PATH` environment variable. You can find the location of `condabin` in Anaconda Prompt, `where conda`).

Expand Down Expand Up @@ -266,7 +266,7 @@ conda install libgz-cmake<#> libgz-msgs<#> libgz-tools<#> --channel conda-forge
cmake --build . --config Release
```

Try an example
Try an example (in the Release directory)
```bash
responser
```
Expand Down
14 changes: 14 additions & 0 deletions tutorials/04_messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,20 @@ cmake --build . --config Release

## Running the examples

> **NOTE**
> It is essential to have a valid value of `GZ_PARTITION` environment variable
> and to have it set to the same value in all open terminals. As `GZ_PARTITION`
> is based on hostname and username, especially Windows and Mac users might
> have problems due to spaces in their username, which are not a valid character
> in `GZ_PARTITION`. gz-transport prints error `Invalid partition name` in such
> case. To resolve that, set `GZ_PARTITION` explicitly to a valid value:
> ```bash
> # Linux and Mac
> export GZ_PARTITION=test
> # Windows
> set GZ_PARTITION=test
> ```
Open two new terminals and from your `build/` directory run the executables.
From terminal 1:
Expand Down
31 changes: 23 additions & 8 deletions tutorials/05_services.md
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,25 @@ cmake --build . --config Release

## Running the examples

> **NOTE**
> It is essential to have a valid value of `GZ_PARTITION` environment variable
> and to have it set to the same value in all open terminals. As `GZ_PARTITION`
> is based on hostname and username, especially Windows and Mac users might
> have problems due to spaces in their username, which are not a valid character
> in `GZ_PARTITION`. gz-transport prints error `Invalid partition name` in such
> case. To resolve that, set `GZ_PARTITION` explicitly to a valid value:
> ```bash
> # Linux and Mac
> export GZ_PARTITION=test
> # Windows
> set GZ_PARTITION=test
> ```
> **NOTE**
> On Windows, you can see firewall or antivirus prompts when running the examples.
> For them to work properly, you should allow all communication to the
> example programs.
Open three new terminals and from your ``build/`` directory run the executables.
From terminal 1:
Expand Down Expand Up @@ -661,7 +680,11 @@ directory run the executables.
From terminal 1:

```{.sh}
# Linux and MacOS
./responser_oneway
# Windows
.\Release\responser_oneway.exe
```

From terminal 2:
Expand All @@ -678,11 +701,7 @@ In your responser terminal, you should expect an output similar to this one,
showing that your service provider has received a request:

```{.sh}
# Linux and MacOS
./responser_oneway
# Windows
.\Release\responser_oneway.exe
Request received: [HELLO]
```

Expand Down Expand Up @@ -723,12 +742,8 @@ In your requesters' terminals, you should expect an output similar to this one,
showing that you have received a response:

```{.sh}
# Linux and MacOS
./requester_no_input
# Windows
.\Release\requester_no_input.exe
Press <CTRL-C> to exit
Response: [This is it! This is the answer. It says here...that a bolt of
lightning is going to strike the clock tower at precisely 10:04pm, next
Expand Down
16 changes: 15 additions & 1 deletion tutorials/06_python_support.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,20 @@ export PYTHONPATH=$PYTHONPATH:<path_install_prefix>/lib/python

## Running the examples

> **NOTE**
> It is essential to have a valid value of `GZ_PARTITION` environment variable
> and to have it set to the same value in all open terminals. As `GZ_PARTITION`
> is based on hostname and username, especially Windows and Mac users might
> have problems due to spaces in their username, which are not a valid character
> in `GZ_PARTITION`. gz-transport prints error `Invalid partition name` in such
> case. To resolve that, set `GZ_PARTITION` explicitly to a valid value:
> ```bash
> # Linux and Mac
> export GZ_PARTITION=test
> # Windows
> set GZ_PARTITION=test
> ```
Open two new terminals and directly run the Python scripts downloaded previously.
From terminal 1:
Expand Down Expand Up @@ -340,7 +354,7 @@ We can declare the topic remapping option using the following code:
# Create a transport node and remap a topic.
nodeOpts = NodeOptions()
nodeOpts.add_topic_remap("/foo", "/bar")
nodeOpts.add_topic_remap("/example_stringmsg_topic", "/bar")
node = Node(nodeOpts)
```

Expand Down
14 changes: 14 additions & 0 deletions tutorials/07_security.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@ password. Also, every subscriber will only connect to secure publishers.

### Example

> **NOTE**
> It is essential to have a valid value of `GZ_PARTITION` environment variable
> and to have it set to the same value in all open terminals. As `GZ_PARTITION`
> is based on hostname and username, especially Windows and Mac users might
> have problems due to spaces in their username, which are not a valid character
> in `GZ_PARTITION`. gz-transport prints error `Invalid partition name` in such
> case. To resolve that, set `GZ_PARTITION` explicitly to a valid value:
> ```bash
> # Linux and Mac
> export GZ_PARTITION=test
> # Windows
> set GZ_PARTITION=test
> ```
First, let's test unsecure communication. This example requires
[gz-tools](https://github.com/gazebosim/gz-tools).
Expand Down
14 changes: 14 additions & 0 deletions tutorials/10_logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,20 @@ cmake --build . --config Release

## Running the examples

> **NOTE**
> It is essential to have a valid value of `GZ_PARTITION` environment variable
> and to have it set to the same value in all open terminals. As `GZ_PARTITION`
> is based on hostname and username, especially Windows and Mac users might
> have problems due to spaces in their username, which are not a valid character
> in `GZ_PARTITION`. gz-transport prints error `Invalid partition name` in such
> case. To resolve that, set `GZ_PARTITION` explicitly to a valid value:
> ```bash
> # Linux and Mac
> export GZ_PARTITION=test
> # Windows
> set GZ_PARTITION=test
> ```
Open two new terminals and from your `build/` directory run the recorder.
From terminal 1:
Expand Down
35 changes: 24 additions & 11 deletions tutorials/23_topic_statistics.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,27 @@ cmake --build build --parallel
cmake --build build --config release --parallel
```

#### Executing on Linux or Mac

1. Terminal 1: `GZ_TRANSPORT_TOPIC_STATISTICS=1 ./example/build/publisher`
1. Terminal 2: `GZ_TRANSPORT_TOPIC_STATISTICS=1 ./example/build/subscriber_stats`
1. Terminal 3: `GZ_TRANSPORT_TOPIC_STATISTICS=1 gz topic -et /statistics`

#### Executing on Windows

1. Terminal 1: `set "GZ_TRANSPORT_TOPIC_STATISTICS=1" && example\build\release\publisher.exe`
1. Terminal 2: `set "GZ_TRANSPORT_TOPIC_STATISTICS=1" && example\build\subscriber_stats.exe`
1. Terminal 3: `set "GZ_TRANSPORT_TOPIC_STATISTICS=1" && gz topic -et /statistics`
#### Executing
> **NOTE**
> It is essential to have a valid value of `GZ_PARTITION` environment variable
> and to have it set to the same value in all open terminals. As `GZ_PARTITION`
> is based on hostname and username, especially Windows and Mac users might
> have problems due to spaces in their username, which are not a valid character
> in `GZ_PARTITION`. gz-transport prints error `Invalid partition name` in such
> case. To resolve that, set `GZ_PARTITION` explicitly to a valid value.
If you have the Gazebo Transport sources with the example programs built,
then you can test topic statistics by following these steps depending on the
platform:

##### Linux or Mac

1. Terminal 1: `GZ_PARTITION=test GZ_TRANSPORT_TOPIC_STATISTICS=1 ./example/build/publisher`
1. Terminal 2: `GZ_PARTITION=test GZ_TRANSPORT_TOPIC_STATISTICS=1 ./example/build/subscriber_stats`
1. Terminal 3: `GZ_PARTITION=test GZ_TRANSPORT_TOPIC_STATISTICS=1 gz topic -et /statistics`

##### Windows

1. Terminal 1: `set "GZ_PARTITION=test" && set "GZ_TRANSPORT_TOPIC_STATISTICS=1" && example\build\release\publisher.exe`
1. Terminal 2: `set "GZ_PARTITION=test" && set "GZ_TRANSPORT_TOPIC_STATISTICS=1" && example\build\subscriber_stats.exe`
1. Terminal 3: `set "GZ_PARTITION=test" && set "GZ_TRANSPORT_TOPIC_STATISTICS=1" && gz topic -et /statistics`

0 comments on commit 490975b

Please sign in to comment.