SDK 0.6 Fix the Cube at a certain distance from the user

Hi @thorsten.steparsch

Does it look anything like the video in this thread (MKII Sensor Bounding Box Drift)?

If so, I think the consensus opinion is this is a bug with the new SDK/hardware, with no obvious or quick fix at the present time. We are collectively waiting on verdict and/or assistance from Occipital.

-Andy W

1 Like

GLKMatrix4 iOSColorFromDepthExtrinsics = [depthFrame iOSColorFromDepthExtrinsics];

Is equivalent to:

GLKMatrix4 colorCameraPoseInDepthCoordinateSpace;
[depthFrame colorCameraPoseInDepthCoordinateFrame:colorCameraPoseInDepthCoordinateSpace.m];

Hi @andy.warwick

no it is just a one time hopping to the right, then the Box is fixed again.

When debugging SampleScanner App with the Changes from Jim via XCode i can see that this hopping happens when this line of code is applied in file in method (BOOL) presentFramebuffer:

success = [context presentRenderbuffer:GL_RENDERBUFFER];

In addition to that, today i recognized, that in the first case of Scanning the hopping is just small. then when i hit the restart button (not have pressed Done Button) and now hit the Scan Button again, the hopping is a lot more than before. If you do this again, the hopping is small again, than again big and so on…

Here i’ve uploaded the Video Hopping

In the end, now I’m really confused.

1 Like

I too get a one-time-hopping while trying to implement this fixed stuff with the new SDK.

Except mine jumps to the left and actually shrinks by half volume…I have a feeling I’m over-applying the offset values to the bounding box rendering (dividing x & y by 2 for the cubePose). I’ve been moving alot of stuff around - I too have little understanding of what I have done, taking notes - but I think that I am mis-applying/extra-applying that offset at the enterScanningState phase. I can get it to shrink again and again (more and more) by restarting the scanning process - it just keeps shrinking and moving to the left. So my theory is these one-time-hops occur at the moment of scanning and the mis-applied offset is compounding on each restarted scan. Hope this helps.

@andy.warwick and just to confirm, I really appreciated seeing your documentation of the Bounding Box Drift! I am experiencing that as well! I believe these are separate issues though they could be related in some way. For me the Bounding Box Drift is more chronic/passively always occuring - it seems to be affected by which kSTCameraPoseInitializerStrategyKey I use (mine is STCameraPoseInitializerStrategyGravityAlignedAtOrigin which I can confirm is drifting the bounding box with the new sensor)


Looks like using the new 10.3 SDK, along with using STCameraPoseInitializerStrategyTableTopCube, helps a lot with the drift. I can get scans out of the new hardware now without in happening every time.

Unsure if that key alone fixed it, if it’s the new SDK, or it’s something else I have changed.

Just hope I haven’t jinxed it. :wink:

-Andy W

1 Like

Had anybody a Chance to have a look on the hopping stuff? I’ll try nearly anything without having any success. :frowning:

Finally had a moment to look at your video, that behavior is quite repeatable! Are you using the low level scanner sample as a starting point?


I’m using the Scanner App from the Samples folder in the SDK, not the LowLevel Samples.


Has anyone found a solution to the one-time-hopping box? Its happening to me too where when enterScanningState is called, the scanning box bounces slightly to the right and then remains fixed.

Unfortunately at all, i don’t know the reason for the bouncing/hopping whatever.

Could you try to adjust your enterScanningState method with those two lines directly after the setupMapper call:

_slamState.initialDepthCameraPose = _slamState.cubePose;

_slamState.tracker.initialCameraPose = _slamState.initialDepthCameraPose;

it seemed that in my case it helps that the hopping is avoided. But, as mentioned, i don’t know why.
Now i have a different problem, so that the Cube isn’t directly in the middle anymore.

Maybe this helps you, maybe not.


In ViewController+OpenGL.m -> renderSceneForDepthFrame() when in ScannerStateCubePlacement:
_slamState.cubePose = GLKMatrix4Multiply(cameraViewpoint, iOSColorFromDepthExtrinsics);

When you enterScanCube set _slamState.tracker.initialCameraPose = _slamState.cubePose

If you scanning cube jumps, you are not initializing the tracker’s initialCameraPose correctly.