MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / readMatrixFromFile

Function readMatrixFromFile

tracking/apps/tracker_node_3d.cpp:187–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185}
186
187Eigen::Matrix4d
188readMatrixFromFile (std::string filename)
189{
190 Eigen::Matrix4d matrix;
191 std::string line;
192 std::ifstream myfile (filename.c_str());
193 if (myfile.is_open())
194 {
195 int k = 0;
196 std::string number;
197 while (myfile >> number)
198 {
199 matrix(int(k/4), int(k%4)) = std::atof(number.c_str());
200 k++;
201 }
202 myfile.close();
203 }
204
205 std::cout << matrix << std::endl;
206
207 return matrix;
208}
209
210/**
211 * \brief Read the DetectionArray message and use the detections for creating/updating/deleting tracks

Callers 1

detection_cbFunction · 0.70

Calls 2

matrixClass · 0.85
closeMethod · 0.80

Tested by

no test coverage detected