Quantcast
Channel: Recent Discussions — Mixed Reality Developer Forum
Viewing all 10543 articles
Browse latest View live

WMR DatagramSocket not receiving UDP data

$
0
0

I have an issue using DatagramSocket for receiving UDP data with Unity 2018.2.10f1 for deploying on Windows Mixed Reality Samsung Oddysey.

I'm using the code from: https://gist.github.com/michaelosthege/857acac92b8ee689a6bb30d5bf23d9f6 to implement a UDP client to receive UDP data.

But my application don't receive any data using this code:

Code (CSharp):
_Socket.MessageReceived += _Socket_MessageReceived;
_Socket_MessageReceived method doesn't get called.

What are doing wrong?

Thanks in advise.


Windows immersive Headset Error : H0102000-0

$
0
0

Hi , I have set up mixed reality portal in Windows 10 Pro Version 1709 Build 16299.125. But am not able to get started with the device or simulator because of this error : We're not sure what's up, but this error code should help: H0102000-0.

Any suggestions on how to fix this ?

Sleepmode Tap Missing in the Device Portal

$
0
0

I wanted to change the sleep mode from 5 to 30 minutes or turn it off at the Device Portal, but the sleep mode tab is missing. Where is it now? How can I change it to at least 30 minutes?

I tested it on 3 hololenses. No Device Portal shows the sleep mode tab anymore.
I used developer und commercial hololenses.

I already tried https://www.tattichan.work/entry/2017/07/17/
I used the unity script. But it doesn't seem to work.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;

public class Sleepmode : MonoBehaviour
{

[Tooltip("DevicePortal URL")]
public string url = "127.0.0.1:10080";
[Tooltip("DevicePortal UserName")]
public string usr = "username";
[Tooltip("DevicePortal Password")]
public string pass = "pass";

void Update()
{
    if (Input.GetKeyDown(KeyCode.S))
    {
        StartCoroutine(OnSetVideoIdle());
        StartCoroutine(OnSetStanbyIdle());
    }
}


//ValueAC = 0 & ValueDC = 0 " , 
IEnumerator OnSetVideoIdle()
{
    WWWForm form = new WWWForm();
    var req = UnityWebRequest.Post(" http://" + url + "/api/power/cfg/SCHEME_CURRENT/SUB_SLEEP/VIDEOIDLE?ValueAC=0&ValueDC=0", form);
    req.SetRequestHeader("AUTHORIZATION", Authenticate(usr, pass));
    yield return req.SendWebRequest();
}

IEnumerator OnSetStanbyIdle()
{
    WWWForm form = new WWWForm();
    var req = UnityWebRequest.Post("http://" + url + "/api/power/cfg/SCHEME_CURRENT/SUB_SLEEP/STANDBYIDLE?ValueAC=0&ValueDC=0", form);
    req.SetRequestHeader("AUTHORIZATION", Authenticate(usr, pass));
    yield return req.SendWebRequest();
}
string Authenticate(string username, string password)
{
    string auth = username + ":" + password;
    auth = System.Convert.ToBase64String(System.Text.Encoding.GetEncoding("ISO-8859-1").GetBytes(auth));
    auth = "Basic" + auth;
    return auth;
}

}

Would be good to add the sleep mode to the hololens menu and not always use the device potal to change it.

What else can I Do? Thanks in advance.

Sophiena

Sleepmode Tap Missing in the Device Portal

$
0
0

I wanted to change the sleep mode from 5 to 30 minutes or turn it off at the Device Portal, but the sleep mode tab is missing. Where is it now? How can I change it to at least 30 minutes?

I tested it on 3 hololenses. No Device Portal shows the sleep mode tab anymore.
I used developer und commercial hololenses.

I already tried https://www.tattichan.work/entry/2017/07/17/
I used the unity script. But it doesn't seem to work.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;

public class Sleepmode : MonoBehaviour
{

[Tooltip("DevicePortal URL")]
public string url = "127.0.0.1:10080";
[Tooltip("DevicePortal UserName")]
public string usr = "username";
[Tooltip("DevicePortal Password")]
public string pass = "pass";

void Update()
{
    if (Input.GetKeyDown(KeyCode.S))
    {
        StartCoroutine(OnSetVideoIdle());
        StartCoroutine(OnSetStanbyIdle());
    }
}


//ValueAC = 0 & ValueDC = 0 " , 
IEnumerator OnSetVideoIdle()
{
    WWWForm form = new WWWForm();
    var req = UnityWebRequest.Post(" http://" + url + "/api/power/cfg/SCHEME_CURRENT/SUB_SLEEP/VIDEOIDLE?ValueAC=0&ValueDC=0", form);
    req.SetRequestHeader("AUTHORIZATION", Authenticate(usr, pass));
    yield return req.SendWebRequest();
}

IEnumerator OnSetStanbyIdle()
{
    WWWForm form = new WWWForm();
    var req = UnityWebRequest.Post("http://" + url + "/api/power/cfg/SCHEME_CURRENT/SUB_SLEEP/STANDBYIDLE?ValueAC=0&ValueDC=0", form);
    req.SetRequestHeader("AUTHORIZATION", Authenticate(usr, pass));
    yield return req.SendWebRequest();
}
string Authenticate(string username, string password)
{
    string auth = username + ":" + password;
    auth = System.Convert.ToBase64String(System.Text.Encoding.GetEncoding("ISO-8859-1").GetBytes(auth));
    auth = "Basic" + auth;
    return auth;
}

}

Would be good to add the sleep mode to the hololens menu and not always use the device potal to change it.

What else can I Do? Thanks in advance.

Sophiena

[Unity] TakePhotoAsync only working once

$
0
0

Hello,

I have a very strange behavior with the locatable camera API on Hololens.
When I trigger capture.TakePhotoAsync, the callback is only called once. On the second time I trigger it, the callback is never called and the opened thread never seems to be closed, it looks like TakePhotoAsync keeps on running. The debugger even failed to close :

However it is working perfectly in the editor.

Here is my code :

using System;
using System.Collections;
using System.Linq;
using HoloToolkit.Unity.InputModule;
using HoloToolkit.Unity;
using UnityEngine;
using UnityEngine.XR.WSA.WebCam;

/// <summary>
/// Manages taking and saving photos.
/// </summary>
public class PhotoManager : Singleton<PhotoManager>
{
    /// <summary>
    /// Actual camera instance.
    /// </summary>
    private PhotoCapture capture;

    /// <summary>
    /// True, if the camera is ready to take photos.
    /// </summary>
    public bool isReady { get; private set; }
    public Resolution resolution { get; private set; }

    #region EVENTS
    public event Action<bool> OnCaptureReady;
    public event Action OnCaptureOff;
    #endregion

    private Coroutine launchedStartCapture;
    private CameraParameters cameraParameters;

    protected override void Awake()
    {
        base.Awake();
        isReady = false;
        // This resolution guarantee that it will have holograms in the whole picture
        resolution = PhotoCapture.SupportedResolutions.OrderByDescending(res => res.width * res.height).ElementAt(1);
        cameraParameters = new CameraParameters(WebCamMode.PhotoMode)
        {
            hologramOpacity = 1.0f,
            cameraResolutionWidth = resolution.width,
            cameraResolutionHeight = resolution.height,
            pixelFormat = CapturePixelFormat.BGRA32
        };
    }

    private void OnDisable()
    {
        StopCapture();
    }

    public void StartCapture(Action<bool> callback = null)
    {
        if (launchedStartCapture != null)
        {
            StopCoroutine(launchedStartCapture);
        }

        launchedStartCapture = StartCoroutine(StartCaptureCoroutine(callback));
    }

    private IEnumerator StartCaptureCoroutine(Action<bool> callback = null)
    {
        bool stopped = false;
        StopCapture(res => stopped = true);

        yield return new WaitUntil(() => stopped);

        if (WebCam.Mode != WebCamMode.None)
        {
            Debug.LogErrorFormat(this, "Can't activate capture, webcam is already in mode {0}", WebCam.Mode);
            if (callback != null) callback(false);
            yield break;
        }

        if (ExakisTools.Utils.HoloLensHelpers.IsStreaming())
        {
            Debug.LogErrorFormat(this, "Can't activate capture, application is in currently streaming");
            if (callback != null) callback(false);
            yield break;
        }

        PhotoCapture.CreateAsync(true, captureObject =>
        {
            capture = captureObject;

            capture.StartPhotoModeAsync(cameraParameters, res => this.OnPhotoModeStarted(res, callback));
        });
    }

    private void OnPhotoModeStarted(PhotoCapture.PhotoCaptureResult result, Action<bool> callback)
    {
        isReady = result.success;
        if (OnCaptureReady != null) OnCaptureReady(isReady);
        if (isReady)
        {
            callback?.Invoke(true);
            // [Quick Fix] Hologramms are not shown on first picture
            // capture.TakePhotoAsync((photoResult, photoCaptureFrame) =>
            // {
            //     photoCaptureFrame.Dispose();
            //     photoCaptureFrame = null;
            //     callback?.Invoke(true);
            // });
            Debug.Log("Camera ready");
        }
        else
        {
            Debug.LogErrorFormat(this, "Failed to activate capture, if you are streaming, please remove it, reason : {0}", result.resultType);
        }
    }

    /// <summary>
    /// Take a picture if the capture is on
    /// </summary>
    /// <param name="photoTaken"> Callback when the picture is taken </param>
    public void TakePhoto(Action<Texture2D> photoTaken = null)
    {
        if (isReady)
        {
            UnityEngine.XR.WSA.HolographicSettings.SetFocusPointForFrame(CameraCache.Main.transform.TransformPoint(0, 0, 1f), -CameraCache.Main.transform.forward);
            capture.TakePhotoAsync((result, photoCaptureFrame) =>
            {
                if (result.success)
                {
                    Texture2D targetTexture = new Texture2D(resolution.width, resolution.height, TextureFormat.BGRA32, false);
                    photoCaptureFrame.UploadImageDataToTexture(targetTexture);
                    photoCaptureFrame.Dispose();
                    photoTaken.Invoke(targetTexture);
                }
                else
                {
                    Debug.LogErrorFormat("Failed to take photo {0}", result.hResult);
                }
            });
        }
        else
        {
            Debug.LogWarning("The camera is not yet ready.");
        }
    }

    /// <summary>
    /// Stop the photo mode.
    /// </summary>
    /// <param name="callback"> return true if the capture has been stopped</param>
    public void StopCapture(Action<bool> callback = null)
    {
        if (capture != null)
        {
            capture.StopPhotoModeAsync(result =>
            {
                capture.Dispose();
                capture = null;
                isReady = false;
                Debug.Log("Camera off");
                if (OnCaptureOff != null) OnCaptureOff();
                if (callback != null) callback(true);
            });
        }
        else
        {
            if (callback != null) callback(false);
        }
    }
}

I am aware there are a lot of problems with photo capture on HoloLens by now but I didn't found anything about this behavior at the moment.

If we have to wait to have it fixed, is there a workaround ? Like using the UWP API maybe ?

Here is my configuration:
Unity 2017.4.11f1 LTS
Scripting runtime : .NET 4.6
Windows SDK: 10.0.17134.0
Hololens OS: RS4 update

[Unity] TakePhotoAsync only working once

$
0
0

Hello,

I have a very strange behavior with the locatable camera API on Hololens.
When I trigger capture.TakePhotoAsync, the callback is only called once. On the second time I trigger it, the callback is never called and the opened thread never seems to be closed, it looks like TakePhotoAsync keeps on running. The debugger even failed to close :

However it is working perfectly in the editor.

Here is my code :

using System;
using System.Collections;
using System.Linq;
using HoloToolkit.Unity.InputModule;
using HoloToolkit.Unity;
using UnityEngine;
using UnityEngine.XR.WSA.WebCam;

/// <summary>
/// Manages taking and saving photos.
/// </summary>
public class PhotoManager : Singleton<PhotoManager>
{
    /// <summary>
    /// Actual camera instance.
    /// </summary>
    private PhotoCapture capture;

    /// <summary>
    /// True, if the camera is ready to take photos.
    /// </summary>
    public bool isReady { get; private set; }
    public Resolution resolution { get; private set; }

    #region EVENTS
    public event Action<bool> OnCaptureReady;
    public event Action OnCaptureOff;
    #endregion

    private Coroutine launchedStartCapture;
    private CameraParameters cameraParameters;

    protected override void Awake()
    {
        base.Awake();
        isReady = false;
        // This resolution guarantee that it will have holograms in the whole picture
        resolution = PhotoCapture.SupportedResolutions.OrderByDescending(res => res.width * res.height).ElementAt(1);
        cameraParameters = new CameraParameters(WebCamMode.PhotoMode)
        {
            hologramOpacity = 1.0f,
            cameraResolutionWidth = resolution.width,
            cameraResolutionHeight = resolution.height,
            pixelFormat = CapturePixelFormat.BGRA32
        };
    }

    private void OnDisable()
    {
        StopCapture();
    }

    public void StartCapture(Action<bool> callback = null)
    {
        if (launchedStartCapture != null)
        {
            StopCoroutine(launchedStartCapture);
        }

        launchedStartCapture = StartCoroutine(StartCaptureCoroutine(callback));
    }

    private IEnumerator StartCaptureCoroutine(Action<bool> callback = null)
    {
        bool stopped = false;
        StopCapture(res => stopped = true);

        yield return new WaitUntil(() => stopped);

        if (WebCam.Mode != WebCamMode.None)
        {
            Debug.LogErrorFormat(this, "Can't activate capture, webcam is already in mode {0}", WebCam.Mode);
            if (callback != null) callback(false);
            yield break;
        }

        if (ExakisTools.Utils.HoloLensHelpers.IsStreaming())
        {
            Debug.LogErrorFormat(this, "Can't activate capture, application is in currently streaming");
            if (callback != null) callback(false);
            yield break;
        }

        PhotoCapture.CreateAsync(true, captureObject =>
        {
            capture = captureObject;

            capture.StartPhotoModeAsync(cameraParameters, res => this.OnPhotoModeStarted(res, callback));
        });
    }

    private void OnPhotoModeStarted(PhotoCapture.PhotoCaptureResult result, Action<bool> callback)
    {
        isReady = result.success;
        if (OnCaptureReady != null) OnCaptureReady(isReady);
        if (isReady)
        {
            callback?.Invoke(true);
            // [Quick Fix] Hologramms are not shown on first picture
            // capture.TakePhotoAsync((photoResult, photoCaptureFrame) =>
            // {
            //     photoCaptureFrame.Dispose();
            //     photoCaptureFrame = null;
            //     callback?.Invoke(true);
            // });
            Debug.Log("Camera ready");
        }
        else
        {
            Debug.LogErrorFormat(this, "Failed to activate capture, if you are streaming, please remove it, reason : {0}", result.resultType);
        }
    }

    /// <summary>
    /// Take a picture if the capture is on
    /// </summary>
    /// <param name="photoTaken"> Callback when the picture is taken </param>
    public void TakePhoto(Action<Texture2D> photoTaken = null)
    {
        if (isReady)
        {
            UnityEngine.XR.WSA.HolographicSettings.SetFocusPointForFrame(CameraCache.Main.transform.TransformPoint(0, 0, 1f), -CameraCache.Main.transform.forward);
            capture.TakePhotoAsync((result, photoCaptureFrame) =>
            {
                if (result.success)
                {
                    Texture2D targetTexture = new Texture2D(resolution.width, resolution.height, TextureFormat.BGRA32, false);
                    photoCaptureFrame.UploadImageDataToTexture(targetTexture);
                    photoCaptureFrame.Dispose();
                    photoTaken.Invoke(targetTexture);
                }
                else
                {
                    Debug.LogErrorFormat("Failed to take photo {0}", result.hResult);
                }
            });
        }
        else
        {
            Debug.LogWarning("The camera is not yet ready.");
        }
    }

    /// <summary>
    /// Stop the photo mode.
    /// </summary>
    /// <param name="callback"> return true if the capture has been stopped</param>
    public void StopCapture(Action<bool> callback = null)
    {
        if (capture != null)
        {
            capture.StopPhotoModeAsync(result =>
            {
                capture.Dispose();
                capture = null;
                isReady = false;
                Debug.Log("Camera off");
                if (OnCaptureOff != null) OnCaptureOff();
                if (callback != null) callback(true);
            });
        }
        else
        {
            if (callback != null) callback(false);
        }
    }
}

I am aware there are a lot of problems with photo capture on HoloLens by now but I didn't found anything about this behavior at the moment.

If we have to wait to have it fixed, is there a workaround ? Like using the UWP API maybe ?

Here is my configuration:
Unity 2017.4.11f1 LTS
Scripting runtime : .NET 4.6
Windows SDK: 10.0.17134.0
Hololens OS: RS4 update

spatial mapping of a limited area

$
0
0

Hi all,
Is it possible to apply the spatial mapping to a selected area such as a table for example?
the idea is to select a working area (like a table) and get the spatial map of it without scanning the hole room.

migrate lotus notes contacts to outlook 2013 Using NSF to PST Tool

$
0
0

Here I am giving the amazing and trustworthy NSF to PST Converter which is available for all technical or non-technical users. This solution can easily convert Lotus Notes mailbox to Outlook application including all contacts, calendars, briefcase, tasks, emails and all other items. All Outlook editions are well-supported to operate this software like- 2010, 2011, 2013, 2016 etc. Offers a lot of extra-benefits such as batch option for unlimited NSF file conversion, PST split option to split large of PST files and so on. Free trial version is easy to opt by the user who want to check the working capacity of this application. Also, It supports all Windows versions.


办理加拿大毕业,证书374,936,141办湖首大学文,凭毕业,证

$
0
0

办理加拿大毕业,证书374,936,141办湖首大学文,凭毕业,证

办理美国毕业,证374,936,141办理美国弗吉尼亚大学本科硕士文,凭毕业,证

$
0
0

办理美国毕业,证374,936,141办理美国弗吉尼亚大学本科硕士文,凭毕业,证

【办澳洲毕业,证】MU毕业,证374,936,141办理墨尔本大学毕业文,凭

$
0
0

【办澳洲毕业,证】MU毕业,证374,936,141办理墨尔本大学毕业文,凭

Speech/voice recognition delayed since rs4 update in july 2018 on HoloLens

$
0
0

Hello together,

Our Problem:

After the RS4 Update the speech recognition takes longer than before.
Speech recognition is delayed 1 - 3 seconds after saying the keywords in contrast to instand reaction before the update.

We are using:

KeyWordManager with "Speech Input Source" and "Speech Input Handler" from HoloToolkit and an own script referencing the KeywordRecognizer within Unity.

What we checked:

We've already checked this problem with Unity 2017.3.1p3 and 2018.2.0f2, HoloToolkit 2017.1.2 and 2017.4 in various configurations.

Please help us, has anyone else the same problem or an solution?

[UWP]WebRTC issue - Hololens unable to send video offer

$
0
0

Hello,

we developed a fully working webRTC UWP environment starting from this project (https://github.com/webrtc-uwp/PeerCC/tree/Mosa/20180320-peercc-unity).
We developed a Desktop app and a HoloLens app to communicate with each other. Everything was good until we moved to a custom server (Xirsys in this case).

We then modified the Signalling script to adapt it to the new server which uses the MessageWebSocket instead of the StreamSocket that we used before with the peerccconnection_server.exe included in the sample demo.

The current scenario is:
-Desktop connects to the server and waits for peers.
-Hololens connects to the server and is added to the available peers' list.
-Desktop can now call the Hololens and start communicating.

Hololens should send both audio and video, while Desktop only sends audio.

The actual problem now is the hololens is not able to send the video offer, so the app freezes and crashes. Audio is still working fine (just a few secs before the crash).
If we try communicating between two Desktop clients everything works like a charm.

It would be appreciated some help to solve the problem.

How to make a door open vertically but still stay attached to the object.

$
0
0

Hello everyone,

I am very new to unity and am currently using Hololens. I wanted to on click have the Sls Mercedes doors open which open vertically like a butterfly. I know how to do it on click but I don’t know how to create the animation because when I rotate the door up the whole door rotated and the top part that is supposed to be attached to the body of the car is not attached and also moves.

Is there any way I could attach the door to the main body of the car to have it open vertically like a butterfly but only have half the door rotate up and the other half stays fixed?

Thank you

Connect HoloLens with companion app via USB

$
0
0

It would be super nice if one could connect the HoloLens with the comapnion app via USB.
Is this feature maybe already planned or in discussion?
Especially when doing live MRC and having an app that's switching networks, because the live capture interupts logically when switching the Lens to another WiFi network...


HoloLens can't connect to Win10 WiFi Hotspot of Laptop

$
0
0

Hi there,
I updated my Hololens to the October Update some days ago.
Now, if I set up a WiFi Hotspot on my Win10 laptop, the HoloLens won't connect to this hotspot anymore. It tries for a few seconds, then tells me "can't connect to this network".
I also tried this using other Win10 PCs, with the same result.
With the older April Update, the connection would work without any errors.
Is this a known issue?
It's pretty urgent that this gets fixed (in my opinion), as it is the most stable and fastest way to do a live mixed reality capture.
Help is appreciated! :-)

Thank you!

GPS Repositioning

$
0
0

I'm trying to have Holograms be placed based on GPS location, and I've managed to reliably bring in a stream of GPS data into my application. The problem I keep running into is that the formula I'm using to convert from latitude, longitude, and altitude to Cartesian for Unity seems to be incorrect. I'm pretty terrible at GIS, so I was wondering if anyone had some ideas on what to use. There's got to be some universal formula everyone uses, right?!?

Here's the code I'm using:
`Vector3 WGS84ToCartesian(float lat, float lon, float h)
{
float earthRadius = 6378137.0f;

    float cosLat = Mathf.Cos(lat * Mathf.PI / 180.0f);
    float sinLat = Mathf.Sin(lat * Mathf.PI / 180.0f);
    float cosLon = Mathf.Cos(lon * Mathf.PI / 180.0f);
    float sinLon = Mathf.Sin(lon * Mathf.PI / 180.0f);

    float f = 1.0f / 298.257224f;
    float C = 1.0f / Mathf.Sqrt(cosLat * cosLat + (1 - f) * (1 - f) * sinLat * sinLat);
    float S = (1.0f - f) * (1.0f - f) * C;

    float x = (earthRadius * C + h) * cosLat * cosLon;
    float y = (earthRadius * C + h) * cosLat * sinLon;
    float z = (earthRadius * S + h) * sinLat;

    return new Vector3(x, y, z);
}`

Replacing Hololens Camera Position

$
0
0

Is it at all possible for me to simulate the Hololens Camera moving in a way I specify? For example, could I decrement the y value in a manner so as to make it look like the user is going down? I've tried to make this happen, but it doesn't seem to work.

Location Tracking

$
0
0

When I get a significant distance away, I always have difficulty keeping my holograms from drifting. It doesn't seem to matter whether I use anchors or not. Could I perhaps solve this situation by reading in GPS data near the Hololens, and using that to update my position?

NSF to PST Converter

$
0
0

Now it is very easy to access Lotus Notes data or emails into Outlook mail client, it is possible with a perfcet conversion application like NSF to PST Converter. This is really very proficient and affordable third party conversion tool that easily transfer all NSF files of Lotus Notes to Outlook PST format without altering any data.

You can get more details about the tool here :- http://recoverygadget.com/nsf-to-pst-converter-tool.html

Viewing all 10543 articles
Browse latest View live