MixedRealityToolkit-Unity icon indicating copy to clipboard operation
MixedRealityToolkit-Unity copied to clipboard

Planefinding api returns real world floor with some offset

Open shubham-bitsnbytes opened this issue 8 years ago • 7 comments

Issue: I am using SurfaceMeshesToPlane class from Holotoolkit to get the real world floor. I have noticed that floor is always returned with some offset: i.e. when i draw a cursor on detected floor or select a point, it always shows at some height above floor or some depth below the real floor.

Expected: Real world floor and HL detected floor should be as close as possible [5-10 cm offset acceptable].

Query: Do we need to adjust some parameter. [Urgent]

Unity Editor Version

Unity 2017.2.1p4

Mixed Reality Toolkit Release Version

shubham-bitsnbytes avatar Jun 12 '18 05:06 shubham-bitsnbytes

10cm seems like a lot of offset between the real floor and HL floor. You could have a look at the cursor, it also has a parameter that separates it from the surface it sticks to, that will give you back about 2cm (from default values).

ghost avatar Jun 12 '18 09:06 ghost

Can you please point me to which cursor script you are pointing to @JoseSantano-ms if not (https://github.com/Microsoft/MixedRealityToolkit-Unity/blob/master/Assets/HoloToolkit/Input/Scripts/Cursor/Cursor.cs) ? Thanks a lot in advance.

shubham-bitsnbytes avatar Jun 12 '18 09:06 shubham-bitsnbytes

Sure. On that exact same file, line 59. SurfaceCursorDistance: The distance from the hit surface to place the cursor

You should be able to edit that field from the editor

ghost avatar Jun 12 '18 09:06 ghost

Apologies. I don't use this cursor. I have custom made cursor and i have made sure to keep the y-value 0. similar to the script you referenced. https://github.com/Microsoft/MixedRealityToolkit-Unity/blob/master/Assets/HoloToolkit/SpatialMapping/Scripts/SpatialProcessing/PlaneFinding.cs I am using the function called FindPlane at line 161. Are you aware the best parameters should we pass to get the floor plane very close to the ground.? Thanks @JoseSantano-ms

shubham-bitsnbytes avatar Jun 12 '18 10:06 shubham-bitsnbytes

As far as I'm aware this will find a plane on the mesh, not move the mesh closer to the actual floor and then create a plane. To the Hololens the mesh is the floor and it does a good job sticking to it.

The problem here is that the mesh always has some offset from the physical floor (most of the times above and sometimes beneath) and there isn't much we can do about it. However that offset isn't 10cm, if you're experiencing that then there's something else wrong with your scene.

Given that you've written your own cursor and you've also reported that the cursor isn't where you expect it to be I'm going to ask the obvious question. Have you tried with a simple ray or one of the given cursors? Do you get the same position?

ghost avatar Jun 12 '18 10:06 ghost

Will check that and come back. So far, i am trying to play around with parameters in PLanefinding(https://github.com/Microsoft/MixedRealityToolkit-Unity/blob/master/Assets/HoloToolkit/SpatialMapping/Scripts/SpatialProcessing/PlaneFinding.cs) & surface plane (https://github.com/Microsoft/MixedRealityToolkit-Unity/blob/master/Assets/HoloToolkit/SpatialMapping/Scripts/SpatialProcessing/SurfacePlane.cs) to getter better floor.

Thanks

shubham-bitsnbytes avatar Jun 12 '18 14:06 shubham-bitsnbytes

Closing issues older than 180 days. If this is still an issue, please reactivate with recent information.

wiwei avatar Apr 11 '19 20:04 wiwei