Hello everyone.

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

Answers

  • edited September 2016

    Stephen Hodgson
    Microsoft HoloLens Agency Readiness Program
    Virtual Solutions Developer at Saab
    HoloToolkit-Unity Moderator

  • utekaiutekai ✭✭✭
    edited September 2016

    Was watching this video 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 ...

  • utekaiutekai ✭✭✭
    edited September 2016

    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

  • @DavidKlineMS said:
    @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.

    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.

  • edited September 2016

    @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

  • utekaiutekai ✭✭✭
    edited September 2016

    @stephenhodgson said:
    @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.

    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 ...

    @utekai said:
    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.

    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.

  • edited September 2016

    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!

  • @Draco18s said:
    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

  • Draco18sDraco18s
    edited May 2017

    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.

  • trzytrzy ✭✭✭
    I've posted a step by step on this forum before. Dig around for it. I use my own wrapper for Spatial Understanding in my Megaman demo ( here: https://github.com/trzy/hololens/blob/master/Demo-Platformer/Assets/Scripts/PlayspaceManager.cs

    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.
  • 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

  • trzytrzy ✭✭✭

    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).

  • @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

  • trzytrzy ✭✭✭

    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.

  • @trzy

    Cool. Thanks. Appreciate your help

  • trzytrzy ✭✭✭

    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.

  • 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

Sign In or Register to comment.