The Mixed Reality Forums here are no longer being used or maintained.
There are a few other places we would like to direct you to for support, both from Microsoft and from the community.
The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.
For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.
If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.
And always feel free to hit us up on Twitter @MxdRealityDev.
Getting Started with HoloToolkit
Is there a Getting Started doc or video that shows how to use the code and the samples.
How to load up a sample and run, for instance the SpatialMapping component.
Best Answer
-
Optionsahillier mod
Hi @utekai,
Here are the steps that you currently need to take to run sample projects in HoloToolkit-Unity:
1) Clone the HoloToolkit-Unity project from GitHub to your PC.
2) Launch Unity and select 'Open'
3) Select the 'HoloToolkit-Unity' folder on your PC to open the project in Unity
4) In the Project panel, expand the HoloToolkit folder
5) Locate the feature that you are interested in (we'll use SpatialMapping as an example)
6) Expand SpatialMapping feature and then select the 'Tests' folder.
7) Double-click on one of the test scenes to open it (I would suggest trying the 'SpatialProcessing' scene, since it can run inside of Unity).
8) Some scenes (like 'SpatialProcessing') can run inside of Unity, so you just need to press the 'Play' button. All scenes will run on the HoloLens, but you need to follow the build/deploy process outlined in our docs and Academy courses.
9) If you're confused about what a test does, locate the ReadMe file associated with the feature (view it on GitHub for nice formatting, or find and double-click it under the feature-level folder in Unity). There should be instructions/explanations for each test scene.If you want to try more end-to-end samples, then there are several available under the 'HoloToolkit-Examples' folder. To run the SpatialMappingComponent example, you would do the following:
1) Expand the 'HoloToolkit-Examples' folder.
2) Click on the 'SpatialMappingComponent' folder.
3) Double-click on the 'Example' scene to load it.
4) This sample must run on the HoloLens, so build/deploy as usual (In the Build Settings window, don't forget to press the 'AddOpenScenes' button to add the current scene to the build and delete any scene from the list that you may have added before).
5) There should be a ReadMe file associated with each example to help explain what is going on.If you get to the point where you want to import HoloToolkit into your own Unity project, then you can do the following:
1) In the HoloToolkit-Unity project, right-click on the 'HoloToolkit' folder and select 'Export package'.
2) Wait a few seconds for the export dialog to populate...
3) You can create a custom package by unchecking any folders/scripts that you do not want to export. For example, if you don't need any of the 'Build' 'Cross Platform' 'Sharing' and 'Spatial Sound' components, then uncheck those folders. It's a good idea to uncheck all of the 'test' folders under each feature too, and make sure that the 'HoloToolkit-Examples' folder is not included so you don't get test scenes added to your project.
4) Press the 'Export' button.
5) Save the .unitypackage
6) Open your personal project in Unity or create a new project.
7) Select the 'Assets' file menu option at the top of Unity
8) Select 'Import Package' > 'Custom Package' and then find and select the .unitypackage that you saved in step 5 above. Press the 'Open' button.
9) If there are any files that you don't want to import into your project, you can uncheck them now, otherwise, press the 'Import' button.
10) The 'HoloToolkit' folder should now appear under the 'Assets' folder in the Project panel.OK, that's a lot of stuff. If any of the specific steps listed above are confusing, if you need more information, or if you find something missing, please let us know.
I hope this helps,
~Angela6
Answers
General Samples:
https://developer.microsoft.com/en-us/windows/holographic/academy
Spatial Mapping Specific:
https://developer.microsoft.com/en-us/windows/holographic/holograms_230
Stephen Hodgson
Microsoft HoloLens Agency Readiness Program
Virtual Solutions Developer at Saab
HoloToolkit-Unity Moderator
This is the most pertinent posting found so far ... http://www.sharpgis.net/post/2016/04/10/Installing-HoloLens-HoloToolkit-into-your-Unity-Project
Was watching this video https://www.youtube.com/watch?v=JbsmKVSSLM8 and following along and replicating the code locally. Around the 24:41 minute point he imports a holotoolkit custom package he made from the toolkit. But the scripts he refers to are not in the toolkit, or no longer in the toolkit.
Already aware of the holographic academy and samples, but this question in this thread is pertaining ONLY to the holotoolkit samples.
Trying to get the samples in the toolkit running, just not sure of the simple steps to follow to do this. Looking for those simple steps ...
https://developer.microsoft.com/en-us/windows/holographic/spatial_mapping_in_unity
This post also refers to scripts no longer in the toolkit.
But just to be clear, the question in this thread is about running the included toolkit samples in the holotoolkit.
It's not about replicating the code in that video, as that code is available here https://github.com/teichgraf/HoloWorld
@utekai,
Have you looked at the Assets/HoloToolkit-Examples on GitHub? Each of these should have a README.MD file that documents the example.
Are there specific HoloToolkit components that you are having trouble figuring out how to use? We can definitely look into improving the documentation.
Thanks!
David
The one component mentioned in the first message of this thread, the Spatial Mapping component, has a unity example with a readme here https://github.com/Microsoft/HoloToolkit-Unity/blob/master/Assets/HoloToolkit-Examples/SpatialMappingComponent/README.md
It looks to be for a previous version.
Documentation for the component refers the reader to this page https://github.com/Microsoft/HoloToolkit-Unity/wiki/Spatial-Mapping which isn't completed yet.
Just looking for the 1, 2, 3 ... to run it is all.
@utekai I have to agree that some of the documentation and tutorials aren't really all there just yet. Give it time, we're still a young community with lots of people still trying to get up and running. Also, good find on that sharpGIS blog. I totally forgot about that site too. Good gems there.
I've also had troubles getting some of the examples to run out of the box as well, but a lot of times it's simple development environment issues on my end.
Stephen Hodgson
Microsoft HoloLens Agency Readiness Program
Virtual Solutions Developer at Saab
HoloToolkit-Unity Moderator
Perhaps you could give the steps of running the examples that did work for you, even just one?
In a thread this long, sometimes the original question gets missed, so here it is again ...
There are the wiki pages, but they're not complete/updated/accurate for the most part.
This one is a bit helpful https://github.com/Microsoft/HoloToolkit/wiki/Getting-Started
As for the unity components, the spatial mapping component has this readme https://github.com/Microsoft/HoloToolkit-Unity/blob/master/Assets/HoloToolkit-Examples/SpatialMappingComponent/README.md but it appears to be inaccurate or not updated.
The unity example for spatial mapping offers up this incomplete wiki https://github.com/Microsoft/HoloToolkit-Unity/wiki/Spatial-Mapping
Bottom line is, I'm sure it's rather easy, just a few steps, and some people do know those steps, but for some reason it isn't info being readily disseminated at this point.
Hi @utekai,
Here are the steps that you currently need to take to run sample projects in HoloToolkit-Unity:
1) Clone the HoloToolkit-Unity project from GitHub to your PC.
2) Launch Unity and select 'Open'
3) Select the 'HoloToolkit-Unity' folder on your PC to open the project in Unity
4) In the Project panel, expand the HoloToolkit folder
5) Locate the feature that you are interested in (we'll use SpatialMapping as an example)
6) Expand SpatialMapping feature and then select the 'Tests' folder.
7) Double-click on one of the test scenes to open it (I would suggest trying the 'SpatialProcessing' scene, since it can run inside of Unity).
8) Some scenes (like 'SpatialProcessing') can run inside of Unity, so you just need to press the 'Play' button. All scenes will run on the HoloLens, but you need to follow the build/deploy process outlined in our docs and Academy courses.
9) If you're confused about what a test does, locate the ReadMe file associated with the feature (view it on GitHub for nice formatting, or find and double-click it under the feature-level folder in Unity). There should be instructions/explanations for each test scene.
If you want to try more end-to-end samples, then there are several available under the 'HoloToolkit-Examples' folder. To run the SpatialMappingComponent example, you would do the following:
1) Expand the 'HoloToolkit-Examples' folder.
2) Click on the 'SpatialMappingComponent' folder.
3) Double-click on the 'Example' scene to load it.
4) This sample must run on the HoloLens, so build/deploy as usual (In the Build Settings window, don't forget to press the 'AddOpenScenes' button to add the current scene to the build and delete any scene from the list that you may have added before).
5) There should be a ReadMe file associated with each example to help explain what is going on.
If you get to the point where you want to import HoloToolkit into your own Unity project, then you can do the following:
1) In the HoloToolkit-Unity project, right-click on the 'HoloToolkit' folder and select 'Export package'.
2) Wait a few seconds for the export dialog to populate...
3) You can create a custom package by unchecking any folders/scripts that you do not want to export. For example, if you don't need any of the 'Build' 'Cross Platform' 'Sharing' and 'Spatial Sound' components, then uncheck those folders. It's a good idea to uncheck all of the 'test' folders under each feature too, and make sure that the 'HoloToolkit-Examples' folder is not included so you don't get test scenes added to your project.
4) Press the 'Export' button.
5) Save the .unitypackage
6) Open your personal project in Unity or create a new project.
7) Select the 'Assets' file menu option at the top of Unity
8) Select 'Import Package' > 'Custom Package' and then find and select the .unitypackage that you saved in step 5 above. Press the 'Open' button.
9) If there are any files that you don't want to import into your project, you can uncheck them now, otherwise, press the 'Import' button.
10) The 'HoloToolkit' folder should now appear under the 'Assets' folder in the Project panel.
OK, that's a lot of stuff. If any of the specific steps listed above are confusing, if you need more information, or if you find something missing, please let us know.
I hope this helps,
~Angela
@ahillier , could we go ahead and get this added to https://github.com/Microsoft/HoloToolkit-Unity/wiki/Spatial-Mapping ?
Created a new issue:
https://github.com/Microsoft/HoloToolkit-Unity/issues/218
Stephen Hodgson
Microsoft HoloLens Agency Readiness Program
Virtual Solutions Developer at Saab
HoloToolkit-Unity Moderator
@ahillier thanks so much, your answer PRECISELY answers the question.
So, my issue with the HoloToolkit and its examples is nothing's explained. I've been trying to figure out how I can, on startup, scan the immediate area, find a spot that would be "about as big as I need" and move my interactive objects there. Right now they're placed "3 meters in front of the camera" which is "whatever direction the player is facing when the application starts" which might be inside/behind a wall.
The functions are there to find the largest horizontal or vertical surface, but there's no explanation of the methods needed in order to HAVE access to that data and the official documentation page is even less transparent. It just says "yeah, these are the method names, here's one example signature." Great.
It even says there are two ways to scan the room but with no indication how to tell the API which one to actually use!
That link isn't saying that there are two separate ways to scan the room, its saying that those are the assumptions that the spatial understanding code makes based on the needs of the two games (fragments and young conker) that it was created for.
There are some decent tutorials about setting up spatial understanding in your project:
And of course the sample scene in the toolkit:
https://github.com/Microsoft/HoloToolkit-Unity/tree/master/Assets/HoloToolkit-Examples/SpatialUnderstanding
There are also other methods which are simpler such as using a SurfaceMeshesToPlanes script to identify the floor, and place the on in the center of the floor plane, etc.
https://developer.microsoft.com/en-us/windows/mixed-reality/holograms_230
Thanks for correcting my parsing of the documentation page. I had managed to overlook that that box was assumptions being made.
Still, I don't have a way of going about finding the available volume that I want. The cameronvetter links are just like "yeah, open that script and make it this" (this is terrible, terrible design: either the toolkit scripts can be used as-is without modification and the tutorial is doing things wrong, or the toolkit scrips are incomplete and wrong) and again explains nothing about what it's doing, what the exact changes being made are, and why they were made in order to accomplish some goal. And still doesn't deal with finding volume areas, all it is is adding status messages for the existing room scanning process (the first one), adding input (the second), or adding holograms into the scene that the user can place themselves (third one).
I am looking for how to use QueryTopology_FindPositionsOnFloor and QueryTopology_FindPositionsOnWalls and I want to do so using a little initialization time as possible. SpacialMappingRenderer already has information about the world around the user, at least well enough to display the mesh. Why can I not say "this data is good enough to use as the entire play area, find a 1 meter cube volume that's unobstructed"?
And for that matter, why doesn't the painting show the unused portions of the known area at all? Sure, paint the areas that are defined as within bounds in green, but for god's sake do something with the rest of it. Otherwise the user can't tell if the hololens hasn't seen the surface or if it just not painted.
@Draco18s I'm with you on that... the API that is exposed is pretty awkward to work with. Most of this is because of the way everything gets marshaled over the DLL boundary to the C++ implementation. There is definitely room for a higher-level wrapper that handles makes getting started with things easier.
As far as initialization time goes, I don't think there is a way exposed to "paint" all the spatial mapping data at once, so you need to do the walking around thing as currently implemented. The "SurfaceMeshToPlanes" approach I mentioned above wouldn't have this limitation.
I don't know the context of your application, but once you have done the initial setup of a room, you should be able to perform your queries and save the locations using the world anchor so that on subsequent loads you are able to re-use those positions without re-scanning.
The application is basically "display a map and some controls." TBH there's no need for this to be a mixed reality application beyond "because that's what I was told." I'm being paid an absurd amount of money, so I'm not going to voice that concern aloud.
I'll look into the SurfaceMeshToPlanes approach here in a bit.
Take a look also at Main.cs to see the main app flow. I start spatial mapping and understanding, let the user scan the room (meshes are rendered during this phase), then on air tap, scanning is shut off, the messes are made invisible and occluding, and the solver is initialized. I've written my own wrappers for the queries, too, and you can see them being used in Main.cs.
You won't be able to build this project because required assets are not provided but the code is all there.
Bart
http://trzy.org
trzy: I'll dig into that tomorrow.
Just finished up getting the SurfaceMeshToPlanes thing a go ("everything is floor, job done"). Will mess with it some more tomorrow as well, as my day in the office is done.
Hi,
I have never used the SurfaceMeshesToPlanes script. I think it will help me in my project. Can anyone tell me what it does and when would someone use it
Thanks,
Pranav
SurfacePlanes work atop ordinary spatial mapping. Spatial Understanding is something quite different (it is itself a layer atop spatial mapping that produces a refined and regularized mesh) and doesn't require producing planes. It will detect vertical surfaces internally and allow them to be queried.
Depending on your needs, spatial mapping with SurfacePlane extraction may be sufficient. I used it in one of my other demos (Demo-Holocopter; not to be confused with the unrelated Holocopter app in the app store). It's pretty straightforward (much more so than Spatial Understanding).
Bart
http://trzy.org
@trzy
Can I use it for surface detection. As in when a Raycast hits a mesh on a surface, all the meshes having the same normal and in contact with each other, in other words, all the triangles (meshes) on that particular surface get highlighted.
Thanks,
Pranav
You can certainly do raycasts that intersect with the surface plane but you might need to assign them a different layer mask or disable the spatial mesh objects once you've got the planes.
This should be relatively easy to experiment with in the Unity editor.
Bart
http://trzy.org
@trzy
Cool. Thanks. Appreciate your help
Actually, if I recall correctly, SurfacePlane objects should already be part of the spatial mapping layer. But to ensure that you are only raycasting against them, you may need to iterate through and disable the spatial mapping meshes, so only SurfacePlanes are available to raycast against.
Bart
http://trzy.org
for the below solution , there is no such folder named "'HoloToolkit-Unity" in git .
Also i searhed for evey single folder but none has a unity project , I expetced a better help .
ahillier mod
September 2016 Accepted Answer
Hi @utekai,
Here are the steps that you currently need to take to run sample projects in