How to check if glasses connected at launch?

Sorry, this is probably a dumb question, but how do I check if the nreal glasses are connected when my app launches?

I would like to add my own custom behaviour, in addition to the default nreal tooltip.

Currently I’ve just modified NRSessionManager.cs to make m_IsSessionError public and static, but that is obviously a bit of a hack!

Please feel free to ask any questions on the forum. For your question:
Launch with exception: You could monitor the NRSessionManager.OnKernalError event, this event indicates that the app launched with exception. Common problems include: glasses connection failure, glasses mode not 3D mode, etc.
Launch without exception: get the session status through NRFrame.SessionState.

Hi

I have a follow up on this. I’d like my app to launch in Adnroid Ar mode using the phone camera if the glasses are not connected or nreal isn’t supported on the phone. Can I hook into this to do that?

Cheers
Martin

Hi, I’m sorry but no. Your AR app can only call the cam of the glass.

Sorry just to be clear there is no way to switch off the NRSDK and use arfoundation if the glasses aren’t present? So I would have to have a separate project for phone ar mode?

Thanks
Martin

The framework of NRSDK is different to AR app on phone. NRSDK doesn’t support the 2D framework, so it cannot be switched off and enable 2D AR mode to call the cam of your phone. If you want to do that, you have to use other SDK like ARCore or ARkit for AR app. By the way, our NRSDK will support AR foundation in the future, so maybe it can be easy to develop AR phone app for you then.

1 Like