-
Notifications
You must be signed in to change notification settings - Fork 489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Anchors Drifting #157
Comments
This looks like the expected behaviour, the system seemed to update the anchor position to restore to the correct position at the end. Just so you know aframe already has a built in hit-test component: https://aframe.io/docs/1.3.0/components/ar-hit-test.html |
Hi @AdaRoseCannon, When I try the "same" experiment with the Does it mean that if I use webXR and threeJS only, I'd see the same thing happen? |
Were the red and blue box anchors created from hit test results? |
The red and blue boxes are anchors but are created relative to the main anchor. Once I place the main anchor I use its The main idea with this is to try to |
Right that's your issue, the system's understanding of the scene itself doesn't maintain consistent size as it learns more about the environment so you need multiple anchors so the system can track those points as the system evolves. |
One more thing to try: before placing main anchor, can you walk around to the fixture markers and back? I wonder if the system didn't have enough data at the time you created the fixture anchors (fixtures seem to be rendered as if they are below ground, but w/o depth-based occlusion w/ the real world it's hard to tell). |
@AdaRoseCannon Do you mean multiple anchors from hit test results? Because I thought of that and Option1: Option2: Thanks for helping guys, much appreciated. |
I think you can try the existing code w/o any changes - I'm mostly curious if the current issue is because when you are placing the fixture anchors, the part of the environment that they are supposed to be in is not yet very well understood by the underlying system. I re-watched the video, and yup, all the anchors seem to initially be below the ground - main anchor gets fixed up at the end of the video, but others aren't (since they were not created based off of a hit-test result so they don't know they should "track" the ground). |
Thanks @bialpio for putting it so well. I am on my phone. |
In short, using a single anchor to place objects throughout a large space would only work if the AR system has a rigid global coordinate system, but that's not how ARCore (or other similar tracking systems) work. Think of the AR system's world model as being made of rubber, and that model gets deformed and stretched during a session as it receives additional data and improves its understanding. Anchors based on hit test results correspond to pins placed where the hit test happened. These points will move along with their local piece of the rubber model. That's why it's important to use anchors close to where you are placing augmented objects. If you use a distant anchor to place an object, imagine that the object is connected to that anchor's pin with a long stick, and that will obviously wobble around as the rubber model deforms. I guess this analogy is a bit of a stretch (pun intended), but I hope it helps build a better mental model of what's happening. |
Hey Guys, this is another attempt at trying to This is what I try to do in the video below (all the way down). I drop 400 anchors as I get a HitTestResults object (to map the space better). Then I use this piece of code to place my boxes relative to the main anchor position. createOffsetAnchor: async function (frame, fixtureData) {
const { fx, fy, fz } = fixtureData.origin;
const { x: ax, y: ay, z: az } = this.mainAnchorPose.position;
const { x, y, z } = { x: ax + fx, y: ay, z: az + fz };
let anchorFixture = await frame.createAnchor(
new XRRigidTransform({ x, y, z }, { x: 0, y: 0, z: 0, w: 1 }),
this.refSpace
);
this.anchoredObjects.push({
id: fixtureData.id,
anchor: anchorFixture,
});
} so either:
I'm willing to try other options. Screen_Recording_20221006-120959_Chrome.mp4 |
Hi guys,
I have been trying to implement a fairly simple example using hit-test and anchors to display elements in the real world.
somehow I have been struggling with making anchors stick to the real world.
When I get close to the boxes(which are also anchors) they seem to be in place but as I step back they seems to drift pretty significantly.
I've attached a video to show the issue I'm facing and also a snippet of code. The question is simple am I missing something or is this expected beahvior?
Screen_Recording_20221005-155854_Chrome.mp4
The text was updated successfully, but these errors were encountered: