MCPcopy Create free account
hub / github.com/PeterFWS/Structure-PLP-SLAM / euroc_sequence

Method euroc_sequence

example/util/euroc_util.cc:32–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30#include <algorithm>
31
32euroc_sequence::euroc_sequence(const std::string &seq_dir_path)
33{
34 const std::string timestamp_file_path = seq_dir_path + "/cam0/data.csv";
35 const std::string left_img_dir_path = seq_dir_path + "/cam0/data/";
36 const std::string right_img_dir_path = seq_dir_path + "/cam1/data/";
37
38 timestamps_.clear();
39 left_img_file_paths_.clear();
40 right_img_file_paths_.clear();
41
42 // load timestamps
43 std::ifstream ifs_timestamp;
44 ifs_timestamp.open(timestamp_file_path.c_str());
45 if (!ifs_timestamp)
46 {
47 throw std::runtime_error("Could not load a timestamp file from " + timestamp_file_path);
48 }
49
50 // load header row
51 std::string s;
52 getline(ifs_timestamp, s);
53
54 while (!ifs_timestamp.eof())
55 {
56 getline(ifs_timestamp, s);
57 std::replace(s.begin(), s.end(), ',', ' ');
58 if (!s.empty())
59 {
60 std::stringstream ss;
61 ss << s;
62 unsigned long long timestamp;
63 ss >> timestamp;
64 timestamps_.push_back(timestamp / static_cast<double>(1E9));
65 left_img_file_paths_.push_back(left_img_dir_path + std::to_string(timestamp) + ".png");
66 right_img_file_paths_.push_back(right_img_dir_path + std::to_string(timestamp) + ".png");
67 }
68 }
69
70 ifs_timestamp.close();
71}
72
73std::vector<euroc_sequence::frame> euroc_sequence::get_frames() const
74{

Callers

nothing calls this directly

Calls 9

to_stringFunction · 0.85
openMethod · 0.80
closeMethod · 0.80
clearMethod · 0.45
c_strMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected