Go to the documentation of this file.
15 double p1,
double p2,
double p3,
16 double p4,
double p5,
double p6,
double p7) :
17 _stream_type(stream_type),
18 _stream_idx(stream_index),
21 _backend_ts(backend_ts),
23 _params({
p1,
p2, p3, p4, p5, p6, p7 }){}
29 << std::fixed << std::setprecision(3) << _frame_ts <<
"," << _backend_ts <<
"," << _arrival_time;
32 size_t specific_attributes = 0;
34 specific_attributes = 3;
36 specific_attributes = 7;
38 for (
auto i = 0;
i < specific_attributes;
i++)
39 ss <<
"," << _params[
i];
41 return ss.str().c_str();
66 <<
"_" << std::setprecision(14) << std::fixed << depthframe.
get_timestamp()
69 std::stringstream metadata_file;
72 <<
"_metadata_" << std::setprecision(14) << std::fixed << depthframe.
get_timestamp()
79 [filenameS, metadataS, depthframe] {
80 std::ofstream
fs(filenameS, std::ios::trunc);
102 auto t = time(
nullptr);
104 const tm* time = localtime(&
t);
115 std::cout <<
"No imu or pose data collected" << std::endl;
120 std::vector<uint64_t> frames_per_stream;
122 frames_per_stream.emplace_back(kv.second.size());
124 std::sort(frames_per_stream.begin(), frames_per_stream.end());
132 throw std::runtime_error(
stringify() <<
"Cannot open the requested output file " <<
_filePath <<
", please check permissions");
136 csv <<
"\n\nStream Type,F#,HW Timestamp (ms),Backend Timestamp(ms),Host Timestamp(ms)"
137 << (
val_in_range(elem.first.first, { RS2_STREAM_GYRO,RS2_STREAM_ACCEL }) ?
",3DOF_x,3DOF_y,3DOF_z" :
"")
138 << (
val_in_range(elem.first.first, { RS2_STREAM_POSE }) ?
",t_x,t_y,t_z,r_x,r_y,r_z,r_w" :
"")
141 for (
auto i = 0;
i < elem.second.size();
i++)
142 csv << elem.second[
i].to_string();
158 auto stream_uid = std::make_pair(
f.get_profile().stream_type(),
159 f.get_profile().stream_index());
165 long long backend_timestamp = 0LL;
174 f.get_profile().stream_index(),
175 f.get_frame_number(),
188 auto pose = pf.get_pose_data();
199 std::unique_lock<std::mutex> lck(
_m);
219 if (motionframe || poseframe)
@ RS2_FRAME_METADATA_FRAME_TIMESTAMP
float get_distance(int x, int y) const
::realsense_legacy_msgs::pose_< std::allocator< void > > pose
const char * rs2_stream_to_string(rs2_stream stream)
unsigned long long get_frame_number() const
GLsizei const GLchar *const * string
const std::string stream_name
std::string stream_name() const
rs2_stream stream_type() const
double get_timestamp() const
@ RS2_FRAME_METADATA_BACKEND_TIMESTAMP
def axes(out, pos, rotation=np.eye(3), size=0.075, thickness=2)
void sort(sort_type m_sort_type, const std::string &in, const std::string &out)
stream_profile get_profile() const
@ RS2_FRAME_METADATA_TIME_OF_ARRIVAL
def record(file_name, default_profile)
rs2_stream
Streams are different types of data provided by RealSense devices.
librealsense2
Author(s): LibRealSense ROS Team
autogenerated on Fri Aug 2 2024 08:30:01