appoly / ARCore-Location

Allows items to be placed within the AR world with real-world GPS coordinates using ARCore.
https://www.appoly.co.uk/arcore-location/
MIT License
478 stars 154 forks source link

Objects refreshing and changing position every time #83

Open shahparth99999 opened 5 years ago

shahparth99999 commented 5 years ago

I have to plot nearby banks, I am taking that details using Google API but when I tried to plot these objects it sizes gets increased and it changing its position all the time.

I want to plot objects as fixed. when I place one object it must be fixed. If I rotate my camera 360 degrees still object should remain fixed at one place. Here it is not happening. can you please help me on this?

edofritz commented 5 years ago

Same problem

aminejbr commented 5 years ago

Same problem , please let us know if anyone found a solution

M-Sardari commented 5 years ago

same problem!

Girrajjangid commented 5 years ago

Failed to resolve: com.github.appoly:ARCore-Location:1.0.6 Can anyone here help me to resolve this? I can't able to download this dependency

brako commented 5 years ago

Failed to resolve: com.github.appoly:ARCore-Location:1.0.6 Can anyone here help me to resolve this? I can't able to download this dependency

you can see here the last version: 1.1.2 The version 1.0.6 doesn't exist.

Any way for the issue here I can see two possible problems in LocationScene

Here:

float zRotated = (float) (z * Math.cos(rotation) - x * Math.sin(rotation));
float xRotated = (float) -(z * Math.sin(rotation) + x * Math.cos(rotation));

rotation should be in radians not in degrees.

And Here:

Anchor newAnchor = mSession.createAnchor(
                            frame.getCamera().getPose()
                                    .compose(Pose.makeTranslation(xRotated, y + (float) heightAdjustment, zRotated)));

unsing frame.getCamera().getDisplayOrientedPose() instead of frame.getCamera().getPose() seem to be a better choice for me. At least it's not moving around anymore.

edofritz commented 5 years ago

Failed to resolve: com.github.appoly:ARCore-Location:1.0.6 Can anyone here help me to resolve this? I can't able to download this dependency

you can see here the last version: 1.1.2 The version 1.0.6 doesn't exist.

Any way for the issue here I can see two possible problems in LocationScene

Here:

float zRotated = (float) (z * Math.cos(rotation) - x * Math.sin(rotation));
float xRotated = (float) -(z * Math.sin(rotation) + x * Math.cos(rotation));

rotation should be in radians not in degrees.

And Here:

Anchor newAnchor = mSession.createAnchor(
                            frame.getCamera().getPose()
                                    .compose(Pose.makeTranslation(xRotated, y + (float) heightAdjustment, zRotated)));

unsing frame.getCamera().getDisplayOrientedPose() instead of frame.getCamera().getPose() seem to be a better choice for me. At least it's not moving around anymore.

Any pull request?

lucagrana commented 4 years ago

I have to plot nearby banks, I am taking that details using Google API but when I tried to plot these objects it sizes gets increased and it changing its position all the time.

I want to plot objects as fixed. when I place one object it must be fixed. If I rotate my camera 360 degrees still object should remain fixed at one place. Here it is not happening. can you please help me on this?

You can download the zip of the library. Then import module in your app. After doing that you can increase ANCHOR_REFRESH_INTERVAL in LocationScene.java Object change position every time couse they refresh every 8 seconds

shawntai commented 4 years ago

Failed to resolve: com.github.appoly:ARCore-Location:1.0.6 Can anyone here help me to resolve this? I can't able to download this dependency

you can see here the last version: 1.1.2 The version 1.0.6 doesn't exist.

Any way for the issue here I can see two possible problems in LocationScene

Here:

float zRotated = (float) (z * Math.cos(rotation) - x * Math.sin(rotation));
float xRotated = (float) -(z * Math.sin(rotation) + x * Math.cos(rotation));

rotation should be in radians not in degrees.

And Here:

Anchor newAnchor = mSession.createAnchor(
                            frame.getCamera().getPose()
                                    .compose(Pose.makeTranslation(xRotated, y + (float) heightAdjustment, zRotated)));

unsing frame.getCamera().getDisplayOrientedPose() instead of frame.getCamera().getPose() seem to be a better choice for me. At least it's not moving around anymore.

I'm using the latest version where both of the problems you mentioned have been fixed, but my objects are still refreshing and popping around every five seconds. Any solutions? I really don't want to just explicitly set the anchorRefreshInterval to a larger number since it doesn't really solve the problem from the root. Thanks in advance!