Skip to content
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

pointcloud transformed with a constant positional and rotational offset #19

Open
mrcfschr opened this issue Aug 16, 2021 · 4 comments
Open

Comments

@mrcfschr
Copy link

mrcfschr commented Aug 16, 2021

Thank you for this amazing project!
I have a quick question: When I use the unity sample, the point cloud of objects within 1m distance is often transformed with what seems to be a constant positional and rotational offset that sometimes changes after stopping the stream using the provided UI and closing/restarting the app. After several subsequent iterations of stopping the stream and closing/restarting the app while not restarting the device, the problem goes away but seems to come back randomly. Otherwise, it works perfectly fine.. ?
Could someone advise where I'm going wrong? The transform from the depth sensor to the rig node in HL2ResearchMode.cpp as shown in debug mode makes sense I think and no other transforms are introduced in ResearchModeVideoStream.cs or PointCloudRenderer.cs. I feel like I'm missing something obvious? I'll keep debugging and make a more formal report if the problem persists but I just wanted to reach out beforehand to see if someone has had the same issue.

@petergu684
Copy link
Owner

How large the offset could be? I know there is several centimeter offset in the depth value for those point cloud but in plane position (x-y) looks fine on my device.
Maybe try the following to obtain the unity origin?

IntPtr WorldOriginPtr = UnityEngine.XR.WindowsMR.WindowsMREnvironment.OriginSpatialCoordinateSystem;
var unityWorldOrigin = Marshal.GetObjectForIUnknown(WorldOriginPtr) as Windows.Perception.Spatial.SpatialCoordinateSystem;

@luohwu
Copy link

luohwu commented Aug 16, 2022

Hi mrcfschr, @mrcfschr

I hope that you are doing well. Did you solve this problem? I encounter the same problem. Would you mind sharing your solution? Thanks in advance!

@mrcfschr
Copy link
Author

mrcfschr commented Aug 16, 2022

we did solve it but I'm unfortunately not allowed to share our code since it's for a company not research :/ It's definitely very possible

@mrcfschr mrcfschr reopened this Aug 16, 2022
@luohwu
Copy link

luohwu commented Aug 16, 2022

Hi mrcfschr,
Thanks for your reply. I just solved it. Turned out that my collegue modified unityWorldOrigin and researchMode.SetReferenceCoordinateSystem(unityWorldOrigin); into a wrong value.

For people who might encounter the same problem in the future:
make sure you configure them correctly accoridng to your unity version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants