unit-tests-live-ivcam-common.cpp
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2015 Intel Corporation. All Rights Reserved.
3 
5 // This set of tests is valid only for the R200 camera //
7 
8 #if !defined(MAKEFILE)
9 
10 #define CATCH_CONFIG_MAIN
11 #include "catch/catch.hpp"
12 
13 #include "unit-tests-common.h"
14 
15 #include <climits>
16 #include <sstream>
17 
18 TEST_CASE( "R200 metadata enumerates correctly", "[live] [r200]" )
19 {
20  // Require at least one device to be plugged in
22  const int device_count = rs_get_device_count(ctx, require_no_error());
23  REQUIRE(device_count > 0);
24 
25  // For each device
26  for(int i=0; i<device_count; ++i)
27  {
29  REQUIRE(dev != nullptr);
30 
31  SECTION( "device name is Intel RealSense R200" )
32  {
33  const char * name = rs_get_device_name(dev, require_no_error());
34  REQUIRE(name == std::string("Intel RealSense R200"));
35  }
36 
37  SECTION( "device serial number has ten decimal digits" )
38  {
39  const char * serial = rs_get_device_serial(dev, require_no_error());
40  REQUIRE(strlen(serial) == 10);
41  for(int i=0; i<10; ++i) REQUIRE(isdigit(serial[i]));
42  }
43  }
44 }
45 
46 TEST_CASE( "R200 devices support all required options", "[live] [r200]" )
47 {
48  // Require at least one device to be plugged in
50  const int device_count = rs_get_device_count(ctx, require_no_error());
51  REQUIRE(device_count > 0);
52 
53  // For each device
54  for(int i=0; i<device_count; ++i)
55  {
57  REQUIRE(dev != nullptr);
58 
59  SECTION( "device supports standard picture options and R200 extension options, and nothing else" )
60  {
61  const int supported_options[] = {
102  };
103 
104  for(int i=0; i<RS_OPTION_COUNT; ++i)
105  {
106  if(std::find(std::begin(supported_options), std::end(supported_options), i) != std::end(supported_options))
107  {
109  }
110  else
111  {
113  }
114  }
115  }
116  }
117 }
118 
120 // Calibration information tests //
122 
123 TEST_CASE( "R200 device extrinsics are within expected parameters", "[live] [r200]" )
124 {
125  // Require at least one device to be plugged in
127  const int device_count = rs_get_device_count(ctx, require_no_error());
128  REQUIRE(device_count > 0);
129 
130  // For each device
131  for(int i=0; i<device_count; ++i)
132  {
134  REQUIRE(dev != nullptr);
135 
136  SECTION( "no extrinsic transformation between DEPTH and INFRARED" )
137  {
138  rs_extrinsics extrin;
140 
143  }
144 
145  SECTION( "only x-axis translation (~70 mm) between DEPTH and INFRARED2" )
146  {
147  rs_extrinsics extrin;
149 
151  REQUIRE( extrin.translation[0] < -0.06f ); // Some variation is allowed, but should report at least 60 mm in all cases
152  REQUIRE( extrin.translation[0] > -0.08f ); // Some variation is allowed, but should report at most 80 mm in all cases
153  REQUIRE( extrin.translation[1] == 0.0f );
154  REQUIRE( extrin.translation[2] == 0.0f );
155  }
156 
157  SECTION( "only translation between DEPTH and RECTIFIED_COLOR" )
158  {
159  rs_extrinsics extrin;
161 
163  }
164 
165  SECTION( "depth scale is 0.001 (by default)" )
166  {
168  }
169  }
170 }
171 
172 TEST_CASE( "R200 infrared2 streaming modes exactly match infrared streaming modes", "[live] [r200]" )
173 {
174  // Require at least one device to be plugged in
176  const int device_count = rs_get_device_count(ctx, require_no_error());
177  REQUIRE(device_count > 0);
178 
179  // For each device
180  for(int i=0; i<device_count; ++i)
181  {
183  REQUIRE(dev != nullptr);
184 
185  // Require that there are a nonzero amount of infrared modes, and that infrared2 has the same number of modes
186  const int infrared_mode_count = rs_get_stream_mode_count(dev, RS_STREAM_INFRARED, require_no_error());
187  REQUIRE( infrared_mode_count > 0 );
188  REQUIRE( rs_get_stream_mode_count(dev, RS_STREAM_INFRARED2, require_no_error()) == infrared_mode_count );
189 
190  // For each streaming mode
191  for(int j=0; j<infrared_mode_count; ++j)
192  {
193  // Require that INFRARED and INFRARED2 streaming modes are exactly identical
194  int infrared_width = 0, infrared_height = 0, infrared_framerate = 0; rs_format infrared_format = RS_FORMAT_ANY;
195  rs_get_stream_mode(dev, RS_STREAM_INFRARED, j, &infrared_width, &infrared_height, &infrared_format, &infrared_framerate, require_no_error());
196 
197  int infrared2_width = 0, infrared2_height = 0, infrared2_framerate = 0; rs_format infrared2_format = RS_FORMAT_ANY;
198  rs_get_stream_mode(dev, RS_STREAM_INFRARED2, j, &infrared2_width, &infrared2_height, &infrared2_format, &infrared2_framerate, require_no_error());
199 
200  REQUIRE( infrared_width == infrared2_width );
201  REQUIRE( infrared_height == infrared2_height );
202  REQUIRE( infrared_format == infrared2_format );
203  REQUIRE( infrared_framerate == infrared2_framerate );
204 
205  // Require that the intrinsics for these streaming modes match exactly
206  rs_enable_stream(dev, RS_STREAM_INFRARED, infrared_width, infrared_height, infrared_format, infrared_framerate, require_no_error());
207  rs_enable_stream(dev, RS_STREAM_INFRARED2, infrared2_width, infrared2_height, infrared2_format, infrared2_framerate, require_no_error());
208 
211 
212  rs_intrinsics infrared_intrin = {}, infrared2_intrin = {};
215  REQUIRE( infrared_intrin.width == infrared_intrin.width );
216  REQUIRE( infrared_intrin.height == infrared_intrin.height );
217  REQUIRE( infrared_intrin.ppx == infrared_intrin.ppx );
218  REQUIRE( infrared_intrin.ppy == infrared_intrin.ppy );
219  REQUIRE( infrared_intrin.fx == infrared_intrin.fx );
220  REQUIRE( infrared_intrin.fy == infrared_intrin.fy );
221  REQUIRE( infrared_intrin.model == infrared_intrin.model );
222  for(int k=0; k<5; ++k) REQUIRE( infrared_intrin.coeffs[k] == infrared_intrin.coeffs[k] );
223  }
224  }
225 }
226 
228 // Streaming tests //
230 
231 inline void test_r200_streaming(std::initializer_list<stream_mode> modes)
232 {
233  safe_context ctx;
235 
237  REQUIRE(dev != nullptr);
238  REQUIRE(rs_get_device_name(dev, require_no_error()) == std::string("Intel RealSense R200"));
239 
240  test_streaming(dev, modes);
241 }
242 
244 // Depth streaming tests //
246 
247 TEST_CASE( "R200 streams 480x360 depth", "[live] [r200] [one-camera]" )
248 {
250 }
251 
252 TEST_CASE( "R200 streams 628x468 depth", "[live] [r200] [one-camera]" )
253 {
255 }
256 
257 TEST_CASE( "R200 streams 320x240 depth", "[live] [r200] [one-camera]" )
258 {
260 }
261 
262 TEST_CASE( "R200 streams 480x360 depth (30 fps)", "[live] [r200] [one-camera]" )
263 {
265 }
266 
267 TEST_CASE( "R200 streams 628x468 depth (30 fps)", "[live] [r200] [one-camera]" )
268 {
270 }
271 
272 TEST_CASE( "R200 streams 320x240 depth (30 fps)", "[live] [r200] [one-camera]" )
273 {
275 }
276 
277 TEST_CASE( "R200 streams 480x360 depth (90 fps)", "[live] [r200] [one-camera]" )
278 {
280 }
281 
282 TEST_CASE( "R200 streams 628x468 depth (90 fps)", "[live] [r200] [one-camera]" )
283 {
285 }
286 
287 TEST_CASE( "R200 streams 320x240 depth (90 fps)", "[live] [r200] [one-camera]" )
288 {
290 }
291 
293 // Color streaming tests //
295 
296 TEST_CASE( "R200 streams HD color", "[live] [r200] [one-camera]" )
297 {
298  test_r200_streaming({{RS_STREAM_COLOR, 1920, 1080, RS_FORMAT_YUYV, 30}});
299 }
300 
301 TEST_CASE( "R200 streams VGA color", "[live] [r200] [one-camera]" )
302 {
304 }
305 
306 TEST_CASE( "R200 streams VGA color (60 fps)", "[live] [r200] [one-camera]" )
307 {
309 }
310 
311 TEST_CASE( "R200 streams 480x360 depth and HD color", "[live] [r200] [one-camera]" )
312 {
314  {RS_STREAM_COLOR, 1920, 1080, RS_FORMAT_YUYV, 30}});
315 }
316 
317 TEST_CASE( "R200 streams 628x468 depth and HD color", "[live] [r200] [one-camera]" )
318 {
320  {RS_STREAM_COLOR, 1920, 1080, RS_FORMAT_YUYV, 30}});
321 }
322 
323 TEST_CASE( "R200 streams 320x240 depth and HD color", "[live] [r200] [one-camera]" )
324 {
326  {RS_STREAM_COLOR, 1920, 1080, RS_FORMAT_YUYV, 30}});
327 }
328 
329 TEST_CASE( "R200 streams 480x360 depth and VGA color", "[live] [r200] [one-camera]" )
330 {
332  {RS_STREAM_COLOR, 640, 480, RS_FORMAT_YUYV, 30}});
333 }
334 
335 TEST_CASE( "R200 streams 628x468 depth and VGA color", "[live] [r200] [one-camera]" )
336 {
338  {RS_STREAM_COLOR, 640, 480, RS_FORMAT_YUYV, 30}});
339 }
340 
341 TEST_CASE( "R200 streams 320x240 depth and VGA color", "[live] [r200] [one-camera]" )
342 {
344  {RS_STREAM_COLOR, 640, 480, RS_FORMAT_YUYV, 30}});
345 }
346 
347 TEST_CASE( "R200 streams 480x360 depth and VGA color (60 fps)", "[live] [r200] [one-camera]" )
348 {
350  {RS_STREAM_COLOR, 640, 480, RS_FORMAT_YUYV, 60}});
351 }
352 
353 TEST_CASE( "R200 streams HD Raw10", "[live] [r200] [one-camera]" )
354 {
356 }
357 
359 // Infrared streaming tests //
361 
362 TEST_CASE( "R200 streams 640x480 infrared (left 8 bit)", "[live] [r200] [one-camera]" )
363 {
365 }
366 
367 TEST_CASE( "R200 streams 640x480 infrared (left 16 bit)", "[live] [r200] [one-camera]" )
368 {
370 }
371 
372 TEST_CASE( "R200 streams 640x480 infrared (right 8 bit)", "[live] [r200] [one-camera]" )
373 {
375 }
376 
377 TEST_CASE( "R200 streams 640x480 infrared (right 16 bit)", "[live] [r200] [one-camera]" )
378 {
380 }
381 
382 TEST_CASE( "R200 streams 640x480 infrared (left+right 8 bit)", "[live] [r200] [one-camera]" )
383 {
385  {RS_STREAM_INFRARED2, 640, 480, RS_FORMAT_Y8, 60}});
386 }
387 
388 TEST_CASE( "R200 streams 640x480 infrared (left+right 16 bit)", "[live] [r200] [one-camera]" )
389 {
391  {RS_STREAM_INFRARED2, 640, 480, RS_FORMAT_Y16, 60}});
392 }
393 
394 TEST_CASE( "R200 streams 480x360 depth and 492x372 infrared (left+right 16 bit)", "[live] [r200] [one-camera]" )
395 {
397  {RS_STREAM_INFRARED, 492, 372, RS_FORMAT_Y16, 60},
398  {RS_STREAM_INFRARED2, 492, 372, RS_FORMAT_Y16, 60}});
399 }
400 
401 TEST_CASE( "R200 streams 480x360 depth, VGA color, and 492x372 infrared", "[live] [r200] [one-camera]" )
402 {
404  {RS_STREAM_COLOR, 640, 480, RS_FORMAT_YUYV, 30},
405  {RS_STREAM_INFRARED, 492, 372, RS_FORMAT_Y16, 60},
406  {RS_STREAM_INFRARED2, 492, 372, RS_FORMAT_Y16, 60}});
407 }
408 
409 TEST_CASE( "R200 streams 628x468 depth, VGA color, and 640x480 infrared", "[live] [r200] [one-camera]" )
410 {
412  {RS_STREAM_COLOR, 640, 480, RS_FORMAT_YUYV, 30},
413  {RS_STREAM_INFRARED, 640, 480, RS_FORMAT_Y16, 60},
414  {RS_STREAM_INFRARED2, 640, 480, RS_FORMAT_Y16, 60}});
415 }
416 
417 TEST_CASE( "R200 streams 320x240 depth, VGA color, and 332x252 infrared", "[live] [r200] [one-camera]" )
418 {
420  {RS_STREAM_COLOR, 640, 480, RS_FORMAT_YUYV, 30},
421  {RS_STREAM_INFRARED, 332, 252, RS_FORMAT_Y16, 60},
422  {RS_STREAM_INFRARED2, 332, 252, RS_FORMAT_Y16, 60}});
423 }
424 
426 // Cropped and padded modes //
428 
429 TEST_CASE( "R200 streams 640x480 depth and infrared", "[live] [r200] [one-camera]" )
430 {
432  {RS_STREAM_INFRARED, 640, 480, RS_FORMAT_Y8, 60},
433  {RS_STREAM_INFRARED2, 640, 480, RS_FORMAT_Y8, 60}});
434 }
435 
436 TEST_CASE( "R200 streams 628x468 depth and infrared", "[live] [r200] [one-camera]" )
437 {
439  {RS_STREAM_INFRARED, 628, 468, RS_FORMAT_Y8, 60},
440  {RS_STREAM_INFRARED2, 628, 468, RS_FORMAT_Y8, 60}});
441 }
442 
443 TEST_CASE( "R200 streams 492x372 depth and infrared", "[live] [r200] [one-camera]" )
444 {
446  {RS_STREAM_INFRARED, 492, 372, RS_FORMAT_Y8, 60},
447  {RS_STREAM_INFRARED2, 492, 372, RS_FORMAT_Y8, 60}});
448 }
449 
450 TEST_CASE( "R200 streams 480x360 depth and infrared", "[live] [r200] [one-camera]" )
451 {
453  {RS_STREAM_INFRARED, 480, 360, RS_FORMAT_Y8, 60},
454  {RS_STREAM_INFRARED2, 480, 360, RS_FORMAT_Y8, 60}});
455 }
456 
457 TEST_CASE( "R200 streams 332x252 depth and infrared", "[live] [r200] [one-camera]" )
458 {
460  {RS_STREAM_INFRARED, 332, 252, RS_FORMAT_Y8, 60},
461  {RS_STREAM_INFRARED2, 332, 252, RS_FORMAT_Y8, 60}});
462 }
463 
464 TEST_CASE( "R200 streams 320x240 depth and infrared", "[live] [r200] [one-camera]" )
465 {
467  {RS_STREAM_INFRARED, 320, 240, RS_FORMAT_Y8, 60},
468  {RS_STREAM_INFRARED2, 320, 240, RS_FORMAT_Y8, 60}});
469 }
470 
472 // Options //
474 
476 inline void test_r200_option(rs_option option, std::initializer_list<int> values, int when)
477 {
478  safe_context ctx;
480 
482  REQUIRE(dev != nullptr);
483  REQUIRE(rs_get_device_name(dev, require_no_error()) == std::string("Intel RealSense R200"));
484 
485  if(when & BEFORE_START_DEVICE)
486  {
487  test_option(dev, option, values, {});
488  }
489 
490  if(when & AFTER_START_DEVICE)
491  {
494 
495  // Currently, setting/getting options immediately after streaming frequently raises hardware errors
496  // todo - Internally block or retry failed calls within the first few seconds after streaming
497  std::this_thread::sleep_for(std::chrono::seconds(1));
498  test_option(dev, option, values, {});
499  }
500 }
501 
502 TEST_CASE( "R200 supports RS_OPTION_R200_LR_AUTO_EXPOSURE_ENABLED", "[live] [r200]" )
503 {
505 }
506 
507 TEST_CASE( "R200 supports RS_OPTION_R200_LR_GAIN", "[live] [r200]" )
508 {
509  test_r200_option(RS_OPTION_R200_LR_GAIN, {100, 200, 400, 800, 1600}, BEFORE_START_DEVICE | AFTER_START_DEVICE); // Gain percentage
510 }
511 
512 TEST_CASE( "R200 supports RS_OPTION_R200_LR_EXPOSURE", "[live] [r200]" )
513 {
514  test_r200_option(RS_OPTION_R200_LR_EXPOSURE, {40, 80, 160}, BEFORE_START_DEVICE | AFTER_START_DEVICE); // Tenths of milliseconds
515 }
516 
517 // Note: The R200 firmware has some complications regarding emitter state before the device has been started
518 // The emitter will never be on if the device is not streaming, but the firmware will remember and respect any
519 // specified preferences for emitter enabled that are specified prior to streaming.
520 
521 TEST_CASE( "R200 emitter defaults to off if depth is not enabled/streamed", "[live] [r200]" )
522 {
523  safe_context ctx;
525 
527  REQUIRE(dev != nullptr);
528  REQUIRE(rs_get_device_name(dev, require_no_error()) == std::string("Intel RealSense R200"));
529 
530  // Emitter enabled defaults to false
532 
533  // Enabling non-depth streams does not change the emitter's state
538 
539  // Starting the device does not change the emitter's state
541  std::this_thread::sleep_for(std::chrono::seconds(1));
543 }
544 
545 TEST_CASE( "R200 emitter defaults to on if depth is enabled/streamed", "[live] [r200]" )
546 {
547  safe_context ctx;
549 
551  REQUIRE(dev != nullptr);
552  REQUIRE(rs_get_device_name(dev, require_no_error()) == std::string("Intel RealSense R200"));
553 
554  // Emitter enabled defaults to false
556 
557  // Enabling depth stream causes the emitter to be enabled
560 
561  // Starting the device does not change the emitter's state
563  std::this_thread::sleep_for(std::chrono::seconds(1));
565 }
566 
567 TEST_CASE( "R200 emitter can be enabled even if depth is not enabled/streamed", "[live] [r200]" )
568 {
569  safe_context ctx;
571 
573  REQUIRE(dev != nullptr);
574  REQUIRE(rs_get_device_name(dev, require_no_error()) == std::string("Intel RealSense R200"));
575 
576  // Emitter enabled defaults to false
578 
579  // Enabling non-depth streams does not change the emitter's state
584 
585  // The emitter can be turned on even though no depth is streamed
588 
589  // Starting the device does not change the emitter's state
591  std::this_thread::sleep_for(std::chrono::seconds(1));
593 }
594 
595 TEST_CASE( "R200 emitter can be turned off even if depth is enabled/streamed", "[live] [r200]" )
596 {
597  safe_context ctx;
599 
601  REQUIRE(dev != nullptr);
602  REQUIRE(rs_get_device_name(dev, require_no_error()) == std::string("Intel RealSense R200"));
603 
604  // Emitter enabled defaults to false
606 
607  // Enabling depth stream causes the emitter to be enabled
610 
611  // The emitter can be turned off even though depth is streamed
614 
615  // Starting the device does not change the emitter's state
617  std::this_thread::sleep_for(std::chrono::seconds(1));
619 }
620 
621 TEST_CASE( "R200 emitter can be turned on and off after streaming has begun", "[live] [r200]" )
622 {
623  safe_context ctx;
625 
627  REQUIRE(dev != nullptr);
628  REQUIRE(rs_get_device_name(dev, require_no_error()) == std::string("Intel RealSense R200"));
629 
630  // The emitter defaults to on when depth is streamed
633  std::this_thread::sleep_for(std::chrono::seconds(1));
635 
636  // The emitter can be turned off
639 
640  // The emitter can be turned back on
643 }
644 
645 TEST_CASE( "R200 supports RS_OPTION_R200_DEPTH_UNITS", "[live] [r200]" )
646 {
647  safe_context ctx;
649 
651  REQUIRE(dev != nullptr);
652  REQUIRE(rs_get_device_name(dev, require_no_error()) == std::string("Intel RealSense R200"));
653 
654  // By default, depth unit is 1000 micrometers (1 mm)
657 
658  for(int value : {100, 500, 1000, 2000, 10000})
659  {
660  // Set depth units (specified in micrometers) and verify that depth scale (specified in meters) changes appropriately
663  REQUIRE(rs_get_device_depth_scale(dev, require_no_error()) == (float)value/1000000);
664  }
665 }
666 
667 TEST_CASE( "R200 supports RS_OPTION_R200_DEPTH_CLAMP_MIN", "[live] [r200]" )
668 {
670 }
671 
672 TEST_CASE( "R200 supports RS_OPTION_R200_DEPTH_CLAMP_MAX", "[live] [r200]" )
673 {
675 }
676 
678 // Stop, reconfigure, and restart tests //
680 
681 TEST_CASE( "a single R200 can stream a variety of reasonable streaming mode combinations", "[live] [r200] [one-camera]" )
682 {
684 
685  SECTION( "exactly one device is connected" )
686  {
687  int device_count = rs_get_device_count(ctx, require_no_error());
688  REQUIRE(device_count == 1);
689  }
690 
692  REQUIRE(dev != nullptr);
693 
694  SECTION( "device name is Intel RealSense R200" )
695  {
696  const char * name = rs_get_device_name(dev, require_no_error());
697  REQUIRE(name == std::string("Intel RealSense R200"));
698  }
699 
700  SECTION( "streaming is possible in some reasonable configurations" )
701  {
702  SECTION( "streaming DEPTH 480, 360, RS_FORMAT_Z16, 60" )
703  {
704  test_streaming(dev, {
705  {RS_STREAM_DEPTH, 480, 360, RS_FORMAT_Z16, 60}
706  });
707  }
708 
709  SECTION( "streaming [DEPTH,480,360,Z16,60] [COLOR,480,360,RGB8,60]" )
710  {
711  test_streaming(dev, {
712  {RS_STREAM_DEPTH, 480, 360, RS_FORMAT_Z16, 60},
713  {RS_STREAM_COLOR, 640, 480, RS_FORMAT_RGB8, 60}
714  });
715  }
716 
717  SECTION( "streaming [DEPTH,480,360,Z16,60] [IR,480,360,Y8,60]" )
718  {
719  test_streaming(dev, {
720  {RS_STREAM_DEPTH, 480, 360, RS_FORMAT_Z16, 60},
721  {RS_STREAM_INFRARED, 480, 360, RS_FORMAT_Y8, 60}
722  });
723  }
724 
725  SECTION( "streaming [IR,492,372,Y16,60] [IR2,492,372,Y16,60]" )
726  {
727  test_streaming(dev, {
728  {RS_STREAM_INFRARED, 492, 372, RS_FORMAT_Y16, 60},
729  {RS_STREAM_INFRARED2, 492, 372, RS_FORMAT_Y16, 60}
730  });
731  }
732 
733  SECTION( "streaming [DEPTH,480,360,Z16,60] [COLOR,640,480,RGB8,60] [IR,480,360,Y8,60] [IR2,480,360,Y8,60]" )
734  {
735  test_streaming(dev, {
736  {RS_STREAM_DEPTH, 480, 360, RS_FORMAT_Z16, 60},
737  {RS_STREAM_COLOR, 640, 480, RS_FORMAT_RGB8, 60},
738  {RS_STREAM_INFRARED, 480, 360, RS_FORMAT_Y8, 60},
739  {RS_STREAM_INFRARED2, 480, 360, RS_FORMAT_Y8, 60}
740  });
741  }
742  }
743 }
744 
745 TEST_CASE( "streaming five configurations sequentionally", "[live] [r200] [one-camera]" )
746 {
748 
749  int device_count = rs_get_device_count(ctx, require_no_error());
750  REQUIRE(device_count == 1);
751 
753  REQUIRE(dev != nullptr);
754 
755  const char * name = rs_get_device_name(dev, require_no_error());
756  REQUIRE(name == std::string("Intel RealSense R200"));
757 
758  test_streaming(dev, {
759  {RS_STREAM_DEPTH, 480, 360, RS_FORMAT_Z16, 60}
760  });
761 
762  test_streaming(dev, {
763  {RS_STREAM_DEPTH, 480, 360, RS_FORMAT_Z16, 60},
764  {RS_STREAM_COLOR, 640, 480, RS_FORMAT_RGB8, 60}
765  });
766 
767  test_streaming(dev, {
768  {RS_STREAM_DEPTH, 480, 360, RS_FORMAT_Z16, 60}
769  });
770 
771  test_streaming(dev, {
772  {RS_STREAM_DEPTH, 480, 360, RS_FORMAT_Z16, 60},
773  {RS_STREAM_INFRARED, 480, 360, RS_FORMAT_Y8, 60}
774  });
775 
776  test_streaming(dev, {
777  {RS_STREAM_INFRARED, 492, 372, RS_FORMAT_Y16, 60},
778  {RS_STREAM_INFRARED2, 492, 372, RS_FORMAT_Y16, 60}
779  });
780 
781  test_streaming(dev, {
782  {RS_STREAM_INFRARED, 492, 372, RS_FORMAT_Y16, 60},
783  {RS_STREAM_INFRARED2, 492, 372, RS_FORMAT_Y16, 60}
784  });
785 
786  test_streaming(dev, {
787  {RS_STREAM_DEPTH, 480, 360, RS_FORMAT_Z16, 60},
788  {RS_STREAM_COLOR, 640, 480, RS_FORMAT_RGB8, 60},
789  {RS_STREAM_INFRARED, 480, 360, RS_FORMAT_Y8, 60},
790  {RS_STREAM_INFRARED2, 480, 360, RS_FORMAT_Y8, 60}
791  });
792 
793 }
794 
795 #endif /* !defined(MAKEFILE) */
void test_r200_streaming(std::initializer_list< stream_mode > modes)
void rs_get_stream_intrinsics(const rs_device *device, rs_stream stream, rs_intrinsics *intrin, rs_error **error)
Retrieves intrinsic camera parameters for a specific stream.
Definition: rs.cpp:289
float coeffs[5]
Definition: rs.h:309
int rs_get_device_count(const rs_context *context, rs_error **error)
Determines number of connected devices.
Definition: rs.cpp:113
float ppy
Definition: rs.h:305
GLsizei const GLchar *const * string
Definition: glext.h:683
TEST_CASE("R200 metadata enumerates correctly","[live] [r200]")
#define REQUIRE(expr)
Definition: catch.hpp:9333
void rs_set_device_option(rs_device *device, rs_option option, double value, rs_error **error)
Sets the current value of a single option.
Definition: rs.cpp:712
const char * rs_get_device_name(const rs_device *device, rs_error **error)
Retrieves human-readable device model string.
Definition: rs.cpp:128
rs_option
Defines general configuration controls.
Definition: rs.h:128
float rs_get_device_depth_scale(const rs_device *device, rs_error **error)
Retrieves mapping between the units of the depth image and meters.
Definition: rs.cpp:420
void require_zero_vector(const float(&vector)[3])
void rs_get_stream_mode(const rs_device *device, rs_stream stream, int index, int *width, int *height, rs_format *format, int *framerate, rs_error **error)
Determines the properties of a specific streaming mode.
Definition: rs.cpp:198
int rs_get_stream_mode_count(const rs_device *device, rs_stream stream, rs_error **error)
Determines the number of streaming modes available for a given stream.
Definition: rs.cpp:190
float translation[3]
Definition: rs.h:335
rs_format rs_get_stream_format(const rs_device *device, rs_stream stream, rs_error **error)
Retrieves the pixel format for a specific stream.
Definition: rs.cpp:273
double rs_get_device_option(rs_device *device, rs_option option, rs_error **error)
Retrieves the current value of a single option.
Definition: rs.cpp:694
void rs_get_device_extrinsics(const rs_device *device, rs_stream from_stream, rs_stream to_stream, rs_extrinsics *extrin, rs_error **error)
Retrieves extrinsic transformation between the viewpoints of two different streams.
Definition: rs.cpp:163
GLuint GLuint end
Definition: glext.h:111
GLfloat f
Definition: glext.h:1868
int rs_device_supports_option(const rs_device *device, rs_option option, rs_error **error)
Determines if the device allows a specific option to be queried and set.
Definition: rs.cpp:182
void test_streaming(rs_device *device, std::initializer_list< stream_mode > modes)
void test_r200_option(rs_option option, std::initializer_list< int > values, int when)
void rs_enable_stream(rs_device *device, rs_stream stream, int width, int height, rs_format format, int framerate, rs_error **error)
Enables a specific stream and requests specific properties.
Definition: rs.cpp:220
rs_format
Formats: defines how each stream can be encoded.
Definition: rs.h:53
auto ctx
GLsizei const GLfloat * value
Definition: glext.h:693
int height
Definition: rs.h:303
float fy
Definition: rs.h:307
int width
Definition: rs.h:302
Video stream intrinsics.
Definition: rs.h:300
void require_identity_matrix(const float(&matrix)[9])
GLfloat seconds
Definition: wglext.h:657
Cross-stream extrinsics: encode the topology describing how the different devices are connected...
Definition: rs.h:332
int rs_get_stream_framerate(const rs_device *device, rs_stream stream, rs_error **error)
Retrieves the frame rate for a specific stream.
Definition: rs.cpp:281
void test_option(rs_device *device, rs_option option, std::initializer_list< int > good_values, std::initializer_list< int > bad_values)
float rotation[9]
Definition: rs.h:334
GLenum GLsizei GLsizei GLint * values
Definition: glext.h:1484
GLuint const GLchar * name
Definition: glext.h:655
rs_device * dev
float fx
Definition: rs.h:306
rs_device * rs_get_device(rs_context *context, int index, rs_error **error)
Retrieves connected device by index.
Definition: rs.cpp:120
const char * rs_get_device_serial(const rs_device *device, rs_error **error)
Retrieves unique serial number of the device.
Definition: rs.cpp:135
void rs_enable_stream_preset(rs_device *device, rs_stream stream, rs_preset preset, rs_error **error)
Enables a specific stream and requests properties using a preset.
Definition: rs.cpp:232
#define SECTION(name, description)
Definition: catch.hpp:9370
rs_distortion model
Definition: rs.h:308
void rs_start_device(rs_device *device, rs_error **error)
Begins streaming on all enabled streams for this device.
Definition: rs.cpp:383
float ppx
Definition: rs.h:304


librealsense
Author(s): Sergey Dorodnicov , Mark Horn , Reagan Lopez
autogenerated on Fri Mar 13 2020 03:16:18