google-ar / arcore-unreal-sdk

ARCore SDK for Unreal
https://developers.google.com/ar/
Apache License 2.0
277 stars 122 forks source link

Arcore 1.2 1.4 1.6 with unreal 4.21 joystick problems #47

Closed ParaO closed 5 years ago

ParaO commented 5 years ago

I have created 1st person example map. I have built it to andorid with joysticks on. Everything works fine...BUT...when I enable Google ARCore plugin joysticks prevent looking up and down?!?!? Everything else works like it should...what can i do? Are there any google developers reading these problems...? Can Someone help me...Thanks.

bopangzz commented 5 years ago

When you use ARCore, camera position and rotation are override by ARCore tracking, which is the general behavior in AR app. What is the use case you are trying to do with ARCore and joystick work together?

ParaO commented 5 years ago

I am trying to build app with arcore and normal. 1st level should be augmented and second normal. Everything else (rotation left right and movement) works as expected but up and down is blocked. Is there a reason why it is blocked? This hapens with arcore 1.2 1.4 and 1.6...thanks for the help!

ParaO commented 5 years ago

When you use ARCore, camera position and rotation are override by ARCore tracking, which is the general behavior in AR app. What is the use case you are trying to do with ARCore and joystick work together?

ParaO commented 5 years ago

bopangzz any news from this? Main thing for us is that we could close the arsession and all tracking when going to another level. I have tried to override everything from player controls,hud,gamemode, pawn etc. with no success...

bopangzz commented 5 years ago

I can help take a look sometime next week. Can you share a simple project that could reproduce the issue? How is your pawn setup in your normal scene? Try add a camera component in the pawn blueprint and uncheck the lock to hmd option. On Mon, Jan 21, 2019 at 12:45 AM ParaO notifications@github.com wrote:

bopangzz any news from this? Main thing for us is that we could close the arsession and all tracking when going to another level. I have tried to override everything from player controls,hud,gamemode, pawn etc. with no success...

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/google-ar/arcore-unreal-sdk/issues/47#issuecomment-455991689, or mute the thread https://github.com/notifications/unsubscribe-auth/ASYXB7jE9XxjuIzjB9kEh71K8KLK_Lo9ks5vFX41gaJpZM4aHsnY .

ParaO commented 5 years ago

Thanks for the quick response. Easy way of testing it...make a firstperson template. Enable arcore plugin 1.2 1.4 or 1.6 -> compile the project and try to look up or down. all the other movements are ok. I tried disabling the lock to hmd but the results remain the same.

ParaO commented 5 years ago

Hi bopangzz. Have you tried the plugin behavior yet? Sorry for the pressure but our client is waiting for the solution. If it is a big problem (which I dont belive...) I think we need to have a look to Unity...?Thanks again!

bopangzz commented 5 years ago

Hi, sorry I dont get a chance to look at it today but I should be able to take a look tomorrow. On Tue, Jan 22, 2019 at 10:11 PM ParaO notifications@github.com wrote:

Hi bopangzz. Have you tried the plugin behavior yet? Sorry for the pressure but our client is waiting for the solution. If it is a big problem (which I dont belive...) I think we need to have a look to Unity...?Thanks again!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/google-ar/arcore-unreal-sdk/issues/47#issuecomment-456682933, or mute the thread https://github.com/notifications/unsubscribe-auth/ASYXB5CWymBMSzKSIHiF3mBVLeAsBEjtks5vF_0ZgaJpZM4aHsnY .

bopangzz commented 5 years ago

So I took a look today. It is indeed an issue in the ARCore plugin. Thank you for reporting it!

You can easily fixed this if you have source code access to the Engine code, in GoogleARCoreXRTrackingSystem.cpp, change the code in the following functions:

bool FGoogleARCoreXRTrackingSystem::IsHeadTrackingAllowed() const
{
#if PLATFORM_ANDROID
    if (ARCoreDeviceInstance->GetIsARCoreSessionRunning()) {
        return true;
    }
#endif

    return false;
}
bool FGoogleARCoreXRTrackingSystem::GetCurrentPose(int32 DeviceId, FQuat& OutOrientation, FVector& OutPosition)
{
    if (DeviceId == IXRTrackingSystem::HMDDeviceId && ARCoreDeviceInstance->GetIsARCoreSessionRunning())
    {
        OutOrientation = CachedOrientation;
        OutPosition = CachedPosition;
        return true;
    }
    else
    {
        return false;
    }
}

Basically add the check to return the pose only when ARCore Session is running.

I will make sure this got fixed in the next release.

ParaO commented 5 years ago

Thanks a lot! Works like a charm😉. I ll be waiting for new relase as well...

fredsa commented 5 years ago

Fixed in 1.9.0 https://github.com/google-ar/arcore-unreal-sdk/releases