PointCloudLibrary / pcl

Point Cloud Library (PCL)
https://pointclouds.org/
Other
10.04k stars 4.62k forks source link

[tests] One test failing on OpenBSD #6178

Open thyssentishman opened 4 days ago

thyssentishman commented 4 days ago

I have a finished port of pcl on OpenBSD and all tests are passing except the following one (apologies for the long code-block, for some reason the <details> block wasn't working):

67/131 Testing: filters_sampling
67/131 Test: filters_sampling
Command: "/usr/ports/pobj/pcl-1.14.1/build-amd64/test/filters/test_filters_sampling" "/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/sac_plane_test.pcd" "/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/cturtle.pcd"
Directory: /usr/ports/pobj/pcl-1.14.1/build-amd64/test/filters
"filters_sampling" start time: Nov 23 15:05 CET
Output:
----------------------------------------------------------
[==========] Running 3 tests from 3 test suites.
[----------] Global test environment set-up.
[----------] 1 test from CovarianceSampling
[ RUN      ] CovarianceSampling.Filters
[       OK ] CovarianceSampling.Filters (467 ms)
[----------] 1 test from CovarianceSampling (468 ms total)

[----------] 1 test from NormalSpaceSampling
[ RUN      ] NormalSpaceSampling.Filters
[       OK ] NormalSpaceSampling.Filters (0 ms)
[----------] 1 test from NormalSpaceSampling (0 ms total)

[----------] 1 test from RandomSample
[ RUN      ] RandomSample.Filters
/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:174: Failure
The difference between (*cloud_walls)[indices[i]].x and cloud_out[i].x is 0.13532000780105591, which exceeds 1e-4, where
(*cloud_walls)[indices[i]].x evaluates to 0.746940016746521,
cloud_out[i].x evaluates to 0.8822600245475769, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:175: Failure
The difference between (*cloud_walls)[indices[i]].y and cloud_out[i].y is 0.035482000559568405, which exceeds 1e-4, where
(*cloud_walls)[indices[i]].y evaluates to 0.061050001531839371,
cloud_out[i].y evaluates to 0.096532002091407776, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:176: Failure
The difference between (*cloud_walls)[indices[i]].z and cloud_out[i].z is 0.093139998614788055, which exceeds 1e-4, where
(*cloud_walls)[indices[i]].z evaluates to 0.21504999697208405,
cloud_out[i].z evaluates to 0.12190999835729599, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:174: Failure
The difference between (*cloud_walls)[indices[i]].x and cloud_out[i].x is 0.16710007190704346, which exceeds 1e-4, where
(*cloud_walls)[indices[i]].x evaluates to 1.169700026512146,
cloud_out[i].x evaluates to 1.0025999546051025, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:175: Failure
The difference between (*cloud_walls)[indices[i]].y and cloud_out[i].y is 0.11173499748110771, which exceeds 1e-4, where
(*cloud_walls)[indices[i]].y evaluates to -0.07779499888420105,
cloud_out[i].y evaluates to 0.033939998596906662, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:176: Failure
The difference between (*cloud_walls)[indices[i]].z and cloud_out[i].z is 0.06676039844751358, which exceeds 1e-4, where
(*cloud_walls)[indices[i]].z evaluates to -0.0049254000186920166,
cloud_out[i].z evaluates to 0.061834998428821564, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:174: Failure
The difference between (*cloud_walls)[indices[i]].x and cloud_out[i].x is 0.52496999502182007, which exceeds 1e-4, where
(*cloud_walls)[indices[i]].x evaluates to 1.2644000053405762,
cloud_out[i].x evaluates to 0.7394300103187561, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:175: Failure
The difference between (*cloud_walls)[indices[i]].y and cloud_out[i].y is 0.53175699710845947, which exceeds 1e-4, where
(*cloud_walls)[indices[i]].y evaluates to -0.46367999911308289,
cloud_out[i].y evaluates to 0.068076997995376587, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:176: Failure
The difference between (*cloud_walls)[indices[i]].z and cloud_out[i].z is 0.085060000419616699, which exceeds 1e-4, where
(*cloud_walls)[indices[i]].z evaluates to 0.12296999990940094,
cloud_out[i].z evaluates to 0.20803000032901764, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:174: Failure
The difference between (*cloud_walls)[indices[i]].x and cloud_out[i].x is 0.41408997774124146, which exceeds 1e-4, where
(*cloud_walls)[indices[i]].x evaluates to 0.97210997343063354,
cloud_out[i].x evaluates to 1.386199951171875, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:175: Failure
The difference between (*cloud_walls)[indices[i]].y and cloud_out[i].y is 0.30687500536441803, which exceeds 1e-4, where
(*cloud_walls)[indices[i]].y evaluates to -0.075084999203681946,
cloud_out[i].y evaluates to -0.38196000456809998, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:176: Failure
The difference between (*cloud_walls)[indices[i]].z and cloud_out[i].z is 0.14896999672055244, which exceeds 1e-4, where
(*cloud_walls)[indices[i]].z evaluates to 0.13686999678611755,
cloud_out[i].z evaluates to -0.012099999934434891, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:174: Failure
The difference between (*cloud_walls)[indices[i]].x and cloud_out[i].x is 0.015799999237060547, which exceeds 1e-4, where
(*cloud_walls)[indices[i]].x evaluates to 1.117400050163269,
cloud_out[i].x evaluates to 1.1332000494003296, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:175: Failure
The difference between (*cloud_walls)[indices[i]].y and cloud_out[i].y is 0.58767998218536377, which exceeds 1e-4, where
(*cloud_walls)[indices[i]].y evaluates to 0.20919999480247498,
cloud_out[i].y evaluates to -0.37847998738288879, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:176: Failure
The difference between (*cloud_walls)[indices[i]].z and cloud_out[i].z is 0.27554000169038773, which exceeds 1e-4, where
(*cloud_walls)[indices[i]].z evaluates to -0.10115999728441238,
cloud_out[i].z evaluates to 0.17438000440597534, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:174: Failure
The difference between (*cloud_walls)[indices[i]].x and cloud_out[i].x is 0.17079997062683105, which exceeds 1e-4, where
(*cloud_walls)[indices[i]].x evaluates to 1.2455999851226807,
cloud_out[i].x evaluates to 1.4163999557495117, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:175: Failure
The difference between (*cloud_walls)[indices[i]].y and cloud_out[i].y is 0.49975098669528961, which exceeds 1e-4, where
(*cloud_walls)[indices[i]].y evaluates to 0.059230998158454895,
cloud_out[i].y evaluates to -0.44051998853683472, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:176: Failure
The difference between (*cloud_walls)[indices[i]].z and cloud_out[i].z is 0.23713169433176517, which exceeds 1e-4, where
(*cloud_walls)[indices[i]].z evaluates to -0.24710999429225922,
cloud_out[i].z evaluates to -0.0099782999604940414, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:174: Failure
The difference between (*cloud_walls)[indices[i]].x and cloud_out[i].x is 0.083500027656555176, which exceeds 1e-4, where
(*cloud_walls)[indices[i]].x evaluates to 1.3276000022888184,
cloud_out[i].x evaluates to 1.4111000299453735, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:175: Failure
The difference between (*cloud_walls)[indices[i]].y and cloud_out[i].y is 0.37752000987529755, which exceeds 1e-4, where
(*cloud_walls)[indices[i]].y evaluates to -0.14044000208377838,
cloud_out[i].y evaluates to -0.51796001195907593, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:176: Failure
The difference between (*cloud_walls)[indices[i]].z and cloud_out[i].z is 0.12269199639558792, which exceeds 1e-4, where
(*cloud_walls)[indices[i]].z evaluates to -0.091027997434139252,
cloud_out[i].z evaluates to 0.031663998961448669, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:174: Failure
The difference between (*cloud_walls)[indices[i]].x and cloud_out[i].x is 0.477649986743927, which exceeds 1e-4, where
(*cloud_walls)[indices[i]].x evaluates to 1.2958999872207642,
cloud_out[i].x evaluates to 0.81825000047683716, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:175: Failure
The difference between (*cloud_walls)[indices[i]].y and cloud_out[i].y is 0.021604999899864197, which exceeds 1e-4, where
(*cloud_walls)[indices[i]].y evaluates to -0.098802000284194946,
cloud_out[i].y evaluates to -0.07719700038433075, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:176: Failure
The difference between (*cloud_walls)[indices[i]].z and cloud_out[i].z is 0.42886999249458313, which exceeds 1e-4, where
(*cloud_walls)[indices[i]].z evaluates to -0.17535999417304993,
cloud_out[i].z evaluates to 0.2535099983215332, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:174: Failure
The difference between (*cloud_walls)[indices[i]].x and cloud_out[i].x is 0.04440009593963623, which exceeds 1e-4, where
(*cloud_walls)[indices[i]].x evaluates to 1.3631000518798828,
cloud_out[i].x evaluates to 1.3186999559402466, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:175: Failure
The difference between (*cloud_walls)[indices[i]].y and cloud_out[i].y is 0.071829989552497864, which exceeds 1e-4, where
(*cloud_walls)[indices[i]].y evaluates to -0.24099999666213989,
cloud_out[i].y evaluates to -0.16917000710964203, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:176: Failure
The difference between (*cloud_walls)[indices[i]].z and cloud_out[i].z is 0.054789997637271881, which exceeds 1e-4, where
(*cloud_walls)[indices[i]].z evaluates to -0.084090001881122589,
cloud_out[i].z evaluates to -0.13887999951839447, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:240: Failure
The difference between (*cloud_walls)[indices2[i]].x and cloud_out[i].x is 0.2284199595451355, which exceeds 1e-4, where
(*cloud_walls)[indices2[i]].x evaluates to 0.90428000688552856,
cloud_out[i].x evaluates to 1.1326999664306641, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:241: Failure
The difference between (*cloud_walls)[indices2[i]].y and cloud_out[i].y is 0.13600100018084049, which exceeds 1e-4, where
(*cloud_walls)[indices2[i]].y evaluates to 0.11766000092029572,
cloud_out[i].y evaluates to -0.018340999260544777, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:242: Failure
The difference between (*cloud_walls)[indices2[i]].z and cloud_out[i].z is 0.10837760381400585, which exceeds 1e-4, where
(*cloud_walls)[indices2[i]].z evaluates to 0.1030300036072731,
cloud_out[i].z evaluates to -0.0053476002067327499, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:240: Failure
The difference between (*cloud_walls)[indices2[i]].x and cloud_out[i].x is 0.28091001510620117, which exceeds 1e-4, where
(*cloud_walls)[indices2[i]].x evaluates to 1.0195000171661377,
cloud_out[i].x evaluates to 0.73859000205993652, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:241: Failure
The difference between (*cloud_walls)[indices2[i]].y and cloud_out[i].y is 0.27792400773614645, which exceeds 1e-4, where
(*cloud_walls)[indices2[i]].y evaluates to -0.011963999830186367,
cloud_out[i].y evaluates to 0.26596000790596008, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:242: Failure
The difference between (*cloud_walls)[indices2[i]].z and cloud_out[i].z is 0.06136699765920639, which exceeds 1e-4, where
(*cloud_walls)[indices2[i]].z evaluates to 0.077432997524738312,
cloud_out[i].z evaluates to 0.1387999951839447, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:240: Failure
The difference between (*cloud_walls)[indices2[i]].x and cloud_out[i].x is 0.13488996028900146, which exceeds 1e-4, where
(*cloud_walls)[indices2[i]].x evaluates to 1.0673999786376953,
cloud_out[i].x evaluates to 0.93251001834869385, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:241: Failure
The difference between (*cloud_walls)[indices2[i]].y and cloud_out[i].y is 0.38509999215602875, which exceeds 1e-4, where
(*cloud_walls)[indices2[i]].y evaluates to -0.26350998878479004,
cloud_out[i].y evaluates to 0.12159000337123871, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:242: Failure
The difference between (*cloud_walls)[indices2[i]].z and cloud_out[i].z is 0.090688005089759827, which exceeds 1e-4, where
(*cloud_walls)[indices2[i]].z evaluates to 0.16467000544071198,
cloud_out[i].z evaluates to 0.073982000350952148, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:240: Failure
The difference between (*cloud_walls)[indices2[i]].x and cloud_out[i].x is 0.1417999267578125, which exceeds 1e-4, where
(*cloud_walls)[indices2[i]].x evaluates to 1.1528999805450439,
cloud_out[i].x evaluates to 1.0111000537872314, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:241: Failure
The difference between (*cloud_walls)[indices2[i]].y and cloud_out[i].y is 0.25688101164996624, which exceeds 1e-4, where
(*cloud_walls)[indices2[i]].y evaluates to -0.27755001187324524,
cloud_out[i].y evaluates to -0.020669000223278999, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:242: Failure
The difference between (*cloud_walls)[indices2[i]].z and cloud_out[i].z is 0.025024004280567169, which exceeds 1e-4, where
(*cloud_walls)[indices2[i]].z evaluates to 0.11364000290632248,
cloud_out[i].z evaluates to 0.08861599862575531, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:240: Failure
The difference between (*cloud_walls)[indices2[i]].x and cloud_out[i].x is 0.47460001707077026, which exceeds 1e-4, where
(*cloud_walls)[indices2[i]].x evaluates to 1.1964000463485718,
cloud_out[i].x evaluates to 0.72180002927780151, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:241: Failure
The difference between (*cloud_walls)[indices2[i]].y and cloud_out[i].y is 0.37826000154018402, which exceeds 1e-4, where
(*cloud_walls)[indices2[i]].y evaluates to -0.23783999681472778,
cloud_out[i].y evaluates to 0.14042000472545624, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:242: Failure
The difference between (*cloud_walls)[indices2[i]].z and cloud_out[i].z is 0.16248800233006477, which exceeds 1e-4, where
(*cloud_walls)[indices2[i]].z evaluates to 0.055461999028921127,
cloud_out[i].z evaluates to 0.2179500013589859, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:240: Failure
The difference between (*cloud_walls)[indices2[i]].x and cloud_out[i].x is 0.094720005989074707, which exceeds 1e-4, where
(*cloud_walls)[indices2[i]].x evaluates to 0.87834000587463379,
cloud_out[i].x evaluates to 0.9730600118637085, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:241: Failure
The difference between (*cloud_walls)[indices2[i]].y and cloud_out[i].y is 0.11180000007152557, which exceeds 1e-4, where
(*cloud_walls)[indices2[i]].y evaluates to -0.21128000319004059,
cloud_out[i].y evaluates to -0.099480003118515015, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:242: Failure
The difference between (*cloud_walls)[indices2[i]].z and cloud_out[i].z is 0.1198900043964386, which exceeds 1e-4, where
(*cloud_walls)[indices2[i]].z evaluates to 0.27511000633239746,
cloud_out[i].z evaluates to 0.15522000193595886, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:240: Failure
The difference between (*cloud_walls)[indices2[i]].x and cloud_out[i].x is 0.036999940872192383, which exceeds 1e-4, where
(*cloud_walls)[indices2[i]].x evaluates to 1.086899995803833,
cloud_out[i].x evaluates to 1.0499000549316406, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:241: Failure
The difference between (*cloud_walls)[indices2[i]].y and cloud_out[i].y is 0.61370998620986938, which exceeds 1e-4, where
(*cloud_walls)[indices2[i]].y evaluates to 0.35444998741149902,
cloud_out[i].y evaluates to -0.25925999879837036, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:242: Failure
The difference between (*cloud_walls)[indices2[i]].z and cloud_out[i].z is 0.30862000584602356, which exceeds 1e-4, where
(*cloud_walls)[indices2[i]].z evaluates to -0.13671000301837921,
cloud_out[i].z evaluates to 0.17191000282764435, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:240: Failure
The difference between (*cloud_walls)[indices2[i]].x and cloud_out[i].x is 0.13580000400543213, which exceeds 1e-4, where
(*cloud_walls)[indices2[i]].x evaluates to 1.1421999931335449,
cloud_out[i].x evaluates to 1.2779999971389771, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:241: Failure
The difference between (*cloud_walls)[indices2[i]].y and cloud_out[i].y is 0.21322400495409966, which exceeds 1e-4, where
(*cloud_walls)[indices2[i]].y evaluates to 0.17111000418663025,
cloud_out[i].y evaluates to -0.042114000767469406, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:242: Failure
The difference between (*cloud_walls)[indices2[i]].z and cloud_out[i].z is 0.098091006278991699, which exceeds 1e-4, where
(*cloud_walls)[indices2[i]].z evaluates to -0.099188998341560364,
cloud_out[i].z evaluates to -0.19728000462055206, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:240: Failure
The difference between (*cloud_walls)[indices2[i]].x and cloud_out[i].x is 0.1128000020980835, which exceeds 1e-4, where
(*cloud_walls)[indices2[i]].x evaluates to 1.3722000122070312,
cloud_out[i].x evaluates to 1.2594000101089478, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:241: Failure
The difference between (*cloud_walls)[indices2[i]].y and cloud_out[i].y is 0.31408799439668655, which exceeds 1e-4, where
(*cloud_walls)[indices2[i]].y evaluates to -0.33634999394416809,
cloud_out[i].y evaluates to -0.022261999547481537, and
1e-4 evaluates to 0.0001.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/filters/test_sampling.cpp:242: Failure
The difference between (*cloud_walls)[indices2[i]].z and cloud_out[i].z is 0.2145290020853281, which exceeds 1e-4, where
(*cloud_walls)[indices2[i]].z evaluates to -0.023381000384688377,
cloud_out[i].z evaluates to -0.23791000247001648, and
1e-4 evaluates to 0.0001.

[  FAILED  ] RandomSample.Filters (6 ms)
[----------] 1 test from RandomSample (6 ms total)

[----------] Global test environment tear-down
[==========] 3 tests from 3 test suites ran. (475 ms total)
[  PASSED  ] 2 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] RandomSample.Filters

 1 FAILED TEST
<end of output>
Test time =   1.02 sec
----------------------------------------------------------
Test Failed.
"filters_sampling" end time: Nov 23 15:05 CET
"filters_sampling" time elapsed: 00:00:01
----------------------------------------------------------

Any clues? I'm compiling pcl version 1.14.1

mvieth commented 4 days ago

@thyssentishman Hi, that is interesting, thanks. My best guess is that this happens because the filter uses std::srand for seeding but rand() (not std::rand()) for drawing random numbers. Which compiler are you using? I wonder if something similar could happen in other PCL classes For reference: https://github.com/PointCloudLibrary/pcl/blob/master/test/filters/test_sampling.cpp#L148 https://github.com/PointCloudLibrary/pcl/blob/master/filters/include/pcl/filters/impl/random_sample.hpp#L66 https://github.com/PointCloudLibrary/pcl/blob/master/filters/include/pcl/filters/random_sample.h#L138

thyssentishman commented 2 days ago

Hi @mvieth. Thanks for the quick reply. I was hoping that was the issue and applied your patch from #6179 (see below) with no success.

Index: filters/include/pcl/filters/random_sample.h
--- filters/include/pcl/filters/random_sample.h.orig
+++ filters/include/pcl/filters/random_sample.h
@@ -135,7 +135,7 @@ namespace pcl
       inline float
       unifRand ()
       {
-        return (static_cast<float>(rand () / static_cast<double>(RAND_MAX)));
+        return (static_cast<float>(std::rand () / static_cast<double>(RAND_MAX)));
         //return (((214013 * seed_ + 2531011) >> 16) & 0x7FFF);
       }
   };
@@ -226,7 +226,7 @@ namespace pcl
       inline float
       unifRand ()
       {
-        return (static_cast<float> (rand () / static_cast<double>(RAND_MAX)));
+        return (static_cast<float> (std::rand () / static_cast<double>(RAND_MAX)));
       }
    };
 }

Below the compiler I'm using:

OpenBSD clang version 16.0.6
Target: amd64-unknown-openbsd7.6
Thread model: posix
InstalledDir: /usr/bin

OpenBSD's rand(3) man page says that rand()'s underlying subsystem has been modified on OpenBSD to return non-deterministic values. Additionally the following is stated:

To satisfy portable code, srand() may be called to initialize the subsystem. In OpenBSD the seed variable is ignored, and strong random number results will be provided from arc4random(3). In other systems, the seed variable primes a simplistic deterministic algorithm.

Could this be the source of the issue?

mvieth commented 2 days ago

@thyssentishman Oh okay. I was not aware that OpenBSD does that. Yes, that definitely sounds like it could cause this issue. std::srand is probably just forwarded to srand, and if srand basically does nothing on OpenBSD, then it is clear that the test fails since it relies on the seed. Honestly, to me it seems like a really bad idea for OpenBSD to intentionally break srand. It completely screws up code portability and reproducibility of results. It is widely known that rand is not a strong random number generator and that there are better alternatives both in C and C++, but why does OpenBSD not at least make srand respect a seed given by the user (to ensure reproducibility/repeatability if desired), and if srand was not called make rand behave as if a random seed was set. Sorry for the rant :smile: I am wondering though if perhaps clang and gcc should forward std::srand to srand_deterministic on OpenBSD instead.

Regarding the RandomSample filter:

thyssentishman commented 2 days ago

@mvieth I understand and I agree that this is probably not good when one is expecting reproducibility of results (as we are experiencing here). It might be good if you could bring this up for discussion on OpenBSD's tech@ mailing lists if you like.

Regarding your proposed solutions, I was expecting srand_deterministic to work, however the test #67 is still failing (whether or not I replace rand() with std::rand()).

Patch:

Index: filters/include/pcl/filters/impl/random_sample.hpp
--- filters/include/pcl/filters/impl/random_sample.hpp.orig
+++ filters/include/pcl/filters/impl/random_sample.hpp
@@ -63,7 +63,11 @@ pcl::RandomSample<PointT>::applyFilter (Indices &indic
       removed_indices_->resize (N - sample_size);

     // Set random seed so derived indices are the same each time the filter runs
+#ifdef __OpenBSD__
+    srand_deterministic (seed_);
+#else
     std::srand (seed_);
+#endif

     // Algorithm S
     std::size_t i = 0;

test_1.log

mvieth commented 2 days ago

@thyssentishman Can you try applying the same change at https://github.com/PointCloudLibrary/pcl/blob/master/filters/src/random_sample.cpp#L120 ?

thyssentishman commented 2 days ago

@mvieth yep, that did it, thank you very much :) Would you like me to create a PR or would you amend #6179? Or should I just keep these patches local to the port?

100% tests passed, 0 tests failed out of 131

Just a quick note, I seem to be getting inconsistent results with test #103 (a_registration_test) when running tests with multiple concurrent jobs e.g. make test -j8. Are tests supposed to be thread safe?

mvieth commented 2 days ago

@thyssentishman I can amend #6179

Just a quick note, I seem to be getting inconsistent results with test #103 (a_registration_test) when running tests with multiple concurrent jobs e.g. make test -j8. Are tests supposed to be thread safe?

Yes, I think so. Do you have a log of a failure?

thyssentishman commented 1 day ago

Yes, I think so. Do you have a log of a failure?

Sure, here is one:

103/131 Testing: a_registration_test
103/131 Test: a_registration_test
Command: "/usr/ports/pobj/pcl-1.14.1/build-amd64/test/registration/test_registration" "/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/bun0.pcd" "/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/bun4.pcd" "/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/milk_color.pcd"
Directory: /usr/ports/pobj/pcl-1.14.1/build-amd64/test/registration
"a_registration_test" start time: Nov 25 15:09 CET
Output:
----------------------------------------------------------
[==========] Running 13 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 13 tests from PCL
[ RUN      ] PCL.findFeatureCorrespondences
[       OK ] PCL.findFeatureCorrespondences (0 ms)
[ RUN      ] PCL.ICP_translated
/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/registration/test_registration.cpp:190: Failure
Expected: (icp.getFitnessScore()) < (1e-6), actual: 0.085357592720538375 vs 1e-06

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/registration/test_registration.cpp:193: Failure
The difference between icp.getFinalTransformation()(0, 3) and 0.7 is 0.11399365663528438, which exceeds 2e-3, where
icp.getFinalTransformation()(0, 3) evaluates to 0.58600634336471558,
0.7 evaluates to 0.69999999999999996, and
2e-3 evaluates to 0.002.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/registration/test_registration.cpp:194: Failure
The difference between icp.getFinalTransformation()(1, 3) and 0.0 is 0.022719331085681915, which exceeds 2e-3, where
icp.getFinalTransformation()(1, 3) evaluates to -0.022719331085681915,
0.0 evaluates to 0, and
2e-3 evaluates to 0.002.

/usr/ports/pobj/pcl-1.14.1/pcl-pcl-1.14.1/test/registration/test_registration.cpp:195: Failure
The difference between icp.getFinalTransformation()(2, 3) and 0.0 is 0.089967794716358185, which exceeds 2e-3, where
icp.getFinalTransformation()(2, 3) evaluates to 0.089967794716358185,
0.0 evaluates to 0, and
2e-3 evaluates to 0.002.

[  FAILED  ] PCL.ICP_translated (1 ms)
[ RUN      ] PCL.IterativeClosestPoint
[       OK ] PCL.IterativeClosestPoint (4 ms)
[ RUN      ] PCL.IterativeClosestPointWithNormals
[       OK ] PCL.IterativeClosestPointWithNormals (0 ms)
[ RUN      ] PCL.IterativeClosestPointWithRejectors
[       OK ] PCL.IterativeClosestPointWithRejectors (106 ms)
[ RUN      ] PCL.JointIterativeClosestPoint
[       OK ] PCL.JointIterativeClosestPoint (254 ms)
[ RUN      ] PCL.IterativeClosestPointNonLinear
[       OK ] PCL.IterativeClosestPointNonLinear (41 ms)
[ RUN      ] PCL.IterativeClosestPoint_PointToPlane
[pcl::IterativeClosestPoint::computeTransformation] Not enough correspondences found. Relax your threshold parameters.
[pcl::IterativeClosestPoint::computeTransformation] Not enough correspondences found. Relax your threshold parameters.
[pcl::IterativeClosestPoint::computeTransformation] Not enough correspondences found. Relax your threshold parameters.
[pcl::IterativeClosestPoint::computeTransformation] Not enough correspondences found. Relax your threshold parameters.
[pcl::IterativeClosestPoint::computeTransformation] Not enough correspondences found. Relax your threshold parameters.
[       OK ] PCL.IterativeClosestPoint_PointToPlane (6 ms)
[ RUN      ] PCL.GeneralizedIterativeClosestPoint
[       OK ] PCL.GeneralizedIterativeClosestPoint (25 ms)
[ RUN      ] PCL.GeneralizedIterativeClosestPointBFGS
[       OK ] PCL.GeneralizedIterativeClosestPointBFGS (51 ms)
[ RUN      ] PCL.GeneralizedIterativeClosestPoint6D
[       OK ] PCL.GeneralizedIterativeClosestPoint6D (50 ms)
[ RUN      ] PCL.PyramidFeatureHistogram
[       OK ] PCL.PyramidFeatureHistogram (1708 ms)
[ RUN      ] PCL.PPFRegistration
[       OK ] PCL.PPFRegistration (3047 ms)
[----------] 13 tests from PCL (5299 ms total)

[----------] Global test environment tear-down
[==========] 13 tests from 1 test suite ran. (5300 ms total)
[  PASSED  ] 12 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] PCL.ICP_translated

 1 FAILED TEST
<end of output>
Test time =   5.41 sec
----------------------------------------------------------
Test Failed.
"a_registration_test" end time: Nov 25 15:09 CET
"a_registration_test" time elapsed: 00:00:05
----------------------------------------------------------
mvieth commented 1 day ago

My first guess is that this is again related to random number generation, see here: https://github.com/PointCloudLibrary/pcl/blob/master/test/registration/test_registration.cpp#L169 ICP_translated is not tested with varying seeds, so the point cloud is always the same (except on OpenBSD). ICP is not a super stable algorithm, so I suppose it might fail for some random point clouds. I will try to come up with a solution.

thyssentishman commented 17 hours ago

@mvieth wouldn't seeding those rand() calls with srand_deterministic() be enought?