|
1 | 1 | # Mixed Reality Toolkit for ROS2 Overview
|
2 | 2 | > The MRTK for ROS is being developed in the open: Feature requests are very much welcome at the [issues page](https://github.com/ms-iot/ros_msft_mrtk/issues).
|
3 | 3 |
|
4 |
| -The Robot Operating system - also called ROS [^1] - is an open source middleware for creating Robots. This repository implements glue which connects your Mixed Reality Robotics application with Robots and infrastructure running using ROS2. It works with [ROS2.net](https://github.com/ros2-dotnet/ros2_dotnet) within the Unity Game engine. |
| 4 | +The Robot Operating system - also called ROS [^1] - is an open source middleware for creating Robots. This repository implements glue which connects your Mixed Reality Robotics application with Robots and infrastructure using ROS2. ROS2 runs directly on the Hololens without going through ROS Bridge - reducing latency and improving network efficiency. |
| 5 | +The ROS2 MRTK extension works with [ROS2.net](https://github.com/ros2-dotnet/ros2_dotnet)[^2] within the Unity Game engine, allowing you to write ROS2-like code directly in Unity. |
5 | 6 |
|
6 | 7 | The Mixed Reality Toolkit is an Open Source framework for building Virtual Reality and Augmented Reality applications, which target numerous platforms - including Hololens.
|
7 | 8 |
|
8 |
| -The MRTK for ROS Unity Extension is being developed by the ROS2.net maintainers, the Microsoft Edge Robotics team and the Mixed Reality Robotics team. |
| 9 | +## Getting started with ROS2 on Hololens 2. |
9 | 10 |
|
10 |
| -## Getting started with ROS2 on Hololens. |
11 |
| -This depends on [ROS2 Foxy UPM supplied by Microsoft](http://aka.ms/ros/mrtk_native). Windows is required for Hololens and Windows Mixed Reality development. MRTK for ROS development will not be supported on other platforms. |
| 11 | +This depends on [ROS2 Foxy UPM supplied by Microsoft](http://aka.ms/ros/mrtk_native). Windows is required for Hololens and Windows Mixed Reality development. MRTK for ROS2 development will not be supported on other platforms. |
12 | 12 |
|
13 | 13 | ### Prerequsitites
|
14 | 14 | * [Unity 2020.3 or later](https://unity.com/)
|
15 | 15 | * [Microsoft Mixed Reality Toolkit](https://docs.microsoft.com/en-us/windows/mixed-reality/mrtk-unity/?view=mrtkunity-2021-05)
|
16 | 16 | * [Nuget for Unity 3.02 or later](https://github.com/GlitchEnzo/NuGetForUnity/releases)
|
17 | 17 | * [Microsoft Mixed Reality QR Nuget](https://nuget.org/Packages/Microsoft.MixedReality.QR)
|
| 18 | +* Download the Unity release for the ROS2 native from [http://aka.ms/ros/mrtk_native](http://aka.ms/ros/mrtk_native) |
| 19 | +* Download the Unity release for the Mixed Reality Toolit for ROS2 from [http://aka.ms/ros/mrtk](http://aka.ms/ros/mrtk) |
18 | 20 |
|
19 | 21 | ### Create your application
|
20 | 22 |
|
21 |
| -* Create a 3D Unity application, and set up for Windows Mixed Reality using the instructions provided by the [Microsoft Mixed Reality Toolkit](https://docs.microsoft.com/en-us/windows/mixed-reality/mrtk-unity/?view=mrtkunity-2021-05) documentation. |
22 |
| -* Add Nuget for unity to your application by double clicking the the `NuGetForUnity.3.0.2.unitypackage`. Restart Unity for this to take effect. |
| 23 | +* Create a 3D Unity application |
| 24 | +* Use the [Microsoft Mixed Reality Feature Tool](https://docs.microsoft.com/en-us/windows/mixed-reality/develop/unity/welcome-to-mr-feature-tool), and select the following features: |
| 25 | + * Azure Mixed Reality Services |
| 26 | + * Azure Spatial Anchors SDK Core |
| 27 | + * Azure Spatial Anchors SDK for iOS |
| 28 | + * Azure Spatial Anchors SDK for Windows |
| 29 | + * Mixed Reality Toolkit |
| 30 | + * Mixed Reality Toolkit Extensions |
| 31 | + * Mixed Reality Toolkit Foundation |
| 32 | + * Mixed Reality Standard Assets |
| 33 | + * Mixed Reality Toolkit Tools |
| 34 | + * Platform Support |
| 35 | + * Mixed Reality OpenXR Plugin |
| 36 | + * Spatial Audio |
| 37 | + * Microsoft Spatializer |
| 38 | + * World Locking Tools |
| 39 | + * WLT Core |
| 40 | +* Wait for Unity to deploy these components. |
| 41 | + * If asked about the `new Input System`, select `Yes`. |
| 42 | +* When Unity restarts, you should now see a window titled `MRTK Project Configurator` |
| 43 | + * Select `Unity OpenXR Plugin` |
| 44 | + * Select `Show XR Plug-in Management` |
| 45 | + * In the new window, with the monitor icon on the tab, select `OpenXR`. |
| 46 | + * Switch to the Microsoft icon, ans select `OpenXR` |
| 47 | + * Close the Unity Configuration Window |
| 48 | + * Return to the `MRTK Project Configurator` Window and select `Apply Settings`, then select `Next` |
| 49 | + * Select `Microsoft Spatializer` in the `Audio Spatializer` dropdown, then click `Apply` |
| 50 | +* When Unity Restarts (again), Select the `Mixed Reality` Menu item, `Toolkit`, `Add to Scene and Configure` |
| 51 | +* Add Nuget for unity to your application by double clicking the the `NuGetForUnity.3.0.2.unitypackage`. Import the assets into your project. |
23 | 52 | * In the Menu for Unity, select `NuGet`, then `Manage Packages`.
|
24 | 53 | * In the Search edit box, enter `Microsoft.MixedReality.QR`, then click search. Install 0.5.3 or later.
|
25 | 54 | * In the `Window` Menu, select `Package Manager`.
|
26 |
| -* Select `+`, then `Add Package from Git Url`. enter `http://aka.ms/ros/mrtk_native` |
27 |
| -* Select `+`, then `Add Package from Git Url`. enter `http://aka.ms/ros/mrtk` |
| 55 | +* Select `+`, then `Add Package from tarball`. select the Unity release for ROS2 Native downloaded above. |
| 56 | +* Select `+`, then `Add Package from tarball`. select the Unity release for the Mixed Reality Toolkit for ROS2 downloaded above. |
| 57 | +* In the `Project` tree view in Unity, expand `ROS2 and ROS2.net Native components for Unity` and locate the `link.xml` file. Drag and copy this file into your asset folder. |
| 58 | + * This is needed to prevent optimizations which break ROS2.net Messages. |
| 59 | + |
| 60 | +* Configure your project for Hololens: |
| 61 | + * Select `Edit` then `Project Settings` |
| 62 | + * Select `Player`. Select the Windows icon. |
| 63 | + * Under Capabilities, ensure that the following are checked: |
| 64 | + * InternetClient |
| 65 | + * InternetClientServer |
| 66 | + * PrivateNetworkClientServer |
| 67 | + * WebCam |
| 68 | + * Microphone |
| 69 | + * SpatialPerception |
| 70 | + * Select `File` Then `Build Settings` |
| 71 | + * Select `Add Open Scenes` to add your current scenes to the project. |
| 72 | + * Select `Universal Windows Platform` and `Switch Plaform` if needed. |
| 73 | + * Select `Build` |
| 74 | + * In the save dialog, right click on the background and select `New Folder`, name it `App`, ensure `App` is selected, then click `Select Folder` |
| 75 | + * Open the resulting Visual Studio Solution in the `App` folder |
| 76 | + * Configure Visual Studio |
| 77 | + * Select the `Release` build type. (This is important, as the ROS2 binaries are only delivered as release) |
| 78 | + * Select `ARM64`. |
| 79 | + * Build and Deploy |
| 80 | + |
| 81 | + |
28 | 82 |
|
29 | 83 | You can now add scenes from the ROS MRTK extension or use individual components in your application.
|
30 | 84 |
|
| 85 | +### Sample Scene to bootstrap your application |
| 86 | +One you have configured the application above, you can now add components to your scene to define your application. A Sample scene is provided which demonstrates spatial pinning and Lidar visualization. |
| 87 | + |
| 88 | +* In the Unity Package Manager Window, select `ROS2 and ROS2.net Native components for Unity`. |
| 89 | +* Under the Samples dropdown, select `Basic ROS World` and select Import. |
| 90 | +* Drag this scene to the Unity Hierarchy Window. |
| 91 | +* Remove any existing scenes. |
| 92 | + |
| 93 | + |
31 | 94 | # Contributions
|
32 | 95 | Contributions are welcome. Refer to the [Contribution Process](CONTRIBUTING.md) for more details.
|
33 | 96 |
|
34 |
| - |
35 | 97 | [^1]: ROS is a trademark of Open Robotics.
|
| 98 | +[^2]: ROS2.net is maintained by the ROS2.net maintainers and community. |
0 commit comments