|
| 1 | +# Visualisation |
| 2 | + |
| 3 | +Developed using [Godot Engine](https://godotengine.org/) and configured to display cockpit [instruments](./instruments.md) with [lidia](https://pypi.org/project/lidia) Python package. |
| 4 | + |
| 5 | +The environment features all obstacles suggested by ADS-33, but the vertical repositioning is modified to provide a reference similar to hover board at 15 and 40 feet above ground. |
| 6 | + |
| 7 | +[Screenshot showing the environment](./visualisation_environment.png) |
| 8 | + |
| 9 | +## Installation |
| 10 | + |
| 11 | +Download the release from [Releases page of this documentation](https://github.com/marsh-sim/marsh-sim.github.io/releases) |
| 12 | + |
| 13 | +Alternatively see [development section below](#development) for instructions how to run the project using Godot Editor. |
| 14 | + |
| 15 | +## Usage |
| 16 | + |
| 17 | +The application will attempt to start in VR, but if it fails it will display the default pilot viewpoint looking forward. |
| 18 | +In that mode, mouse movement can be used to rotate the camera, like in first-person video games. |
| 19 | + |
| 20 | +[Screenshot of pilot's point of view](./visualisation_pov.png) |
| 21 | + |
| 22 | +### Parameters |
| 23 | + |
| 24 | +These can be modified over MAVLink, for example using MARSH Manager. |
| 25 | + |
| 26 | +Example changes to `NAV_OFS_` parameters to start in given positions: |
| 27 | + |
| 28 | +- Sidestep, vertical repositioning: all default |
| 29 | +- Accelerate/decelerate: `HDG` = -90 |
| 30 | +- Hover maneuver: `X` = 50, `Y` = 50 |
| 31 | +- Start of slalom: `HDG` = -90, `X` = -100, `Y` = 300 |
| 32 | + |
| 33 | +#### NAV_OFS_HDG |
| 34 | + |
| 35 | +Displayed heading relative to default position, in degrees. |
| 36 | + |
| 37 | +#### NAV_OFS_X |
| 38 | + |
| 39 | +Starting position offset, forward in default orientation, in meters. |
| 40 | + |
| 41 | +#### NAV_OFS_X |
| 42 | + |
| 43 | +Starting position offset, right in default orientation, in meters. |
| 44 | + |
| 45 | +#### LOCAL_FRAME_LAT |
| 46 | + |
| 47 | +Latitude of local coordinate frame origin when using messages with global position, in degrees. |
| 48 | + |
| 49 | +#### LOCAL_FRAME_LON |
| 50 | + |
| 51 | +Longitude of local coordinate frame origin when using messages with global position, in degrees. |
| 52 | + |
| 53 | +## Roadmap |
| 54 | + |
| 55 | +- Try to have some acceptable setup for Varjo even without the tracker |
| 56 | +- Rework the fly area |
| 57 | + - Make it bigger |
| 58 | + - Keep it square to avoid assymetric geometry |
| 59 | + - Don't use the flat plane, just flatten the terrain |
| 60 | + - Make the terrain mostly green, but add some small patches of different color |
| 61 | +- Fix z-figthing when looking at the runway from afar |
| 62 | +- Reduce pixel artifacts |
| 63 | + - Adjust antialiasing |
| 64 | + - Ensure there are mipmaps and they're used |
| 65 | + |
| 66 | +## Development |
| 67 | + |
| 68 | +The source code is hosted using internal Git service of Politecnico di Milano at [DAER/FRAME-Sim/MARSH/visualisation-marsh](https://gitlab.polimi.it/DAER/frame-sim/marsh/visualisation-marsh). |
| 69 | +There is a public mirror using [Forgejo](https://forgejo.org/) at `git(dot)lukasiewicz(dot)tech/DAER/visualisation-marsh` *not a link to avoid automated crawlers*. |
| 70 | + |
| 71 | +The asset files like textures and models are very big, so the project also uses [Git Large File Storage](https://git-lfs.com/). |
| 72 | +Once installed, it should work correctly with usual `git` commands but you may need to run this if you install it after cloning the repository: |
| 73 | + |
| 74 | +```sh |
| 75 | +git lfs pull |
| 76 | +``` |
| 77 | + |
| 78 | +This repository uses [Git Submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules), to get all the code you need to run either: |
| 79 | + |
| 80 | +```sh |
| 81 | +git clone --recurse-submodules <address of this repository> |
| 82 | +# Or at any later point |
| 83 | +git submodule update --init --recursive |
| 84 | +``` |
| 85 | + |
| 86 | +Using Godot v4.4. |
| 87 | +Install SCons with `pipx install scons`. |
| 88 | +You will need a C++ compiler, you might have one already on Linux, see below for Windows, otherwise in [Godot documentation](https://docs.godotengine.org/en/stable/contributing/development/compiling/index.html). |
| 89 | + |
| 90 | +For updating MAVLink generator, you additionally need `pip install future`. |
| 91 | +It is recommended to install any packages in a [virtual environment](https://docs.python.org/3/library/venv.html), for example: |
| 92 | + |
| 93 | +```sh |
| 94 | +python3 -m venv venv |
| 95 | +source venv/bin/activate |
| 96 | +pip install future |
| 97 | +``` |
| 98 | + |
| 99 | +Some files are generated, run the following commands on first setup and when dependencies change: |
| 100 | + |
| 101 | +```sh |
| 102 | +godot --dump-extension-api # after updating Godot |
| 103 | +python update_mavlink.py # after updating MAVLink dialect |
| 104 | +python update_addons.py # after changing any addon submodules |
| 105 | +scons compile_commands # after modifying SConstruct |
| 106 | +cd project/addons/gdcef; python build.py |
| 107 | +``` |
| 108 | + |
| 109 | +### Windows setup |
| 110 | + |
| 111 | +The most convenient way of getting a C++ compiler is via the LLVM-MinGW project (by the way, it optimizes the binary more). |
| 112 | +Download the `llvm-mingw-...-msvcrt-x86_64.zip` from the [Releases page](https://github.com/mstorsjo/llvm-mingw/releases). |
| 113 | +Unzip the archive to some location you like, and add its `bin` folder to `Path` using the "Edit environment variables for your account" program. |
| 114 | + |
| 115 | +### Build |
| 116 | + |
| 117 | +To build the GDExtension binary run SCons in the repository root, the default arguments have been added to the file. |
| 118 | + |
| 119 | +```sh |
| 120 | +scons |
| 121 | +``` |
| 122 | + |
| 123 | +When building for Windows with MinGW-LLVM, you need to [select this compiler](https://docs.godotengine.org/en/stable/contributing/development/compiling/compiling_for_windows.html#selecting-a-compiler): |
| 124 | + |
| 125 | +```powershell |
| 126 | +scons platform=windows use_mingw=yes use_llvm=yes |
| 127 | +``` |
| 128 | + |
| 129 | +## Deprecated UE5 |
| 130 | + |
| 131 | +This visualisation is made in Unreal Engine 5. The scenery features all recommended ground references from the ADS-33E standard, and the visual helicopter model is the [Eurocopter MH-65 Dolphin](https://en.wikipedia.org/wiki/Eurocopter_MH-65_Dolphin). The instruments shown inside the cockpit are rendered by `lidia` package described above, so it must be running locally with the standard port to display them. |
| 132 | + |
| 133 | +Controls: |
| 134 | +- Use the mouse to look around |
| 135 | +- Move the viewpoint with `W` forward, `S` backward, `E` up, and `C` down |
| 136 | +- Cycle the fog intensity with `F` |
| 137 | +- Exit with `Alt+F4` :smiling_imp: |
| 138 | + |
| 139 | +To start the simulation in different locations of the scenery or different headings, edit the parameters using MARSH Manager window. You can also remotely change the fog intensity this way. |
| 140 | + |
| 141 | +If VR hardware is connected, the visualisation will start in the VR mode, otherwise it will run same as a regular fullscreen game. |
| 142 | + |
| 143 | + |
| 144 | + |
| 145 | +Unfortunately, source code for Unreal Engine projects is quite incompatible with Git, so the Subversion repository was hosted privately. |
| 146 | + |
| 147 | +### Reasons for deprecation |
| 148 | + |
| 149 | +- Very lengthy installation process, and difficult with the network configuration at the laboratory |
| 150 | +- Little to no support for editing projects on Linux |
| 151 | +- Licensing of used assets forbids distribution in editable form. |
| 152 | +- Had unresolved performance problems when using VR headset with platform tracker |
| 153 | +- Had visual artifacts when using with Varjo headset, that we didn't manage to resolve. While Godot is less visually appealing at the start, it's a much simpler system. |
0 commit comments