Problems with imprecise prefab

Include the following details (edit as applicable):

  • Issue category: Semantic Segmentation / Multiplayer / Real-time Mapping-Depth / ARDK Documentation / Unity Example Package / Sample App aka ‘AR Voyage’ / ARDK Virtual Studio Tools / Developer Tools / Networking / VPS
  • Device type & OS version: iOS iPhone 13
  • Host machine & OS version: Mac
  • Issue Environment : On Device
  • Xcode version: newest (13 i think)
  • ARDK version: 2.1
  • Unity version: 2021.3

Description of the issue:

Hi there,

i am currently experimenting with georeferenced POI with Lightship, and while testing I noticed problems with the accurate placement of prefabs in the surroundings.

To test this behavior, I placed four differently colored prefabs along the x- and z-axis (eg: Vector3(1, 0, 0)) and recorded if they are placed correctly. I expected the prefabs to be placed along the coordinate system of a horizontally placed phone (x-axis from the center to the top of the screen; z-axis from the center to the left of the screen) but they where always a little shifted:

As you can see on the picture, I am facing in the direction of approx. 158° (measured by the compass). The top angle is the angle recorded during opening of the app, the bottom one is the current angle updated every frame. I am looking in the exact same direction as in the beginning when the app was opened, but the green cube is not placed along the black line where it should be, if the placement along the x-axis would have worked, but to the left of it along the red line.

Does anyone know how accurate the prefab placement and displaying is? Am I making any mistakes with the coordinate system? Are there any options (without VPS) to place objects more accurately around the user?

Just for the information: I am using Depth and Segmentation (sky)

Thanks for your help,
Josef

Hello Josef,

To learn about how to place an object into the scene, please refer to the Basic placement tutorial.

Basically, the ARHitTester.cs script will create an instance of the PlacementObjectPf GameObject at the tapped location.
To introduce an onset to the instantiated object’s location, you need to modify the ARHitTester.cs script.
Please follow the steps for how to modify ARHitTester.cs script from this community post.

Please let me know if this helps.

Hi,

I meant something different. My placement of prefabs doesnt run via HitTester/Plane detection, but simply by instatiatiang a prefab at runtime. The problem is/was, that the phones crs is not as accurate when used horizontally, so if I instantiate prefabs at runtime they are not created at the local coordinates I wish them to be (in the picture, the green cube should be along the black line (floating in the air)).

I wondered if the ARDKs classes might influence the initial placement of objects and/or the local coordinate system created by unity when one starts the app?