From 8b184b3ca001b67c4854ad8d3dd40f6f47cd29c6 Mon Sep 17 00:00:00 2001 From: Antoine Van Malleghem Date: Fri, 13 Sep 2024 15:41:23 +0200 Subject: [PATCH 1/4] fix prerequisites windows (#534) Signed-off-by: Van Malleghem Antoine --- tutorials/02_installation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tutorials/02_installation.md b/tutorials/02_installation.md index 28931fe9..89207356 100644 --- a/tutorials/02_installation.md +++ b/tutorials/02_installation.md @@ -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`). @@ -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 ``` From c1fc0f560f29c1b520d2955b696afc51d6c415f8 Mon Sep 17 00:00:00 2001 From: Martin Pecka Date: Mon, 16 Sep 2024 10:25:38 +0200 Subject: [PATCH 2/4] tutorials: Added notices about GZ_PARTITION (#537) Signed-off-by: Martin Pecka --- tutorials/04_messages.md | 14 ++++++++++++++ tutorials/06_python_support.md | 14 ++++++++++++++ tutorials/07_security.md | 14 ++++++++++++++ tutorials/10_logging.md | 14 ++++++++++++++ tutorials/23_topic_statistics.md | 14 ++++++++++++++ 5 files changed, 70 insertions(+) diff --git a/tutorials/04_messages.md b/tutorials/04_messages.md index 85bc5ab0..4e6adc7f 100644 --- a/tutorials/04_messages.md +++ b/tutorials/04_messages.md @@ -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: diff --git a/tutorials/06_python_support.md b/tutorials/06_python_support.md index 21b663a8..50cb712f 100644 --- a/tutorials/06_python_support.md +++ b/tutorials/06_python_support.md @@ -177,6 +177,20 @@ export PYTHONPATH=$PYTHONPATH:/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: diff --git a/tutorials/07_security.md b/tutorials/07_security.md index 6ed4829f..98f3d88c 100644 --- a/tutorials/07_security.md +++ b/tutorials/07_security.md @@ -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). diff --git a/tutorials/10_logging.md b/tutorials/10_logging.md index 61a5779d..d969ab12 100644 --- a/tutorials/10_logging.md +++ b/tutorials/10_logging.md @@ -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: diff --git a/tutorials/23_topic_statistics.md b/tutorials/23_topic_statistics.md index 1f24806f..43e6afde 100644 --- a/tutorials/23_topic_statistics.md +++ b/tutorials/23_topic_statistics.md @@ -73,6 +73,20 @@ if (!node.EnableStats(topic, true, "/my_stats", 100)) ### 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 +> ``` + If you have the Gazebo Transport sources with the example programs built, then you can test topic statistics by following these steps. From d7921e4c62c1f8d9c6ed3dc747854f4f95343a9f Mon Sep 17 00:00:00 2001 From: Martin Pecka Date: Mon, 16 Sep 2024 10:25:55 +0200 Subject: [PATCH 3/4] tutorials/06_python_support: Fix tutorial snippet (#539) Signed-off-by: Martin Pecka --- tutorials/06_python_support.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/06_python_support.md b/tutorials/06_python_support.md index 50cb712f..74204c2c 100644 --- a/tutorials/06_python_support.md +++ b/tutorials/06_python_support.md @@ -354,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) ``` From 8e27a443373689cfb026fdf7057d134fc54d4c61 Mon Sep 17 00:00:00 2001 From: Martin Pecka Date: Mon, 16 Sep 2024 23:13:42 +0200 Subject: [PATCH 4/4] tutorials/05_services: Windows improvements (#536) Signed-off-by: Martin Pecka --- tutorials/05_services.md | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/tutorials/05_services.md b/tutorials/05_services.md index 801a8fa8..da4e0e95 100644 --- a/tutorials/05_services.md +++ b/tutorials/05_services.md @@ -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: @@ -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: @@ -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] ``` @@ -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 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