unit-tests-live.cpp
Go to the documentation of this file.
00001 // License: Apache 2.0. See LICENSE file in root directory.
00002 // Copyright(c) 2015 Intel Corporation. All Rights Reserved.
00003 
00005 // This set of tests is valid for any number and combination of RealSense cameras, including R200 and F200 //
00007 
00008 #if !defined(MAKEFILE) || ( defined(LIVE_TEST) )
00009 
00010 #include "unit-tests-common.h"
00011 
00012 TEST_CASE( "Device metadata enumerates correctly", "[live]" )
00013 {
00014     // Require at least one device to be plugged in
00015     safe_context ctx;
00016     const int device_count = rs_get_device_count(ctx, require_no_error());
00017     REQUIRE(device_count > 0);
00018 
00019     // For each device
00020     for(int i=0; i<device_count; ++i)
00021     {
00022         rs_device * dev = rs_get_device(ctx, 0, require_no_error());    
00023         REQUIRE(dev != nullptr);
00024 
00025         SECTION( "device metadata strings are nonempty" )
00026         {
00027             REQUIRE( rs_get_device_name(dev, require_no_error()) != nullptr );
00028             REQUIRE( rs_get_device_serial(dev, require_no_error()) != nullptr );
00029             REQUIRE( rs_get_device_firmware_version(dev, require_no_error()) != nullptr );
00030         }
00031 
00032         SECTION( "device supports standard picture options" )
00033         {
00034             for(int i=RS_OPTION_COLOR_BACKLIGHT_COMPENSATION; i<=RS_OPTION_COLOR_WHITE_BALANCE; ++i)
00035             {
00036                 REQUIRE(rs_device_supports_option(dev, (rs_option)i, require_no_error()) == 1);
00037             }
00038         }
00039     }
00040 }
00041 
00043 // Test basic streaming functionality //
00045 TEST_CASE("Start-Stop stream sequence", "[live]")
00046 {
00047     // Require at least one device to be plugged in
00048     safe_context ctx;
00049     const int device_count = rs_get_device_count(ctx, require_no_error());
00050     REQUIRE(device_count > 0);
00051 
00052     std::vector<rs_stream> supported_streams;
00053 
00054     // For each device
00055     for(int i=0; i<device_count; ++i)
00056     {
00057         rs_device * dev = rs_get_device(ctx, 0, require_no_error());
00058         REQUIRE(dev != nullptr);
00059 
00060         for (int i = (int)rs_capabilities::RS_CAPABILITIES_DEPTH; i <= (int)rs_capabilities::RS_CAPABILITIES_FISH_EYE; i++)
00061             if (rs_supports(dev,(rs_capabilities)i, require_no_error()))
00062                 supported_streams.push_back((rs_stream)i);
00063 
00064         // Configure all supported streams to run at 30 frames per second
00065         for (auto & stream : supported_streams)
00066             rs_enable_stream_preset(dev, stream, rs_preset::RS_PRESET_BEST_QUALITY, require_no_error());
00067 
00068         for (int i = 0; i< 5; i++)
00069         {
00070             // Test sequence
00071             rs_start_device(dev, require_no_error());
00072             rs_stop_device(dev, require_no_error());
00073         }
00074 
00075         for (auto & stream : supported_streams)
00076             rs_disable_stream(dev,stream,require_no_error());
00077     }
00078 }
00079 
00081 // Calibration information tests //
00083 
00084 TEST_CASE( "no extrinsic transformation between a stream and itself", "[live]" )
00085 {
00086     // Require at least one device to be plugged in
00087     safe_context ctx;
00088     const int device_count = rs_get_device_count(ctx, require_no_error());
00089     REQUIRE(device_count > 0);
00090 
00091     // For each device
00092     for(int i=0; i<device_count; ++i)
00093     {
00094         rs_device * dev = rs_get_device(ctx, 0, require_no_error());    
00095         REQUIRE(dev != nullptr);
00096 
00097         for(int j=0; j<RS_STREAM_COUNT; ++j)
00098         {
00099             rs_extrinsics extrin = {};
00100             rs_error * e = nullptr;
00101             rs_get_device_extrinsics(dev, (rs_stream)j, (rs_stream)j, &extrin, &e);
00102             if (!e) // if device is not calibrated, rs_get_device_extrinsic has to return an error
00103             {
00104                 require_identity_matrix(extrin.rotation);
00105                 require_zero_vector(extrin.translation);
00106             }
00107         }
00108     }
00109 }
00110 
00111 TEST_CASE( "extrinsic transformation between two streams is a rigid transform", "[live]" )
00112 {
00113     // Require at least one device to be plugged in
00114     safe_context ctx;
00115     const int device_count = rs_get_device_count(ctx, require_no_error());
00116     REQUIRE(device_count > 0);
00117 
00118     // For each device
00119     for(int i=0; i<device_count; ++i)
00120     {
00121         rs_device * dev = rs_get_device(ctx, 0, require_no_error());    
00122         REQUIRE(dev != nullptr);
00123 
00124         // For every pair of streams
00125         for(int j=0; j<RS_STREAM_COUNT; ++j)
00126         {
00127             const rs_stream stream_a = (rs_stream)j;
00128 
00129             for(int k=j+1; k<RS_STREAM_COUNT; ++k)
00130             {
00131                 const rs_stream stream_b = (rs_stream)k;
00132             
00133                 // Extrinsics from A to B should have an orthonormal 3x3 rotation matrix and a translation vector of magnitude less than 10cm
00134                 rs_extrinsics a_to_b = {};
00135 
00136                 rs_error * e = nullptr;
00137 
00138                 rs_get_device_extrinsics(dev, stream_a, stream_b, &a_to_b, &e);
00139 
00140                 if (!e)
00141                 {
00142                     require_rotation_matrix(a_to_b.rotation);
00143                     REQUIRE( vector_length(a_to_b.translation) < 0.1f );
00144 
00145                     // Extrinsics from B to A should be the inverse of extrinsics from A to B
00146                     rs_extrinsics b_to_a = {};
00147                     rs_get_device_extrinsics(dev, stream_b, stream_a, &b_to_a, require_no_error());
00148                     require_transposed(a_to_b.rotation, b_to_a.rotation);
00149                     REQUIRE( b_to_a.rotation[0] * a_to_b.translation[0] + b_to_a.rotation[3] * a_to_b.translation[1] + b_to_a.rotation[6] * a_to_b.translation[2] == Approx(-b_to_a.translation[0]) );
00150                     REQUIRE( b_to_a.rotation[1] * a_to_b.translation[0] + b_to_a.rotation[4] * a_to_b.translation[1] + b_to_a.rotation[7] * a_to_b.translation[2] == Approx(-b_to_a.translation[1]) );
00151                     REQUIRE( b_to_a.rotation[2] * a_to_b.translation[0] + b_to_a.rotation[5] * a_to_b.translation[1] + b_to_a.rotation[8] * a_to_b.translation[2] == Approx(-b_to_a.translation[2]) );
00152                 }
00153             }
00154         }
00155     }
00156 }
00157 
00158 TEST_CASE( "extrinsic transformations are transitive", "[live]" )
00159 {
00160     // Require at least one device to be plugged in
00161     safe_context ctx;
00162     const int device_count = rs_get_device_count(ctx, require_no_error());
00163     REQUIRE(device_count > 0);
00164 
00165     // For each device
00166     for(int i=0; i<device_count; ++i)
00167     {
00168         rs_device * dev = rs_get_device(ctx, 0, require_no_error());    
00169         REQUIRE(dev != nullptr);
00170 
00171         // For every pair of streams
00172         for(int a=0; a<RS_STREAM_COUNT; ++a)
00173         {
00174             for(int b=0; b<RS_STREAM_COUNT; ++b)
00175             {
00176                 for(int c=0; c<RS_STREAM_COUNT; ++c)
00177                 {
00178                     // Require that the composition of a_to_b and b_to_c is equal to a_to_c
00179                     rs_extrinsics a_to_b, b_to_c, a_to_c;
00180                     rs_error * a_to_b_e = nullptr,* a_to_c_e = nullptr, * b_to_c_e = nullptr;
00181 
00182                     rs_get_device_extrinsics(dev, (rs_stream)a, (rs_stream)b, &a_to_b, &a_to_b_e);
00183                     rs_get_device_extrinsics(dev, (rs_stream)b, (rs_stream)c, &b_to_c, &b_to_c_e);
00184                     rs_get_device_extrinsics(dev, (rs_stream)a, (rs_stream)c, &a_to_c, &a_to_c_e);
00185 
00186                     if ((!a_to_b_e) && (!b_to_c_e) && (!a_to_c_e))
00187                     {
00188                         // a_to_c.rotation == a_to_b.rotation * b_to_c.rotation
00189                         REQUIRE( a_to_c.rotation[0] == Approx(a_to_b.rotation[0] * b_to_c.rotation[0] + a_to_b.rotation[3] * b_to_c.rotation[1] + a_to_b.rotation[6] * b_to_c.rotation[2]) );
00190                         REQUIRE( a_to_c.rotation[2] == Approx(a_to_b.rotation[2] * b_to_c.rotation[0] + a_to_b.rotation[5] * b_to_c.rotation[1] + a_to_b.rotation[8] * b_to_c.rotation[2]) );
00191                         REQUIRE( a_to_c.rotation[1] == Approx(a_to_b.rotation[1] * b_to_c.rotation[0] + a_to_b.rotation[4] * b_to_c.rotation[1] + a_to_b.rotation[7] * b_to_c.rotation[2]) );
00192                         REQUIRE( a_to_c.rotation[3] == Approx(a_to_b.rotation[0] * b_to_c.rotation[3] + a_to_b.rotation[3] * b_to_c.rotation[4] + a_to_b.rotation[6] * b_to_c.rotation[5]) );
00193                         REQUIRE( a_to_c.rotation[4] == Approx(a_to_b.rotation[1] * b_to_c.rotation[3] + a_to_b.rotation[4] * b_to_c.rotation[4] + a_to_b.rotation[7] * b_to_c.rotation[5]) );
00194                         REQUIRE( a_to_c.rotation[5] == Approx(a_to_b.rotation[2] * b_to_c.rotation[3] + a_to_b.rotation[5] * b_to_c.rotation[4] + a_to_b.rotation[8] * b_to_c.rotation[5]) );
00195                         REQUIRE( a_to_c.rotation[6] == Approx(a_to_b.rotation[0] * b_to_c.rotation[6] + a_to_b.rotation[3] * b_to_c.rotation[7] + a_to_b.rotation[6] * b_to_c.rotation[8]) );
00196                         REQUIRE( a_to_c.rotation[7] == Approx(a_to_b.rotation[1] * b_to_c.rotation[6] + a_to_b.rotation[4] * b_to_c.rotation[7] + a_to_b.rotation[7] * b_to_c.rotation[8]) );
00197                         REQUIRE( a_to_c.rotation[8] == Approx(a_to_b.rotation[2] * b_to_c.rotation[6] + a_to_b.rotation[5] * b_to_c.rotation[7] + a_to_b.rotation[8] * b_to_c.rotation[8]) );
00198 
00199                         // a_to_c.translation = a_to_b.transform(b_to_c.translation)
00200                         REQUIRE( a_to_c.translation[0] == Approx(a_to_b.rotation[0] * b_to_c.translation[0] + a_to_b.rotation[3] * b_to_c.translation[1] + a_to_b.rotation[6] * b_to_c.translation[2] + a_to_b.translation[0]) );
00201                         REQUIRE( a_to_c.translation[1] == Approx(a_to_b.rotation[1] * b_to_c.translation[0] + a_to_b.rotation[4] * b_to_c.translation[1] + a_to_b.rotation[7] * b_to_c.translation[2] + a_to_b.translation[1]) );
00202                         REQUIRE( a_to_c.translation[2] == Approx(a_to_b.rotation[2] * b_to_c.translation[0] + a_to_b.rotation[5] * b_to_c.translation[1] + a_to_b.rotation[8] * b_to_c.translation[2] + a_to_b.translation[2]) );
00203                    }
00204                 }
00205             }
00206         }
00207     }
00208 }
00209 
00210 TEST_CASE( "aligned images have no extrinsic transformation from the image they are aligned to", "[live]" )
00211 {
00212     // Require at least one device to be plugged in
00213     safe_context ctx;
00214     const int device_count = rs_get_device_count(ctx, require_no_error());
00215     REQUIRE(device_count > 0);
00216 
00217     // For each device
00218     for(int i=0; i<device_count; ++i)
00219     {
00220         rs_device * dev = rs_get_device(ctx, 0, require_no_error());    
00221         REQUIRE(dev != nullptr);
00222         
00223         // Require no TRANSLATION (but rotation is acceptable) between RECTIFIED_COLOR and COLOR (because they come from the same imager)
00224         rs_extrinsics extrin = {};
00225         rs_get_device_extrinsics(dev, RS_STREAM_RECTIFIED_COLOR, RS_STREAM_COLOR, &extrin, require_no_error());
00226         require_zero_vector(extrin.translation);
00227 
00228         // Require no extrinsic transformation between COLOR_ALIGNED_TO_DEPTH and DEPTH (because, by definition, they are aligned)
00229         rs_get_device_extrinsics(dev, RS_STREAM_COLOR_ALIGNED_TO_DEPTH, RS_STREAM_DEPTH, &extrin, require_no_error());
00230         require_identity_matrix(extrin.rotation);
00231         require_zero_vector(extrin.translation);
00232 
00233         // Require no extrinsic transformation between DEPTH_ALIGNED_TO_COLOR and COLOR (because, by definition, they are aligned)
00234         rs_get_device_extrinsics(dev, RS_STREAM_DEPTH_ALIGNED_TO_COLOR, RS_STREAM_COLOR, &extrin, require_no_error());
00235         require_identity_matrix(extrin.rotation);
00236         require_zero_vector(extrin.translation);
00237 
00238         // Require no extrinsic transformation between DEPTH_ALIGNED_TO_RECTIFIED_COLOR and RECTIFIED_COLOR (because, by definition, they are aligned)
00239         rs_get_device_extrinsics(dev, RS_STREAM_DEPTH_ALIGNED_TO_RECTIFIED_COLOR, RS_STREAM_RECTIFIED_COLOR, &extrin, require_no_error());
00240         require_identity_matrix(extrin.rotation);
00241         require_zero_vector(extrin.translation);
00242     }
00243 }
00244 
00245 TEST_CASE( "streaming mode intrinsics are sane", "[live]" )
00246 {
00247     // Require at least one device to be plugged in
00248     safe_context ctx;
00249     const int device_count = rs_get_device_count(ctx, require_no_error());
00250     REQUIRE(device_count > 0);
00251 
00252     // For each device
00253     for(int i=0; i<device_count; ++i)
00254     {
00255         rs_device * dev = rs_get_device(ctx, 0, require_no_error());    
00256         REQUIRE(dev != nullptr);
00257 
00258         // For each of the basic streams
00259         for(auto stream : {RS_STREAM_DEPTH, RS_STREAM_COLOR, RS_STREAM_INFRARED})
00260         {
00261             // Require that there are modes for this stream
00262             const int stream_mode_count = rs_get_stream_mode_count(dev, stream, require_no_error());
00263             REQUIRE(stream_mode_count > 0);
00264 
00265             // For each streaming mode
00266             for(int j=0; j<stream_mode_count; ++j)
00267             {
00268                 // Retrieve mode settings
00269                 int width = 0, height = 0, framerate = 0;
00270                 rs_format format = RS_FORMAT_ANY;
00271                 rs_get_stream_mode(dev, stream, j, &width, &height, &format, &framerate, require_no_error());
00272 
00273                 // Require that the mode settings are sane
00274                 REQUIRE( width >= 320 );
00275                 REQUIRE( width <= 1920 );
00276                 REQUIRE( height >= 180 );
00277                 REQUIRE( height <= 1080 );
00278                 REQUIRE( format > RS_FORMAT_ANY );
00279                 REQUIRE( format < RS_FORMAT_COUNT );
00280                 REQUIRE( framerate >= 2 );
00281                 REQUIRE( framerate <= 300 );
00282 
00283                 // Require that we can set the stream to this mode
00284                 rs_enable_stream(dev, stream, width, height, format, framerate, require_no_error());
00285                 REQUIRE(rs_is_stream_enabled(dev, stream, require_no_error()) == 1);
00286                 REQUIRE(rs_get_stream_format(dev, stream, require_no_error()) == format);
00287                 REQUIRE(rs_get_stream_framerate(dev, stream, require_no_error()) == framerate);
00288 
00289                 // Intrinsic width/height must match width/height of streaming mode we requested
00290                 rs_intrinsics intrin;
00291                 rs_get_stream_intrinsics(dev, stream, &intrin, require_no_error());
00292                 REQUIRE( intrin.width == width );
00293                 REQUIRE( intrin.height == height );
00294 
00295                 // Principal point must be within center 20% of image
00296                 REQUIRE( intrin.ppx > width * 0.4f );
00297                 REQUIRE( intrin.ppx < width * 0.6f );
00298                 REQUIRE( intrin.ppy > height * 0.4f );
00299                 REQUIRE( intrin.ppy < height * 0.6f );
00300 
00301                 // Focal length must be nonnegative (todo - Refine requirements based on known expected FOV)
00302                 REQUIRE( intrin.fx > 0.0f );
00303                 REQUIRE( intrin.fy > 0.0f );
00304 
00305                 // Require that we can disable the stream afterwards
00306                 rs_disable_stream(dev, stream, require_no_error());
00307                 REQUIRE(rs_is_stream_enabled(dev, stream, require_no_error()) == 0);
00308             }
00309 
00310             // Require that we cannot retrieve intrinsic/format/framerate when stream is disabled
00311             REQUIRE(rs_is_stream_enabled(dev, stream, require_no_error()) == 0);
00312             rs_intrinsics intrin;
00313             rs_get_stream_intrinsics(dev, stream, &intrin, require_error(std::string("stream not enabled: ") + rs_stream_to_string(stream)));
00314             rs_get_stream_format(dev, stream, require_error(std::string("stream not enabled: ") + rs_stream_to_string(stream)));
00315             rs_get_stream_framerate(dev, stream, require_error(std::string("stream not enabled: ") + rs_stream_to_string(stream)));
00316         }
00317     }
00318 }
00319 
00320 //TEST_CASE( "synthetic streaming mode properties are correct", "[live]" )
00321 //{
00322 //    // Require at least one device to be plugged in
00323 //    safe_context ctx;
00324 //    const int device_count = rs_get_device_count(ctx, require_no_error());
00325 //    REQUIRE(device_count > 0);
00326 //
00327 //    // For each device
00328 //    for(int i=0; i<device_count; ++i)
00329 //    {
00330 //        rs_device * dev = rs_get_device(ctx, 0, require_no_error());    
00331 //        REQUIRE(dev != nullptr);
00332 //
00333 //        // For each combination of COLOR and DEPTH streaming modes
00334 //        const int color_mode_count = rs_get_stream_mode_count(dev, RS_STREAM_COLOR, require_no_error());
00335 //        const int depth_mode_count = rs_get_stream_mode_count(dev, RS_STREAM_DEPTH, require_no_error());
00336 //        for(int j=0; j<color_mode_count; ++j)
00337 //        {
00338 //            // Enable a COLOR mode and retrieve intrinsics
00339 //            int color_width = 0, color_height = 0, color_framerate = 0; rs_format color_format = RS_FORMAT_ANY;
00340 //            rs_get_stream_mode(dev, RS_STREAM_COLOR, j, &color_width, &color_height, &color_format, &color_framerate, require_no_error());
00341 //            rs_enable_stream(dev, RS_STREAM_COLOR, color_width, color_height, color_format, color_framerate, require_no_error());
00342 //
00343 //            rs_intrinsics color_intrin = {};
00344 //            rs_get_stream_intrinsics(dev, RS_STREAM_COLOR, &color_intrin, require_no_error());
00345 //
00346 //            // Validate that RECTIFIED_COLOR properties match size/format/framerate of COLOR, and have no distortion
00347 //            REQUIRE( rs_get_stream_format(dev, RS_STREAM_RECTIFIED_COLOR, require_no_error()) == color_format );
00348 //            REQUIRE( rs_get_stream_framerate(dev, RS_STREAM_RECTIFIED_COLOR, require_no_error()) == color_framerate );
00349 //
00350 //            rs_intrinsics rectified_color_intrin = {};
00351 //            rs_get_stream_intrinsics(dev, RS_STREAM_RECTIFIED_COLOR, &rectified_color_intrin, require_no_error());
00352 //            REQUIRE( rectified_color_intrin.width  == color_width  );
00353 //            REQUIRE( rectified_color_intrin.height == color_height );
00354 //            REQUIRE( rectified_color_intrin.ppx > color_width * 0.4f );
00355 //            REQUIRE( rectified_color_intrin.ppx < color_width * 0.6f );
00356 //            REQUIRE( rectified_color_intrin.ppy > color_height * 0.4f );
00357 //            REQUIRE( rectified_color_intrin.ppy < color_height * 0.6f );
00358 //            REQUIRE( rectified_color_intrin.fx > 0.0f );
00359 //            REQUIRE( rectified_color_intrin.fy > 0.0f );
00360 //            REQUIRE( rectified_color_intrin.model == RS_DISTORTION_NONE );
00361 //            for(int k=0; k<5; ++k) REQUIRE( rectified_color_intrin.coeffs[k] == 0.0f );
00362 //
00363 //            for(int k=0; k<depth_mode_count; ++k)
00364 //            {
00365 //                // Enable a DEPTH mode and retrieve intrinsics
00366 //                int depth_width = 0, depth_height = 0, depth_framerate = 0; rs_format depth_format = RS_FORMAT_ANY; 
00367 //                rs_get_stream_mode(dev, RS_STREAM_DEPTH, k, &depth_width, &depth_height, &depth_format, &depth_framerate, require_no_error());
00368 //                rs_enable_stream(dev, RS_STREAM_DEPTH, depth_width, depth_height, depth_format, color_framerate, require_no_error());
00369 //
00370 //                rs_intrinsics depth_intrin = {};
00371 //                rs_get_stream_intrinsics(dev, RS_STREAM_DEPTH, &depth_intrin, require_no_error());
00372 //
00373 //                // COLOR_ALIGNED_TO_DEPTH must have same format/framerate as COLOR
00374 //                REQUIRE( rs_get_stream_format(dev, RS_STREAM_COLOR_ALIGNED_TO_DEPTH, require_no_error()) == color_format );
00375 //                REQUIRE( rs_get_stream_framerate(dev, RS_STREAM_COLOR_ALIGNED_TO_DEPTH, require_no_error()) == color_framerate );
00376 //
00377 //                // COLOR_ALIGNED_TO_DEPTH must have same intrinsics as DEPTH
00378 //                rs_intrinsics color_aligned_to_depth_intrin = {};
00379 //                rs_get_stream_intrinsics(dev, RS_STREAM_COLOR_ALIGNED_TO_DEPTH, &color_aligned_to_depth_intrin, require_no_error());
00380 //                REQUIRE( color_aligned_to_depth_intrin.width  == depth_intrin.width  );
00381 //                REQUIRE( color_aligned_to_depth_intrin.height == depth_intrin.height );
00382 //                REQUIRE( color_aligned_to_depth_intrin.ppx    == depth_intrin.ppx    );
00383 //                REQUIRE( color_aligned_to_depth_intrin.ppy    == depth_intrin.ppy    );
00384 //                REQUIRE( color_aligned_to_depth_intrin.fx     == depth_intrin.fx     );
00385 //                REQUIRE( color_aligned_to_depth_intrin.fy     == depth_intrin.fy     );
00386 //                REQUIRE( color_aligned_to_depth_intrin.model  == depth_intrin.model  );
00387 //                for(int l=0; l<5; ++l) REQUIRE( color_aligned_to_depth_intrin.coeffs[l]  == depth_intrin.coeffs[l] );
00388 //
00389 //                // DEPTH_ALIGNED_TO_COLOR must have same format/framerate as DEPTH
00390 //                REQUIRE( rs_get_stream_format(dev, RS_STREAM_DEPTH_ALIGNED_TO_COLOR, require_no_error()) == depth_format );
00391 //                REQUIRE( rs_get_stream_framerate(dev, RS_STREAM_DEPTH_ALIGNED_TO_COLOR, require_no_error()) == color_framerate );
00392 //
00393 //                // DEPTH_ALIGNED_TO_COLOR must have same intrinsics as COLOR
00394 //                rs_intrinsics depth_aligned_to_color_intrin = {};
00395 //                rs_get_stream_intrinsics(dev, RS_STREAM_DEPTH_ALIGNED_TO_COLOR, &depth_aligned_to_color_intrin, require_no_error());
00396 //                REQUIRE( depth_aligned_to_color_intrin.width  == color_intrin.width  );
00397 //                REQUIRE( depth_aligned_to_color_intrin.height == color_intrin.height );
00398 //                REQUIRE( depth_aligned_to_color_intrin.ppx    == color_intrin.ppx    );
00399 //                REQUIRE( depth_aligned_to_color_intrin.ppy    == color_intrin.ppy    );
00400 //                REQUIRE( depth_aligned_to_color_intrin.fx     == color_intrin.fx     );
00401 //                REQUIRE( depth_aligned_to_color_intrin.fy     == color_intrin.fy     );
00402 //                REQUIRE( depth_aligned_to_color_intrin.model  == color_intrin.model  );
00403 //                for(int l=0; l<5; ++l) REQUIRE( depth_aligned_to_color_intrin.coeffs[l]  == color_intrin.coeffs[l] );
00404 //
00405 //                // DEPTH_ALIGNED_TO_RECTIFIED_COLOR must have same format/framerate as DEPTH
00406 //                REQUIRE( rs_get_stream_format(dev, RS_STREAM_DEPTH_ALIGNED_TO_RECTIFIED_COLOR, require_no_error()) == depth_format );
00407 //                REQUIRE( rs_get_stream_framerate(dev, RS_STREAM_DEPTH_ALIGNED_TO_RECTIFIED_COLOR, require_no_error()) == color_framerate );
00408 //
00409 //                // DEPTH_ALIGNED_TO_RECTIFIED_COLOR must have same intrinsics as RECTIFIED_COLOR
00410 //                rs_intrinsics depth_aligned_to_rectified_color_intrin = {};
00411 //                rs_get_stream_intrinsics(dev, RS_STREAM_DEPTH_ALIGNED_TO_RECTIFIED_COLOR, &depth_aligned_to_rectified_color_intrin, require_no_error());
00412 //                REQUIRE( depth_aligned_to_rectified_color_intrin.width  == rectified_color_intrin.width  );
00413 //                REQUIRE( depth_aligned_to_rectified_color_intrin.height == rectified_color_intrin.height );
00414 //                REQUIRE( depth_aligned_to_rectified_color_intrin.ppx    == rectified_color_intrin.ppx    );
00415 //                REQUIRE( depth_aligned_to_rectified_color_intrin.ppy    == rectified_color_intrin.ppy    );
00416 //                REQUIRE( depth_aligned_to_rectified_color_intrin.fx     == rectified_color_intrin.fx     );
00417 //                REQUIRE( depth_aligned_to_rectified_color_intrin.fy     == rectified_color_intrin.fy     );
00418 //                REQUIRE( depth_aligned_to_rectified_color_intrin.model  == rectified_color_intrin.model  );
00419 //                for(int l=0; l<5; ++l) REQUIRE( depth_aligned_to_rectified_color_intrin.coeffs[l]  == rectified_color_intrin.coeffs[l] );
00420 //            }
00421 //        }
00422 //    }
00423 //}
00424 
00425 #endif /* !defined(MAKEFILE) || ( defined(LIVE_TEST) ) */


librealsense
Author(s): Sergey Dorodnicov , Mark Horn , Reagan Lopez
autogenerated on Tue Jun 25 2019 19:54:39