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

Improve Windows Installation instructions #381

Merged
merged 8 commits into from
Sep 19, 2023
Merged
Changes from 2 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
54 changes: 44 additions & 10 deletions harmonic/install_windows_src.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
peci1 marked this conversation as resolved.
Show resolved Hide resolved

**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
Expand Down Expand Up @@ -41,12 +42,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 <env_name>`.
To remove an environment, use `conda remove --all --name <env_name>`.

> [!NOTE]
> This way of Conda environment creation puts it into a default folder. If you need
to install it elsewhere, use `--prefix <env_path>` instead of `--name <env_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:

Expand All @@ -58,6 +67,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.
peci1 marked this conversation as resolved.
Show resolved Hide resolved

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
Expand Down Expand Up @@ -92,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
Expand All @@ -117,7 +125,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).
peci1 marked this conversation as resolved.
Show resolved Hide resolved

Run the following command to source the workspace:

Expand All @@ -132,6 +140,24 @@ 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]
> 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
```
peci1 marked this conversation as resolved.
Show resolved Hide resolved

> [!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.
peci1 marked this conversation as resolved.
Show resolved Hide resolved

## Uninstalling source-based install

A source-based install can be "uninstalled" using several methods, depending on
Expand All @@ -153,6 +179,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 <env_name>
# or conda remove --all --prefix <path_to_env> if you installed to custom path
```

## Troubleshooting

See [Troubleshooting](/docs/harmonic/troubleshooting#windows)