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

Function readMatrixFromFile

tracking/apps/tracker_node.cpp:184–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182}
183
184Eigen::Matrix4d
185readMatrixFromFile (std::string filename)
186{
187 Eigen::Matrix4d matrix;
188 std::string line;
189 std::ifstream myfile (filename.c_str());
190 if (myfile.is_open())
191 {
192 int k = 0;
193 std::string number;
194 while (myfile >> number)
195 {
196 matrix(int(k/4), int(k%4)) = std::atof(number.c_str());
197 k++;
198 }
199 myfile.close();
200 }
201
202 std::cout << matrix << std::endl;
203
204 return matrix;
205}
206
207/**
208 * \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