10 #define CATCH_CONFIG_MAIN 18 TEST_CASE(
"R200 metadata enumerates correctly",
"[live] [r200]" )
26 for(
int i=0; i<device_count; ++i)
31 SECTION(
"device name is Intel RealSense R200" )
37 SECTION(
"device serial number has ten decimal digits" )
41 for(
int i=0; i<10; ++i)
REQUIRE(isdigit(serial[i]));
46 TEST_CASE(
"R200 devices support all required options",
"[live] [r200]" )
54 for(
int i=0; i<device_count; ++i)
59 SECTION(
"device supports standard picture options and R200 extension options, and nothing else" )
61 const int supported_options[] = {
106 if(std::find(std::begin(supported_options),
std::end(supported_options), i) !=
std::end(supported_options))
123 TEST_CASE(
"R200 device extrinsics are within expected parameters",
"[live] [r200]" )
131 for(
int i=0; i<device_count; ++i)
136 SECTION(
"no extrinsic transformation between DEPTH and INFRARED" )
145 SECTION(
"only x-axis translation (~70 mm) between DEPTH and INFRARED2" )
157 SECTION(
"only translation between DEPTH and RECTIFIED_COLOR" )
165 SECTION(
"depth scale is 0.001 (by default)" )
172 TEST_CASE(
"R200 infrared2 streaming modes exactly match infrared streaming modes",
"[live] [r200]" )
180 for(
int i=0; i<device_count; ++i)
187 REQUIRE( infrared_mode_count > 0 );
191 for(
int j=0; j<infrared_mode_count; ++j)
194 int infrared_width = 0, infrared_height = 0, infrared_framerate = 0;
rs_format infrared_format =
RS_FORMAT_ANY;
197 int infrared2_width = 0, infrared2_height = 0, infrared2_framerate = 0;
rs_format infrared2_format =
RS_FORMAT_ANY;
200 REQUIRE( infrared_width == infrared2_width );
201 REQUIRE( infrared_height == infrared2_height );
202 REQUIRE( infrared_format == infrared2_format );
203 REQUIRE( infrared_framerate == infrared2_framerate );
219 REQUIRE( infrared_intrin.
fx == infrared_intrin.
fx );
220 REQUIRE( infrared_intrin.
fy == infrared_intrin.
fy );
247 TEST_CASE(
"R200 streams 480x360 depth",
"[live] [r200] [one-camera]" )
252 TEST_CASE(
"R200 streams 628x468 depth",
"[live] [r200] [one-camera]" )
257 TEST_CASE(
"R200 streams 320x240 depth",
"[live] [r200] [one-camera]" )
262 TEST_CASE(
"R200 streams 480x360 depth (30 fps)",
"[live] [r200] [one-camera]" )
267 TEST_CASE(
"R200 streams 628x468 depth (30 fps)",
"[live] [r200] [one-camera]" )
272 TEST_CASE(
"R200 streams 320x240 depth (30 fps)",
"[live] [r200] [one-camera]" )
277 TEST_CASE(
"R200 streams 480x360 depth (90 fps)",
"[live] [r200] [one-camera]" )
282 TEST_CASE(
"R200 streams 628x468 depth (90 fps)",
"[live] [r200] [one-camera]" )
287 TEST_CASE(
"R200 streams 320x240 depth (90 fps)",
"[live] [r200] [one-camera]" )
296 TEST_CASE(
"R200 streams HD color",
"[live] [r200] [one-camera]" )
301 TEST_CASE(
"R200 streams VGA color",
"[live] [r200] [one-camera]" )
306 TEST_CASE(
"R200 streams VGA color (60 fps)",
"[live] [r200] [one-camera]" )
311 TEST_CASE(
"R200 streams 480x360 depth and HD color",
"[live] [r200] [one-camera]" )
317 TEST_CASE(
"R200 streams 628x468 depth and HD color",
"[live] [r200] [one-camera]" )
323 TEST_CASE(
"R200 streams 320x240 depth and HD color",
"[live] [r200] [one-camera]" )
329 TEST_CASE(
"R200 streams 480x360 depth and VGA color",
"[live] [r200] [one-camera]" )
335 TEST_CASE(
"R200 streams 628x468 depth and VGA color",
"[live] [r200] [one-camera]" )
341 TEST_CASE(
"R200 streams 320x240 depth and VGA color",
"[live] [r200] [one-camera]" )
347 TEST_CASE(
"R200 streams 480x360 depth and VGA color (60 fps)",
"[live] [r200] [one-camera]" )
353 TEST_CASE(
"R200 streams HD Raw10",
"[live] [r200] [one-camera]" )
362 TEST_CASE(
"R200 streams 640x480 infrared (left 8 bit)",
"[live] [r200] [one-camera]" )
367 TEST_CASE(
"R200 streams 640x480 infrared (left 16 bit)",
"[live] [r200] [one-camera]" )
372 TEST_CASE(
"R200 streams 640x480 infrared (right 8 bit)",
"[live] [r200] [one-camera]" )
377 TEST_CASE(
"R200 streams 640x480 infrared (right 16 bit)",
"[live] [r200] [one-camera]" )
382 TEST_CASE(
"R200 streams 640x480 infrared (left+right 8 bit)",
"[live] [r200] [one-camera]" )
388 TEST_CASE(
"R200 streams 640x480 infrared (left+right 16 bit)",
"[live] [r200] [one-camera]" )
394 TEST_CASE(
"R200 streams 480x360 depth and 492x372 infrared (left+right 16 bit)",
"[live] [r200] [one-camera]" )
401 TEST_CASE(
"R200 streams 480x360 depth, VGA color, and 492x372 infrared",
"[live] [r200] [one-camera]" )
409 TEST_CASE(
"R200 streams 628x468 depth, VGA color, and 640x480 infrared",
"[live] [r200] [one-camera]" )
417 TEST_CASE(
"R200 streams 320x240 depth, VGA color, and 332x252 infrared",
"[live] [r200] [one-camera]" )
429 TEST_CASE(
"R200 streams 640x480 depth and infrared",
"[live] [r200] [one-camera]" )
436 TEST_CASE(
"R200 streams 628x468 depth and infrared",
"[live] [r200] [one-camera]" )
443 TEST_CASE(
"R200 streams 492x372 depth and infrared",
"[live] [r200] [one-camera]" )
450 TEST_CASE(
"R200 streams 480x360 depth and infrared",
"[live] [r200] [one-camera]" )
457 TEST_CASE(
"R200 streams 332x252 depth and infrared",
"[live] [r200] [one-camera]" )
464 TEST_CASE(
"R200 streams 320x240 depth and infrared",
"[live] [r200] [one-camera]" )
502 TEST_CASE(
"R200 supports RS_OPTION_R200_LR_AUTO_EXPOSURE_ENABLED",
"[live] [r200]" )
507 TEST_CASE(
"R200 supports RS_OPTION_R200_LR_GAIN",
"[live] [r200]" )
512 TEST_CASE(
"R200 supports RS_OPTION_R200_LR_EXPOSURE",
"[live] [r200]" )
521 TEST_CASE(
"R200 emitter defaults to off if depth is not enabled/streamed",
"[live] [r200]" )
545 TEST_CASE(
"R200 emitter defaults to on if depth is enabled/streamed",
"[live] [r200]" )
567 TEST_CASE(
"R200 emitter can be enabled even if depth is not enabled/streamed",
"[live] [r200]" )
595 TEST_CASE(
"R200 emitter can be turned off even if depth is enabled/streamed",
"[live] [r200]" )
621 TEST_CASE(
"R200 emitter can be turned on and off after streaming has begun",
"[live] [r200]" )
645 TEST_CASE(
"R200 supports RS_OPTION_R200_DEPTH_UNITS",
"[live] [r200]" )
658 for(
int value : {100, 500, 1000, 2000, 10000})
667 TEST_CASE(
"R200 supports RS_OPTION_R200_DEPTH_CLAMP_MIN",
"[live] [r200]" )
672 TEST_CASE(
"R200 supports RS_OPTION_R200_DEPTH_CLAMP_MAX",
"[live] [r200]" )
681 TEST_CASE(
"a single R200 can stream a variety of reasonable streaming mode combinations",
"[live] [r200] [one-camera]" )
685 SECTION(
"exactly one device is connected" )
694 SECTION(
"device name is Intel RealSense R200" )
700 SECTION(
"streaming is possible in some reasonable configurations" )
702 SECTION(
"streaming DEPTH 480, 360, RS_FORMAT_Z16, 60" )
709 SECTION(
"streaming [DEPTH,480,360,Z16,60] [COLOR,480,360,RGB8,60]" )
717 SECTION(
"streaming [DEPTH,480,360,Z16,60] [IR,480,360,Y8,60]" )
725 SECTION(
"streaming [IR,492,372,Y16,60] [IR2,492,372,Y16,60]" )
733 SECTION(
"streaming [DEPTH,480,360,Z16,60] [COLOR,640,480,RGB8,60] [IR,480,360,Y8,60] [IR2,480,360,Y8,60]" )
745 TEST_CASE(
"streaming five configurations sequentionally",
"[live] [r200] [one-camera]" )
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.
int rs_get_device_count(const rs_context *context, rs_error **error)
Determines number of connected devices.
GLsizei const GLchar *const * string
TEST_CASE("R200 metadata enumerates correctly","[live] [r200]")
void rs_set_device_option(rs_device *device, rs_option option, double value, rs_error **error)
Sets the current value of a single option.
const char * rs_get_device_name(const rs_device *device, rs_error **error)
Retrieves human-readable device model string.
rs_option
Defines general configuration controls.
float rs_get_device_depth_scale(const rs_device *device, rs_error **error)
Retrieves mapping between the units of the depth image and meters.
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.
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.
rs_format rs_get_stream_format(const rs_device *device, rs_stream stream, rs_error **error)
Retrieves the pixel format for a specific stream.
double rs_get_device_option(rs_device *device, rs_option option, rs_error **error)
Retrieves the current value of a single option.
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.
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.
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.
rs_format
Formats: defines how each stream can be encoded.
GLsizei const GLfloat * value
void require_identity_matrix(const float(&matrix)[9])
Cross-stream extrinsics: encode the topology describing how the different devices are connected...
int rs_get_stream_framerate(const rs_device *device, rs_stream stream, rs_error **error)
Retrieves the frame rate for a specific stream.
void test_option(rs_device *device, rs_option option, std::initializer_list< int > good_values, std::initializer_list< int > bad_values)
GLenum GLsizei GLsizei GLint * values
GLuint const GLchar * name
rs_device * rs_get_device(rs_context *context, int index, rs_error **error)
Retrieves connected device by index.
const char * rs_get_device_serial(const rs_device *device, rs_error **error)
Retrieves unique serial number of the device.
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.
#define SECTION(name, description)
void rs_start_device(rs_device *device, rs_error **error)
Begins streaming on all enabled streams for this device.