From 6f2f1eb715216fec1c2068a5375515266c418aa1 Mon Sep 17 00:00:00 2001 From: Martin Pecka Date: Sun, 3 Sep 2023 04:07:34 +0200 Subject: [PATCH 1/8] Improve Windows Installation instructions Signed-off-by: Martin Pecka Signed-off-by: Martin Pecka --- harmonic/install_windows_src.md | 50 +++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/harmonic/install_windows_src.md b/harmonic/install_windows_src.md index a9ae22cb7..e54bc73dc 100644 --- a/harmonic/install_windows_src.md +++ b/harmonic/install_windows_src.md @@ -41,12 +41,20 @@ You will still be able to use `TPE` as a physics engine conda activate gz-ws ``` - Once you have activate an environment, a prefix like `(gz-ws)` will be prepended to + Once you have activated an environment, a prefix like `(gz-ws)` will be prepended to your prompt, and you can use the `conda` command outside of the `condabin` directory. You can use `conda info --envs` to see all of your environments. - To remove an environment, use `conda env remove --name `. + To remove an environment, use `conda remove --all --name `. + + > [!NOTE] + > This way of Conda environment creation puts it into a default folder. If you need + to install it elsewhere, use `--prefix ` instead of `--name `. + Environments in custom paths cannot be referenced by names, so even `conda activate` + needs to be passed a path (relative or absolute) instead of the name. If you refer + to a subdirectory of the current directory, you have to prepend `.\` so that Conda + knows it is a path and not a name. 5. Install dependencies: @@ -58,6 +66,8 @@ You will still be able to use `TPE` as a physics engine libzip qt pybind11 --channel conda-forge ``` + This can take tens of minutes. + 6. Navigate to where you would like to build the library, create and enter your workspace directory, create the `src` directory which will contain the Gazebo source code. ```bash @@ -117,7 +127,7 @@ If there are no errors, all the binaries should be ready to use. ## Using the workspace -The workspace needs to be sourced every time a new terminal is used. +The workspace needs to be sourced every time a new terminal is used (and Conda activated before that). Run the following command to source the workspace: @@ -132,6 +142,32 @@ call install\setup.bat This is the end of the source install instructions; head back to the [Getting started](/docs/all/getstarted) page to start using Gazebo! +> [!WARNING] +> Please note that currently, no executables for Gazebo are built on Windows. + This means there is no .exe file you could run. As a temporary workaround, + you may launch Gazebo server like this: + +```cmd +ruby -r %cd%/install/lib/ruby/gz/cmdsim8.rb -e 'c = Cmd.new()' -e "c.execute(['-s', '--verbose'])" +``` + +If you username contains spaces (which is quite common on Windows), you will probably get errors +saying `Invalid partition name [Computer:My User With Spaces]`. Fix this by changing `GZ_PARTITION` +to something else: + +```cmd +set GZ_PARTITION=test +``` + +Remember to set the same partition in all other consoles. + +To echo a topic, similar workaround can be used from another console (with Conda activated and +sourced install space): + +```cmd +ruby -r %cd%/install/lib/ruby/gz/cmdtransport13.rb -e 'c = Cmd.new()' -e "c.execute(['topic', '-l'])" +``` + ## Uninstalling source-based install A source-based install can be "uninstalled" using several methods, depending on @@ -153,6 +189,14 @@ the results you want: 3. If you want to keep the source code, you can remove the `install` / `build` / `log` directories as desired, leaving the `src` directory. + 4. Last, if you do not need the conda environment anymore, you can remove it with + + ```bash + conda deactivate + conda remove --all --name + # or conda remove --all --prefix if you installed to custom path + ``` + ## Troubleshooting See [Troubleshooting](/docs/harmonic/troubleshooting#windows) From 30fd6a80c4e8c335c7cd5582257e1e2207fe91cc Mon Sep 17 00:00:00 2001 From: Martin Pecka Date: Sun, 3 Sep 2023 05:53:00 +0200 Subject: [PATCH 2/8] Added installation of gz-tools2 to Windows instructions. Signed-off-by: Martin Pecka --- harmonic/install_windows_src.md | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/harmonic/install_windows_src.md b/harmonic/install_windows_src.md index e54bc73dc..ad331b7d1 100644 --- a/harmonic/install_windows_src.md +++ b/harmonic/install_windows_src.md @@ -4,13 +4,14 @@ WARNING: Current Windows support is experimental. # Source Installation on Windows 10 or 11 -Command line tools, DART physics engine, and GUI capabilities are +DART physics engine and GUI capabilities are not currently supported in Windows. These functionalities correspond to the currently -building packages `gz-tools`, `gz-physics`, and `gz-gui`, respectively. +building packages `gz-physics` and `gz-gui`, respectively. The packages will build, +but you can expect runtime failures when using their functionalities. **Note** -You will still be able to use `TPE` as a physics engine +You should be able to use `TPE` as a physics engine without any issues (see [here](https://gazebosim.org/api/physics/2.2/physicsplugin.html) for more information on `TPE`). ## Install dependencies @@ -102,13 +103,10 @@ colcon graph If that is the case, then you are ready to build the whole set of libraries: ```bash -colcon build --cmake-args -DBUILD_TESTING=OFF --merge-install --packages-up-to gz-sim8 +colcon build --cmake-args -DBUILD_TESTING=OFF --merge-install --packages-up-to gz-sim8 gz-tools2 ``` Tests are turned off as they are not currently supported on Windows. -**Note:** All of the Gazebo packages up to, but not including `gz-sim` -are currently building. The above command should successfully build all packages except for `gz-sim`. - To build a specific package with all its dependent packages: ```bash @@ -143,17 +141,16 @@ This is the end of the source install instructions; head back to the [Getting st page to start using Gazebo! > [!WARNING] -> Please note that currently, no executables for Gazebo are built on Windows. - This means there is no .exe file you could run. As a temporary workaround, - you may launch Gazebo server like this: +> As Gazebo GUI is not yet working, running `gz sim` will not work. You can run only the server with ```cmd -ruby -r %cd%/install/lib/ruby/gz/cmdsim8.rb -e 'c = Cmd.new()' -e "c.execute(['-s', '--verbose'])" +gz sim -s -v ``` -If you username contains spaces (which is quite common on Windows), you will probably get errors -saying `Invalid partition name [Computer:My User With Spaces]`. Fix this by changing `GZ_PARTITION` -to something else: +> [!WARNING] +> If you username contains spaces (which is quite common on Windows), you will probably get errors + saying `Invalid partition name [Computer:My User With Spaces]`. Fix this by changing `GZ_PARTITION` + to something else: ```cmd set GZ_PARTITION=test @@ -161,13 +158,6 @@ set GZ_PARTITION=test Remember to set the same partition in all other consoles. -To echo a topic, similar workaround can be used from another console (with Conda activated and -sourced install space): - -```cmd -ruby -r %cd%/install/lib/ruby/gz/cmdtransport13.rb -e 'c = Cmd.new()' -e "c.execute(['topic', '-l'])" -``` - ## Uninstalling source-based install A source-based install can be "uninstalled" using several methods, depending on From a39f8a0543439951cb8b37dc660b84f67c46f320 Mon Sep 17 00:00:00 2001 From: Martin Pecka Date: Sun, 3 Sep 2023 20:04:49 +0200 Subject: [PATCH 3/8] Update Windows install tutorial Signed-off-by: Martin Pecka --- harmonic/install_windows_src.md | 47 +++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/harmonic/install_windows_src.md b/harmonic/install_windows_src.md index ad331b7d1..de355fba1 100644 --- a/harmonic/install_windows_src.md +++ b/harmonic/install_windows_src.md @@ -4,15 +4,14 @@ WARNING: Current Windows support is experimental. # Source Installation on Windows 10 or 11 -DART physics engine and GUI capabilities are -not currently supported in Windows. These functionalities correspond to the currently -building packages `gz-physics` and `gz-gui`, respectively. The packages will build, +OGRE2 rendering capabilities are not currently supported in Windows, and Gazebo GUI +works in a limited fashion. These functionalities correspond to the currently +building packages `gz-rendering` and `gz-sim`, respectively. The packages will build, but you can expect runtime failures when using their functionalities. -**Note** - -You should be able to use `TPE` as a physics engine without any issues -(see [here](https://gazebosim.org/api/physics/2.2/physicsplugin.html) for more information on `TPE`). +> [!NOTE] +> You should be able to use `ogre` as a rendering engine instead of the default `ogre2`. +> Just append `--render-engine ogre` to the command line. ## Install dependencies @@ -21,14 +20,17 @@ You should be able to use `TPE` as a physics engine without any issues You will likely want to check the box to add `conda` to your `PATH` during the installation process so that you won't have to do this step manually. -2. Install [Visual Studio 2019](https://visualstudio.microsoft.com/downloads/). +2. Install [Visual Studio 2019 or 2022](https://visualstudio.microsoft.com/downloads/). The Community version is free for students, open-source developers, and personal development. Check "Desktop development with C++" in the Workloads tab, check "MFC and ATL support", and uncheck "C++ Cmake Tools." We will install - cmake via Conda. + cmake via Conda. All other checkboxes can be left unchecked. + It is recommended to choose the Visual Studio version based on + the supported versions for your ROS distribution if you plan to use Gazebo with + ROS. -3. Open a Visual Studio Command Prompt (search for "x64 Native Tools Command Prompt - for VS 2019" in the Windows search field near the Windows button). Optionally, +4. Open a Visual Studio Command Prompt (search for "x64 Native Tools Command Prompt + for VS" in the Windows search field near the Windows button). Optionally, right-click and pin to the task bar for quick access in the future. If you did not add Conda to your `PATH` environment variable during Conda installation, @@ -47,6 +49,12 @@ You should be able to use `TPE` as a physics engine without any issues You can use `conda info --envs` to see all of your environments. + To speed up conda installations, also set the following to use libmamba solver. + Older conda installations may need to do [additional steps](https://www.anaconda.com/blog/a-faster-conda-for-a-growing-community). + ```bash + conda config --set solver libmamba + ``` + To remove an environment, use `conda remove --all --name `. > [!NOTE] @@ -63,11 +71,11 @@ You should be able to use `TPE` as a physics engine without any issues conda install cmake git vcstool curl pkg-config ^ colcon-common-extensions dartsim eigen freeimage gdal gts ^ glib dlfcn-win32 ffmpeg ruby tinyxml2 tinyxml ^ - libprotobuf urdfdom zeromq cppzmq ogre ogre-next jsoncpp ^ + libprotobuf urdfdom zeromq cppzmq ogre=1.10 ogre-next jsoncpp ^ libzip qt pybind11 --channel conda-forge ``` - This can take tens of minutes. + This can take tens of minutes (or less when using libmamba solver). 6. Navigate to where you would like to build the library, create and enter your workspace directory, create the `src` directory which will contain the Gazebo source code. @@ -125,7 +133,8 @@ If there are no errors, all the binaries should be ready to use. ## Using the workspace -The workspace needs to be sourced every time a new terminal is used (and Conda activated before that). +The workspace needs to be sourced every time a new terminal is used ( +and Conda environment activated before that). Run the following command to source the workspace: @@ -158,6 +167,16 @@ set GZ_PARTITION=test Remember to set the same partition in all other consoles. +### Gazebo GUI workaround + +Although running `gz sim` without arguments is not supported on Windows, +and `gz sim -g` is also not supported, there is a workaround you can apply +to be able to launch `gz sim -g` on Windows. + +> Manually comment [these lines](https://github.com/gazebosim/gz-sim/blob/gz-sim7_7.5.0/src/cmd/cmdsim.rb.in#L497-L501) and [these lines](https://github.com/gazebosim/gz-sim/blob/gz-sim7_7.5.0/src/cmd/cmdsim.rb.in#L558-L562) in file install\lib\ruby\gz\cmdsim8.rb . + +This should allow you to run the GUI in a separate console, connecting to the server running in another console. + ## Uninstalling source-based install A source-based install can be "uninstalled" using several methods, depending on From 8c39de0bed3875bead6149219fb3bef116f26727 Mon Sep 17 00:00:00 2001 From: Martin Pecka Date: Fri, 15 Sep 2023 11:32:07 +0200 Subject: [PATCH 4/8] Removed mention of ROS from Windows install instructions Signed-off-by: Martin Pecka --- harmonic/install_windows_src.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/harmonic/install_windows_src.md b/harmonic/install_windows_src.md index de355fba1..b6ff90c63 100644 --- a/harmonic/install_windows_src.md +++ b/harmonic/install_windows_src.md @@ -25,9 +25,6 @@ but you can expect runtime failures when using their functionalities. development. Check "Desktop development with C++" in the Workloads tab, check "MFC and ATL support", and uncheck "C++ Cmake Tools." We will install cmake via Conda. All other checkboxes can be left unchecked. - It is recommended to choose the Visual Studio version based on - the supported versions for your ROS distribution if you plan to use Gazebo with - ROS. 4. Open a Visual Studio Command Prompt (search for "x64 Native Tools Command Prompt for VS" in the Windows search field near the Windows button). Optionally, From ab0cf9624e43b0b74409c16e63a69c3c2a074aee Mon Sep 17 00:00:00 2001 From: Mabel Zhang Date: Fri, 15 Sep 2023 20:49:10 -0400 Subject: [PATCH 5/8] indent fixes to original page Signed-off-by: Mabel Zhang --- harmonic/install_windows_src.md | 102 +++++++++++++++----------------- 1 file changed, 49 insertions(+), 53 deletions(-) diff --git a/harmonic/install_windows_src.md b/harmonic/install_windows_src.md index b6ff90c63..25ee7ebee 100644 --- a/harmonic/install_windows_src.md +++ b/harmonic/install_windows_src.md @@ -26,72 +26,68 @@ but you can expect runtime failures when using their functionalities. check "MFC and ATL support", and uncheck "C++ Cmake Tools." We will install cmake via Conda. All other checkboxes can be left unchecked. -4. Open a Visual Studio Command Prompt (search for "x64 Native Tools Command Prompt +3. Open a Visual Studio Command Prompt (search for "x64 Native Tools Command Prompt for VS" in the Windows search field near the Windows button). Optionally, right-click and pin to the task bar for quick access in the future. - If you did not add Conda to your `PATH` environment variable during Conda installation, - you may need to navigate to the location of `condabin` in order to use the `conda` command. - To find `condabin`, search for "Anaconda Prompt" in the Windows search field near the - Windows button, open it, run `where conda`, and look for a line containing the directory `condabin`. + If you did not add Conda to your `PATH` environment variable during Conda installation, + you may need to navigate to the location of `condabin` in order to use the `conda` command. + To find `condabin`, search for "Anaconda Prompt" in the Windows search field near the + Windows button, open it, run `where conda`, and look for a line containing the directory `condabin`. 4. Navigate to your `condabin`, if necessary, and then create and activate a Conda environment: - ```bash - conda create -n gz-ws - conda activate gz-ws - ``` - - Once you have activated an environment, a prefix like `(gz-ws)` will be prepended to - your prompt, and you can use the `conda` command outside of the `condabin` directory. - - You can use `conda info --envs` to see all of your environments. - - To speed up conda installations, also set the following to use libmamba solver. - Older conda installations may need to do [additional steps](https://www.anaconda.com/blog/a-faster-conda-for-a-growing-community). - ```bash - conda config --set solver libmamba - ``` - - To remove an environment, use `conda remove --all --name `. - - > [!NOTE] - > This way of Conda environment creation puts it into a default folder. If you need - to install it elsewhere, use `--prefix ` instead of `--name `. - Environments in custom paths cannot be referenced by names, so even `conda activate` - needs to be passed a path (relative or absolute) instead of the name. If you refer - to a subdirectory of the current directory, you have to prepend `.\` so that Conda - knows it is a path and not a name. + ```bash + conda create -n gz-ws + conda activate gz-ws + ``` + Once you have activated an environment, a prefix like `(gz-ws)` will be prepended to + your prompt, and you can use the `conda` command outside of the `condabin` directory. + + You can use `conda info --envs` to see all of your environments. + + To speed up conda installations, also set the following to use libmamba solver. + Older conda installations may need to do [additional steps](https://www.anaconda.com/blog/a-faster-conda-for-a-growing-community). + ```bash + conda config --set solver libmamba + ``` + To remove an environment, use `conda remove --all --name `. + + > [!NOTE] + > This way of Conda environment creation puts it into a default folder. If you need + to install it elsewhere, use `--prefix ` instead of `--name `. + Environments in custom paths cannot be referenced by names, so even `conda activate` + needs to be passed a path (relative or absolute) instead of the name. If you refer + to a subdirectory of the current directory, you have to prepend `.\` so that Conda + knows it is a path and not a name. 5. Install dependencies: - - ```bash - conda install cmake git vcstool curl pkg-config ^ - colcon-common-extensions dartsim eigen freeimage gdal gts ^ - glib dlfcn-win32 ffmpeg ruby tinyxml2 tinyxml ^ - libprotobuf urdfdom zeromq cppzmq ogre=1.10 ogre-next jsoncpp ^ - libzip qt pybind11 --channel conda-forge - ``` - + ```bash + conda install cmake git vcstool curl pkg-config ^ + colcon-common-extensions dartsim eigen freeimage gdal gts ^ + glib dlfcn-win32 ffmpeg ruby tinyxml2 tinyxml ^ + libprotobuf urdfdom zeromq cppzmq ogre=1.10 ogre-next jsoncpp ^ + libzip qt pybind11 --channel conda-forge + ``` This can take tens of minutes (or less when using libmamba solver). 6. Navigate to where you would like to build the library, create and enter your workspace directory, create the `src` directory which will contain the Gazebo source code. - ```bash - mkdir gz-ws - cd gz-ws - mkdir src - ``` + ```bash + mkdir gz-ws + cd gz-ws + mkdir src + ``` 7. Then clone the repositories - ```bash - # CMD - curl -sk https://raw.githubusercontent.com/gazebo-tooling/gazebodistro/master/collection-harmonic.yaml -o collection-harmonic - vcs import src < collection-harmonic + ```bash + # CMD + curl -sk https://raw.githubusercontent.com/gazebo-tooling/gazebodistro/master/collection-harmonic.yaml -o collection-harmonic + vcs import src < collection-harmonic - # PowerShell - curl https://raw.githubusercontent.com/gazebo-tooling/gazebodistro/master/collection-harmonic.yaml -o collection-harmonic - vcs import --input collection-harmonic src - ``` + # PowerShell + curl https://raw.githubusercontent.com/gazebo-tooling/gazebodistro/master/collection-harmonic.yaml -o collection-harmonic + vcs import --input collection-harmonic src + ``` ## Building the Gazebo Libraries @@ -170,7 +166,7 @@ Although running `gz sim` without arguments is not supported on Windows, and `gz sim -g` is also not supported, there is a workaround you can apply to be able to launch `gz sim -g` on Windows. -> Manually comment [these lines](https://github.com/gazebosim/gz-sim/blob/gz-sim7_7.5.0/src/cmd/cmdsim.rb.in#L497-L501) and [these lines](https://github.com/gazebosim/gz-sim/blob/gz-sim7_7.5.0/src/cmd/cmdsim.rb.in#L558-L562) in file install\lib\ruby\gz\cmdsim8.rb . +> Manually comment [these lines](https://github.com/gazebosim/gz-sim/blob/gz-sim7_7.5.0/src/cmd/cmdsim.rb.in#L497-L501) and [these lines](https://github.com/gazebosim/gz-sim/blob/gz-sim7_7.5.0/src/cmd/cmdsim.rb.in#L558-L562) in file `install\lib\ruby\gz\cmdsim8.rb`. This should allow you to run the GUI in a separate console, connecting to the server running in another console. From 295b30021fe7c9c8574889bf491b347c03c1035e Mon Sep 17 00:00:00 2001 From: Mabel Zhang Date: Fri, 15 Sep 2023 21:23:18 -0400 Subject: [PATCH 6/8] more indent Signed-off-by: Mabel Zhang --- harmonic/install_windows_src.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/harmonic/install_windows_src.md b/harmonic/install_windows_src.md index 25ee7ebee..858d92e4c 100644 --- a/harmonic/install_windows_src.md +++ b/harmonic/install_windows_src.md @@ -135,7 +135,7 @@ Run the following command to source the workspace: # CMD call install\setup.bat -#PowerShell +# PowerShell .\install\setup.ps1 ``` From 2b49a53e86d7f0186c46d6738482729a89c1ece0 Mon Sep 17 00:00:00 2001 From: Martin Pecka Date: Sat, 16 Sep 2023 10:17:18 +0200 Subject: [PATCH 7/8] Apply suggestions from code review Co-authored-by: Mabel Zhang Signed-off-by: Martin Pecka --- harmonic/install_windows_src.md | 35 +++++++++++++++------------------ 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/harmonic/install_windows_src.md b/harmonic/install_windows_src.md index 858d92e4c..fb07a9de6 100644 --- a/harmonic/install_windows_src.md +++ b/harmonic/install_windows_src.md @@ -9,7 +9,7 @@ works in a limited fashion. These functionalities correspond to the currently building packages `gz-rendering` and `gz-sim`, respectively. The packages will build, but you can expect runtime failures when using their functionalities. -> [!NOTE] +> **NOTE** > You should be able to use `ogre` as a rendering engine instead of the default `ogre2`. > Just append `--render-engine ogre` to the command line. @@ -52,7 +52,7 @@ but you can expect runtime failures when using their functionalities. ``` To remove an environment, use `conda remove --all --name `. - > [!NOTE] + > **NOTE** > This way of Conda environment creation puts it into a default folder. If you need to install it elsewhere, use `--prefix ` instead of `--name `. Environments in custom paths cannot be referenced by names, so even `conda activate` @@ -68,7 +68,7 @@ but you can expect runtime failures when using their functionalities. libprotobuf urdfdom zeromq cppzmq ogre=1.10 ogre-next jsoncpp ^ libzip qt pybind11 --channel conda-forge ``` - This can take tens of minutes (or less when using libmamba solver). + This can take tens of minutes (or less when using libmamba solver). 6. Navigate to where you would like to build the library, create and enter your workspace directory, create the `src` directory which will contain the Gazebo source code. @@ -142,23 +142,20 @@ call install\setup.bat This is the end of the source install instructions; head back to the [Getting started](/docs/all/getstarted) page to start using Gazebo! -> [!WARNING] +> **WARNING** > As Gazebo GUI is not yet working, running `gz sim` will not work. You can run only the server with - -```cmd -gz sim -s -v -``` - -> [!WARNING] -> If you username contains spaces (which is quite common on Windows), you will probably get errors - saying `Invalid partition name [Computer:My User With Spaces]`. Fix this by changing `GZ_PARTITION` - to something else: - -```cmd -set GZ_PARTITION=test -``` - -Remember to set the same partition in all other consoles. +> ```cmd +> gz sim -s -v +> ``` + +> **WARNING** +> If your username contains spaces (which is quite common on Windows), you will probably get errors +> saying `Invalid partition name [Computer:My User With Spaces]`. Fix this by changing `GZ_PARTITION` +> to something else: +> ```cmd +> set GZ_PARTITION=test +> ``` +> Remember to set the same partition in all other consoles. ### Gazebo GUI workaround From 6b368092aeade6557930cea1419f22510931a680 Mon Sep 17 00:00:00 2001 From: Martin Pecka Date: Sat, 16 Sep 2023 10:19:02 +0200 Subject: [PATCH 8/8] Turned some WARNINGs into NOTEs. Signed-off-by: Martin Pecka --- harmonic/install_windows_src.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/harmonic/install_windows_src.md b/harmonic/install_windows_src.md index fb07a9de6..59e28efec 100644 --- a/harmonic/install_windows_src.md +++ b/harmonic/install_windows_src.md @@ -142,13 +142,13 @@ call install\setup.bat This is the end of the source install instructions; head back to the [Getting started](/docs/all/getstarted) page to start using Gazebo! -> **WARNING** +> **NOTE** > As Gazebo GUI is not yet working, running `gz sim` will not work. You can run only the server with > ```cmd > gz sim -s -v > ``` -> **WARNING** +> **NOTE** > If your username contains spaces (which is quite common on Windows), you will probably get errors > saying `Invalid partition name [Computer:My User With Spaces]`. Fix this by changing `GZ_PARTITION` > to something else: