Sharing a hologram between multiple HoloLens devices – Part 2

It was an interesting week, last week, getting two HoloLens devices to coordinate. After talking about the network infrastructure, last time, today we're going to look at other levels of the problem.

Logistically there's a requirement to have two devices: it might be possible to get it all working with a mix of devices and emulators, but that seems like a stretch. And you'd need – in any case – to test with physical devices at some point. The good news is that HoloLens distribution is gradually opening up – with devices now available to pre-order in Australia, Ireland, France, Germany, New Zealand, and the United Kingdom – so getting hold of multiple devices is becoming simpler (if still $3K a pop).

From a physical (human) perspective, it's been a hard thing to do when you have only one head: this is not the first – and probably won't be the last – time I've been envious of Zaphod Beeblebrox. It's possible to have multiple "Mixed Reality Capture" dashboards showing in a browser – with the Live Preview showing each of the HoloLens streams – but there's variable latency that makes it hard to tell whether the views are really synchronised.

More often than not I found myself squinting through two devices at the same time.

Juggling two HoloLens devices

Towards the end of the week I actually started to think I was seeing glitches in the matrix. Perhaps this indeed isn't base reality, after all.

I also had a headache for the entire week. initially it was probably due to the remnants of the cold that hadn't properly gone away when I went scuba-diving the week before – and which definitely then came back – but it certainly wasn't helped by fooling around with multiple HoloLens devices. Thankfully I had a break from the HoloFloor over the weekend, so I'm feeling much better now.

From a software perspective… the HoloToolkit provides a lot of plumbing that helps. It's not super-easy to implement it in your own app, but it is possible… I'm getting my (still slightly sore) head around it, now, but it took a while to understand what was happening. Here are some notes I've taken on how it appears to work:

  • Each device maintains its own set of holograms
    • This may seem an obvious point, but it's worth spelling out
    • Information on where holograms are and how they're behaving can be shared, though
  • There is no sense of a global coordinate system: individual devices are mapping things out individually
    • This is important: you'll find you're relating relatively (and to some degree, flexibly) to multiple coordinate spaces
  • You can create WorldAnchors to fix positions in space to share between devices
    • Be aware that the WorldAnchor goes and locks your object in space – which can make it difficult to manipulate collaboratively
    • You can use the HoloToolkit's "Import Export Anchor Manager" script to look at coordinating the position of holograms between sharing sessions
      • It persists anchors in an anchor store, so subsequent sessions can also access this positional data
    • The anchor position can be decided manually or automatically
      • I'm still working through which way it makes sense to go, here
  • When operations or events happen that need to be shared between devices you can send custom messages
    • For the robot app, I have a "robot positioning", "robot scaling" and "part rotation" messages
      • This seems to be enough to coordinate the various possible actions/movements, so far
  • You also need to be aware of when other people/devices join your session
    • When they do join you'll need to send them information about your scene

I feel as though I'm getting close… I have a number of operations shared between devices, but the positioning isn't yet quite right. I'm confident I'll have nailed it within another day or so, though.

7 responses to “Sharing a hologram between multiple HoloLens devices – Part 2”

  1. pranav gadamsetty Avatar
    pranav gadamsetty

    Hi,

    You mentioned that, we can send custom messages to share events or operations. Could you please briefly explain what are the steps to be followed in order to achieve this. In my case, I'm trying to add a button in my HoloLens app which would send a message to my Desktop/PC app to launch an application on my Desktop

    Regards,
    Pranav

    1. You should take a look at the SharingService.exe provided with the HoloToolkit. This allows you to share operations in this way.

      The other technique was to expose a TCP server on the HoloLens, but this was more about receiving external input.

      Kean

      1. pranav gadamsetty Avatar
        pranav gadamsetty

        Hi,

        Thank you for such an early reply. I have looked into the tutorial 240 on sharing in the holographic academy and have successfully completed all of it's chapters. But, I'm having a hard time understanding the CustomMessages script and how to use it to achieve the purpose mentioned in my question posted yesterday. I couldn't find any documentation or a website where a custom example has been used to explain how to use the Sharing tool provided by HoloToolkit. I would love it if you could briefly explain how I to use the CustomMessages and create additional scripts to send and recieve a message through the server from my HoloLens app to my PC app. Or alternatively if you could post an example explaining the steps to be followed to use this tool. I think it would help a lot of people if there was an example explaining this tool since the documentation on it is so poor and any such example can be used as a reference for others in creating their own applications.

        Thank you,
        Regards,
        Pranav

        1. Kean Walmsley Avatar

          Did you look at the code here?

          github.com/keanw/da...

          Kean

          1. pranav gadamsetty Avatar
            pranav gadamsetty

            Sorry, I'm not able to open that link. I'm in the office and the link seems to be blocked. Are you referring to your dancing robot assets in GitHub? In which case i'll try accessing it directly from the website or from the downloaded folder

            Pranav

            1. Kean Walmsley Avatar

              That's correct.

              Kean

              1. pranav gadamsetty Avatar
                pranav gadamsetty

                Hi Kean,

                Thanks a lot for your help. I've got the app working and now I'm able to click a button on the emulator to launch an application on my PC by broadcasting a message to my PC app.

                Regards,
                Pranav

Leave a Reply to pranav gadamsetty Cancel reply

Your email address will not be published. Required fields are marked *