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

Method euroc_sequence

example/util/euroc_planeSeg_util.cc:32–80  ·  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 // FW:
39 const std::string mask_img_dir_path = seq_dir_path + "/cam0/seg/";
40
41 timestamps_.clear();
42 left_img_file_paths_.clear();
43 right_img_file_paths_.clear();
44
45 // FW:
46 _mask_img_file_paths.clear();
47
48 // load timestamps
49 std::ifstream ifs_timestamp;
50 ifs_timestamp.open(timestamp_file_path.c_str());
51 if (!ifs_timestamp)
52 {
53 throw std::runtime_error("Could not load a timestamp file from " + timestamp_file_path);
54 }
55
56 // load header row
57 std::string s;
58 getline(ifs_timestamp, s);
59
60 while (!ifs_timestamp.eof())
61 {
62 getline(ifs_timestamp, s);
63 std::replace(s.begin(), s.end(), ',', ' ');
64 if (!s.empty())
65 {
66 std::stringstream ss;
67 ss << s;
68 unsigned long long timestamp;
69 ss >> timestamp;
70 timestamps_.push_back(timestamp / static_cast<double>(1E9));
71 left_img_file_paths_.push_back(left_img_dir_path + std::to_string(timestamp) + ".png");
72 right_img_file_paths_.push_back(right_img_dir_path + std::to_string(timestamp) + ".png");
73
74 // FW:
75 _mask_img_file_paths.push_back(mask_img_dir_path + std::to_string(timestamp) + ".png");
76 }
77 }
78
79 ifs_timestamp.close();
80}
81
82std::vector<euroc_sequence::frame> euroc_sequence::get_frames() const
83{

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