MCPcopy Create free account
hub / github.com/Pamphlett/Outram / load_pose_with_time

Function load_pose_with_time

src/STDesc.cpp:108–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108void load_pose_with_time(
109 const std::string &pose_file,
110 std::vector<std::pair<Eigen::Vector3d, Eigen::Matrix3d>> &poses_vec,
111 std::vector<double> &times_vec) {
112 times_vec.clear();
113 poses_vec.clear();
114 std::ifstream fin(pose_file);
115 std::string line;
116 Eigen::Matrix<double, 1, 7> temp_matrix;
117 while (getline(fin, line)) {
118 std::istringstream sin(line);
119 std::vector<std::string> Waypoints;
120 std::string info;
121 int number = 0;
122 while (getline(sin, info, ' ')) {
123 if (number == 0) {
124 double time;
125 std::stringstream data;
126 data << info;
127 data >> time;
128 times_vec.push_back(time);
129 number++;
130 } else {
131 double p;
132 std::stringstream data;
133 data << info;
134 data >> p;
135 temp_matrix[number - 1] = p;
136 if (number == 7) {
137 Eigen::Vector3d translation(temp_matrix[0], temp_matrix[1],
138 temp_matrix[2]);
139 Eigen::Quaterniond q(temp_matrix[6], temp_matrix[3], temp_matrix[4],
140 temp_matrix[5]);
141 std::pair<Eigen::Vector3d, Eigen::Matrix3d> single_pose;
142 single_pose.first = translation;
143 single_pose.second = q.toRotationMatrix();
144 poses_vec.push_back(single_pose);
145 }
146 number++;
147 }
148 }
149 }
150}
151
152void load_keyframes_pose_pcd(
153 const std::string &pose_file, std::vector<int> &index_vec,

Callers

nothing calls this directly

Calls 2

clearMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected