Weird position values from object detection

Hi,

when I was comparing the position values (z) of the detected objects from the detection via the SDK and the detection via ROS I got two different results using one and the same .svo file for both detections.

These are the first n printed results of the .svo file via SDK (this is how it should be):

std::cout << "Depth: " << abs(obj.position.z / 1000.0f) << std::endl;

Depth: 1.07848
Depth: 1.07824
Depth: 1.07874
Depth: 1.07873
Depth: 1.07864
Depth: 1.07886
Depth: 1.07869
Depth: 1.07844
Depth: 1.07853
Depth: 1.07817
Depth: 1.07752
Depth: 1.07694
Depth: 1.07689
Depth: 1.07673
Depth: 1.07628
Depth: 1.07538
Depth: 1.07479
Depth: 1.07376
Depth: 1.07291
Depth: 1.07185
Depth: 1.07151
Depth: 1.0708
Depth: 1.07009
Depth: 1.06916
Depth: 1.06801
Depth: 1.06735
Depth: 1.06603
Depth: 1.06502
Depth: 1.06345
Depth: 1.05945
Depth: 1.05394
Depth: 1.04656
Depth: 1.03649
Depth: 1.02712
Depth: 1.02216
Depth: 1.02138
Depth: 1.02069
Depth: 1.01313
Depth: 0.994924
Depth: 0.971056
Depth: 0.942568
Depth: 0.911416
Depth: 0.88106
Depth: 0.851898
Depth: 0.822558
Depth: 0.79361
Depth: 0.747585
Depth: 0.689831
Depth: 0.634296
Depth: 0.580207
Depth: 0.602579
Depth: 0.62471
Depth: 0.64682
Depth: 0.657394
Depth: 0.667628
Depth: 0.687241
Depth: 0.674795
Depth: 0.677078
Depth: 0.679438
Depth: 0.681774
Depth: 0.684157
Depth: 0.686513
Depth: 0.688808
Depth: 0.691142
Depth: 0.693469
Depth: 0.695776
Depth: 0.698102
Depth: 0.700411
Depth: 0.702687
Depth: 0.704982

and these are the first n printed results of the svo file via ROS (this is how it should not be):

std::cout << "Depth: " << abs(msg->objects[i].position[2] / 1000.0f) << std::endl;

Depth: 0.000103486
Depth: 0.000103309
Depth: 0.00010312
Depth: 0.000102938
Depth: 0.00010276
Depth: 0.000102598
Depth: 0.000102451
Depth: 0.000102312
Depth: 0.000102166
Depth: 0.000102026
Depth: 0.000101904
Depth: 0.000101792
Depth: 0.000101681
Depth: 0.000101581
Depth: 0.000101485
Depth: 0.000101402
Depth: 0.000101334
Depth: 0.000101267
Depth: 0.000101205
Depth: 0.000101156
Depth: 0.000101108
Depth: 0.000101063
Depth: 0.000101023
Depth: 0.000100979
Depth: 0.000100918
Depth: 0.000100854
Depth: 0.000100778
Depth: 0.00010068
Depth: 0.000100534
Depth: 0.000100342
Depth: 0.000100151
Depth: 9.99458e-05
Depth: 9.97573e-05
Depth: 9.96037e-05
Depth: 9.93923e-05
Depth: 9.90202e-05
Depth: 9.83604e-05
Depth: 9.72727e-05
Depth: 9.57837e-05
Depth: 9.386e-05
Depth: 9.16351e-05
Depth: 8.92684e-05
Depth: 8.65171e-05
Depth: 8.3362e-05
Depth: 7.96773e-05
Depth: 7.57106e-05
Depth: 7.3173e-05
Depth: 7.13767e-05
Depth: 7.00966e-05
Depth: 6.89761e-05
Depth: 6.8013e-05
Depth: 6.60525e-05
Depth: 6.25159e-05
Depth: 5.80444e-05
Depth: 4.12494e-05
Depth: 3.56129e-05
Depth: 3.01347e-05
Depth: 2.48132e-05
Depth: 1.97225e-05
Depth: 1.47626e-05
Depth: 9.92342e-06
Depth: 5.31923e-06
Depth: 8.09331e-07
Depth: 3.63578e-06
Depth: 7.8407e-06
Depth: 1.20167e-05
Depth: 1.60194e-05
Depth: 1.98556e-05
Depth: 2.36151e-05
Depth: 2.72549e-05

It seems the values from ROS are shown different than the values from the SDK. But maybe the depth values are correct in both cases only that the values are displayed differently, but I have no idea why.

Thanks in advance!

Hi @hetachXORw
are you using the same DEPTH mode?

Hi @Myzhar ok I was able to fix the problem now. The main mistake was that in ROS the coordinate system has to be taken into account. That’s why the call was wrong and should be like this:

std::cout << "Depth: " << abs(msg->objects[i].position[0]) << std::endl;

1 Like