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

Function readMatrixFromFile

tracking/apps/tracker_object_node.cpp:186–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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