35 using namespace TCLAP;
45 std::vector<std::string> tokens;
48 line.erase(line.find_last_not_of(
"\t\n\v\r ") + 1);
50 stringstream ss(line);
54 getline(ss, substr, separator);
55 tokens.push_back(substr);
63 std::ostringstream
ss;
71 for (
const auto&
i : list) {
86 if (ss.fail() || ss.get(c))
88 throw runtime_error(
string(
string(
"Invalid numeric input - ") + s +
string(
"\n")));
109 throw runtime_error((
string(
"Invalid format - ") + str +
string(
"\n")).c_str());
121 throw runtime_error((
string(
"Invalid stream type - ") + str +
string(
"\n")).c_str());
131 std::stringstream ss;
135 << profile.
format() <<
"," 139 ss <<
"," << vp.width() <<
"," << vp.height();
142 return ss.str().c_str();
186 void save_data_to_file(
const string& out_filename);
187 void collect_frame_attributes(
rs2::frame f, std::chrono::time_point<std::chrono::high_resolution_clock> start_time);
188 bool collecting(std::chrono::time_point<std::chrono::high_resolution_clock> start_time);
196 double _p1=0.,
double _p2=0.,
double _p3=0.,
197 double _p4=0.,
double _p5=0.,
double _p6=0.,
double _p7=0.):
198 _frame_number(frame_number),
200 _arrival_time(host_ts),
202 _stream_type(stream_type),
203 _stream_idx(stream_index),
204 _params({_p1,_p2,_p3,_p4,_p5,_p6,_p7})
209 std::stringstream ss;
212 << _stream_idx <<
"," << _frame_number <<
"," 213 << std::fixed << std::setprecision(3) << _ts <<
"," << _arrival_time;
216 size_t specific_attributes = 0;
218 specific_attributes = 3;
220 specific_attributes = 7;
222 for (
auto i=0;
i<specific_attributes;
i++)
223 ss <<
"," << _params[
i];
225 return ss.str().c_str();
239 std::shared_ptr<rs2::device>
_dev;
248 bool parse_configuration(
const std::string&
line,
const std::vector<std::string>& tokens,
252 bool configure_sensors();
const char * rs2_format_to_string(rs2_format format)
int parse_number(char const *s, int base=0)
application_stop _stop_cond
std::string to_lower(std::string x)
std::vector< std::string > tokenize(std::string line, char separator)
rs2_timestamp_domain _domain
std::vector< rs2::sensor > active_sensors
unsigned long long _frame_number
std::ostream & operator<<(std::ostream &os, const stream_request &req)
std::string stream_name() const
GLsizei const GLchar *const * string
std::string get_profile_description(const rs2::stream_profile &profile)
frame_record(unsigned long long frame_number, double frame_ts, double host_ts, rs2_timestamp_domain domain, rs2_stream stream_type, int stream_index, double _p1=0., double _p2=0., double _p3=0., double _p4=0., double _p5=0., double _p6=0., double _p7=0.)
rs2_stream parse_stream_type(const string str)
std::vector< rs2::stream_profile > selected_stream_profiles
std::map< std::pair< rs2_stream, int >, std::vector< frame_record > > data_collection
GLint GLsizei GLsizei height
int parse_fps(const string str)
GLint GLint GLsizei GLint GLenum format
unsigned __int64 uint64_t
std::array< double, 7 > _params
rs2_format
A stream's format identifies how binary data is encoded within a frame.
rs2_format parse_format(const string str)
rs2_stream
Streams are different types of data provided by RealSense devices.
rs2_format format() const
rs2_format _stream_format
const char * rs2_stream_to_string(rs2_stream stream)
GLbitfield GLuint64 timeout
const std::string DEF_OUTPUT_FILE_NAME("frames_data.csv")
bool val_in_range(const T &val, const std::initializer_list< T > &list)
std::shared_ptr< rs2::device > _dev
std::vector< stream_request > user_requests
GLuint GLenum GLenum transform
const uint64_t DEF_FRAMES_NUMBER
std::string to_string() const
const std::vector< rs2::sensor > & selected_sensors() const
rs2_stream stream_type() const
void copy(void *dst, void const *src, size_t size)
rs2_timestamp_domain
Specifies the clock in relation to which the frame timestamp was measured.