You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-26Lines changed: 9 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,14 +20,14 @@ Supported ROS2 distributions:
20
20
- Foxy
21
21
- Galactic
22
22
23
-
The asset can be prepared in two flavors:
23
+
For Windows only, this asset can be prepared in two flavors:
24
24
- standalone (no ROS2 installation required on target machine, e.g. your Unity3D simulation server). All required dependencies are installed and can be used e.g. as a complete set of Unity3D plugins.
25
25
- overlay (assuming existing (supported) ROS2 installation on target machine). Only asset libraries and generated messages are installed.
26
26
27
27
#### Platform considerations
28
28
29
-
Running the Editor or App using this Asset on Ubuntu requires a start script that populates the `LD_LIBRARY_PATH`. This is due to dynamic plugin loading mechanism used in the ros2cs library.
30
-
On Windows, no script is necessary and both Editor and App can be ran the usual way (e.g. with a click or cmd line).
29
+
On Linux, you can run Editor and App in any way as long as ros2 is sourced in your environment. The best way to ensure that system-wide is to add `source /opt/ros/foxy/setup.bash` to your `~/.profile`
30
+
file. This way running by clicking (Hub, Editor, or App executable) is supported as well as command line execution. Note that you need to re-log for changes in `~/.profile` to take place.
31
31
32
32
### Releases
33
33
@@ -93,18 +93,18 @@ The project will pull `ros2cs` into the workspace, which also functions independ
93
93
* Clone this project.
94
94
* If you wish to include custom messages in your build, make sure to put them into `ros2_for_unity_custom_messages.repos` file. You can change this file in your fork or change `custom_messages.repos` in the ros2cs repository fork, it will work either way as the scripts will pull both sources.
95
95
As an alternative, you can also add your custom messages package directly by copying it to `src/ros2cs/custom_messages` folder after the next step. Any message package in the build tree will be subjected to `.cs` file generator during the build.
96
-
* You need to source your ROS2 installation (e.g. `source /opt/ros/foxy/setup.bash` on Ubuntu or `C:\dev\ros2_foxy\local_setup.ps1` on Windows) before you proceed, for each new open terminal. On Ubuntu, you can also include this command in your `~/.bashrc` file.
96
+
* You need to source your ROS2 installation (e.g. `source /opt/ros/foxy/setup.bash` on Ubuntu or `C:\dev\ros2_foxy\local_setup.ps1` on Windows) before you proceed, for each new open terminal. On Ubuntu, it is most convenient to include this command in your `~/.profile` file.
97
97
* Run `pull_repositories.sh`. This will pull `ros2cs` as well as your custom messages.
98
98
* Run `build.sh` (Ubuntu) or `build.ps1` (Windows) script.
99
99
* You can build tests by adding `--with-tests` argument to `build` command.
100
100
* It invokes `colcon_build` with `--merge-install` argument to simplify libraries installation.
101
101
* It deploys built plugins into the Asset directory. Note that only plugins built for the current platform will be deployed (there is no cross-compilation).
102
102
* It prepares Unity Asset that is ready to import into your Unity project.
103
103
104
-
#### Standalone version
104
+
#### Standalone version (Windows)
105
105
106
-
By default, build process generates standalone libraries.
107
-
You can disable this feature by setting CMake option `STANDALONE_BUILD` to `OFF` (e.g. through editing `build.sh`).
106
+
By default, build process generates standalone libraries (on Windows only).
107
+
You can disable this feature by setting CMake option `STANDALONE_BUILD` to `OFF` (e.g. through editing `build.ps1`).
108
108
109
109
## Running with Unity
110
110
@@ -118,17 +118,7 @@ Open your Unity3D project and import Ros2ForUnity Asset which is built by this p
118
118
119
119
#### Additional considerations for Linux
120
120
121
-
TODO - we are looking to replace this solution with something simpler. This section needs changes!
122
-
123
-
After including the Asset, close the Editor. You need to use `start.py` from `linux-utils` directory. It is necessary to run your Unity3D Editor or built App.
124
-
This can be done directly or through wrapping your Unity3D project into a ros2 python package (using files from `linux-utils`) and running `colcon build`, sourcing your workspace and calling `ros2 run ros2-for-unity start editor`.
125
-
126
-
> This is due to the necessity for Unity3D to find all required assemblies. `dlopen` is used under the hood to dynamically
127
-
load necessary libraries (including custom messages and rmw implementation).
128
-
Note that unlike Windows `LoadLibrary`, `dlopen` uses `LD_LIBRARY_PATH` value from the start of the process execution and later modifications do not
129
-
affect the search paths. Thus, it is necessary to change `LD_LIBRARY_PATH` before the process starts.
130
-
131
-
> Note that as an alternative, you can set the path manually in your system for the Editor, but consider that built App will have a different absolute path to plugins and can be moved and copied around, so this approach is not recommended.
121
+
You need to have ros2 sourced in environment where you run Unity3D. See Platform Considerations for details.
132
122
133
123
### Building Unity3D application
134
124
@@ -137,14 +127,7 @@ You can do this standard way through `Build->Build Settings...`.
137
127
138
128
## Running application
139
129
140
-
### Windows
141
-
142
-
You can run your application normally by clicking it or executing from command line.
143
-
144
-
### Linux
145
-
146
-
On Linux, follow the [Editor instructions](#running-the-editor), but use the start script (directly or through a package wrapper: `ros2 run ros2-for-unity start app --name:=<Your app name>`) to run your application.
147
-
This is necessary to ensure plugin visibility by setting `LD_LIBRARY_PATH`.
130
+
You can run your application in as standard way by clicking it or executing from command line.
0 commit comments