8 #if !defined(MAKEFILE) || ( defined(LIVE_TEST) && defined(SR300_TEST) ) 10 #define CATCH_CONFIG_MAIN 19 TEST_CASE(
"SR300 metadata enumerates correctly",
"[live] [sr300]" )
27 for(
int i=0; i<device_count; ++i)
32 SECTION(
"device name is Intel RealSense SR300" )
40 TEST_CASE(
"SR300 devices support all required options",
"[live] [sr300]" )
48 for(
int i=0; i<device_count; ++i)
53 SECTION(
"device supports standard picture options and SR300 extension options, and nothing else" )
55 std::vector<rs_option> supported_options{
89 if(std::find(std::begin(supported_options),
std::end(supported_options), i) !=
std::end(supported_options))
106 TEST_CASE(
"SR300 device extrinsics are within expected parameters",
"[live] [sr300]" )
114 for(
int i=0; i<device_count; ++i)
119 SECTION(
"no extrinsic transformation between DEPTH and INFRARED" )
130 SECTION(
"depth scale is 0.000125 (by default)" )
156 TEST_CASE(
"SR300 streams 1080p color",
"[live] [sr300] [one-camera]")
161 TEST_CASE(
"SR300 streams 720p color",
"[live] [sr300] [one-camera]")
166 TEST_CASE(
"SR300 streams VGA color",
"[live] [sr300] [one-camera]")
171 TEST_CASE(
"SR300 streams 720p color (60 fps)",
"[live] [sr300] [one-camera]")
176 TEST_CASE(
"SR300 streams VGA color (60 fps)",
"[live] [sr300] [one-camera]")
181 TEST_CASE(
"SR300 streams VGA depth and HD color",
"[live] [sr300] [one-camera]")
187 TEST_CASE(
"SR300 streams HVGA depth and HD color",
"[live] [sr300] [one-camera]")
193 TEST_CASE(
"SR300 streams VGA depth and VGA color",
"[live] [sr300] [one-camera]")
199 TEST_CASE(
"SR300 streams HVGA depth and VGA color",
"[live] [sr300] [one-camera]")
205 TEST_CASE(
"SR300 streams VGA depth and VGA color (60 fps)",
"[live] [sr300] [one-camera]")
211 TEST_CASE(
"SR300 streams HVGA depth and VGA color (60 fps)",
"[live] [sr300] [one-camera]")
221 TEST_CASE(
"SR300 depth stream (Z16)",
"[live] [sr300] [one-camera]")
223 SECTION(
"SR300 streams depth 640x480 (VGA), [10,30,60] fps")
225 for (
auto & fps : { 10,30,60 })
227 INFO(
"Testing " << fps <<
" fps")
232 SECTION(
"SR300 streams depth 640x240 (HVGA), [10,30,60,110] fps")
234 for (
auto & fps : { 10,30,60,110 })
236 INFO(
"Testing " << fps <<
" fps")
246 TEST_CASE(
"SR300 infrared stream (Y16)",
"[live] [sr300] [one-camera]" )
248 SECTION(
"SR300 streams infrared 640x240 depth (VGA), [30,60,120,200] fps")
250 for (
auto & fps : { 30,60,120,200 })
252 INFO(
"Testing " << fps <<
" fps")
262 TEST_CASE(
"SR300 streams 640x480 depth and infrared",
"[live] [sr300] [one-camera]" )
268 TEST_CASE(
"SR300 streams 640x240 depth and infrared",
"[live] [sr300] [one-camera]" )
274 TEST_CASE(
"SR300 streams 640x240 depth and infrared (110 fps)",
"[live] [sr300] [one-camera]" )
280 TEST_CASE(
"SR300 streams 640x480 depth, infrared, and color",
"[live] [sr300] [one-camera]" )
287 TEST_CASE(
"SR300 streams 640x240 depth and infrared (110 fps), and 1080P color (30 fps)",
"[live] [sr300] [one-camera]" )
294 TEST_CASE(
"SR300 streams 640x480 infrared (200 fps), and VGA color (60 fps)",
"[live] [sr300] [one-camera]" )
300 TEST_CASE(
"SR300 streams 640x480 infrared (200 fps), and 1080P color (30 fps)",
"[live] [sr300] [one-camera]" )
337 TEST_CASE(
"SR300 supports RS_OPTION_F200_LASER_POWER",
"[live] [sr300]" )
342 TEST_CASE(
"SR300 supports RS_OPTION_F200_ACCURACY",
"[live] [sr300]" )
347 TEST_CASE(
"SR300 supports RS_OPTION_F200_MOTION_RANGE",
"[live] [sr300]" )
352 TEST_CASE(
"SR300 supports RS_OPTION_F200_FILTER_OPTION",
"[live] [sr300]" )
357 TEST_CASE(
"SR300 supports RS_OPTION_F200_CONFIDENCE_THRESHOLD",
"[live] [sr300]" )
366 TEST_CASE(
"a single SR300 can stream a variety of reasonable streaming mode combinations",
"[live] [sr300] [one-camera]" )
370 SECTION(
"exactly one device is connected" )
379 SECTION(
"device name is Intel RealSense SR300" )
385 SECTION(
"streaming is possible in some reasonable configurations" )
387 INFO(
"Streaming Z16, 60 fps");
392 INFO(
"Streaming Depth + Color 60 fps");
398 INFO(
"Streaming Depth + Infrared 60 fps");
404 INFO(
"Streaming Depth + Infrared + Color 60 fps");
413 inline void test_options(
rs_device * device,
rs_option* option_list,
size_t options, std::vector<double> good_values, std::vector<double> bad_values, std::vector<double> &ret_values,
const std::string & expected_success_msg,
const std::string & expected_error_msg,
bool bWrite)
418 if (good_values.size() == options)
420 if (expected_success_msg.size())
426 if (bad_values.size() == options)
428 if (expected_error_msg.size())
436 std::vector<double> vretVal;
437 vretVal.resize(options);
438 if (expected_success_msg.size())
444 ret_values = vretVal;
449 std::vector<double> good_values, std::vector<double> bad_values, std::vector<double>& ret_values,
const std::string& expected_success_msg,
const std::string& expected_error_msg,
int when,
bool write_cmd)
453 for (
auto opt : options_list)
460 test_options(dev, options_list.data(), options_list.size(), good_values, bad_values, ret_values, expected_success_msg, expected_error_msg, write_cmd);
470 std::this_thread::sleep_for(std::chrono::milliseconds(50));
471 test_options(dev, options_list.data(), options_list.size(), good_values, bad_values, ret_values, expected_success_msg, expected_error_msg, write_cmd);
473 std::this_thread::sleep_for(std::chrono::milliseconds(50));
int rs_get_device_count(const rs_context *context, rs_error **error)
Determines number of connected devices.
void rs_get_device_options(rs_device *device, const rs_option *options, unsigned int count, double *values, rs_error **error)
Efficiently retrieves the value of an arbitrary number of options, using minimal hardware IO...
void rs_set_device_options(rs_device *device, const rs_option *options, unsigned int count, const double *values, rs_error **error)
Efficiently sets the value of an arbitrary number of options, using minimal hardware IO...
GLsizei const GLchar *const * string
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 test_sr300_option(rs_option option, std::initializer_list< int > values, int when)
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_sr300_streaming(std::initializer_list< stream_mode > modes)
void test_sr300_command(rs_device *dev, std::vector< rs_option > options_list, std::vector< double > good_values, std::vector< double > bad_values, std::vector< double > &ret_values, const std::string &expected_success_msg, const std::string &expected_error_msg, int when, bool write_cmd)
void require_identity_matrix(const float(&matrix)[9])
Cross-stream extrinsics: encode the topology describing how the different devices are connected...
void test_options(rs_device *device, rs_option *option_list, size_t options, std::vector< double > good_values, std::vector< double > bad_values, std::vector< double > &ret_values, const std::string &expected_success_msg, const std::string &expected_error_msg, bool bWrite)
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
TEST_CASE("SR300 metadata enumerates correctly","[live] [sr300]")
GLuint const GLchar * name
rs_device * rs_get_device(rs_context *context, int index, rs_error **error)
Retrieves connected device by index.
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.
void rs_stop_device(rs_device *device, rs_error **error)
Ends data acquisition for the specified source providers.