Loose-GNSS-IMU/Loose-GNSS-IMU/ReaderIMU.cpp
// This function extracts and stores epochwise observations from file
This function extracts and stores epochwise observations from file
This function extracts and stores epochwise observations from file
void ReaderIMU::obsEpoch(ifstream& infile) {
	double epochTime = 0;
	vector<double> acc;
	vector<double> gyr;
	string line; getline(infile, line);
	if (!line.empty()) {
		istringstream iss(line);
		vector<string> words{ istream_iterator<string>{iss}, istream_iterator<string>{} };
		epochTime = stod(words[0]);
		acc.push_back(stod(words[1])); acc.push_back(stod(words[2])); acc.push_back(stod(words[3]));
		gyr.push_back(stod(words[4])); gyr.push_back(stod(words[5])); gyr.push_back(stod(words[6]));
	}
	_IMUdata.imuTime = epochTime;
	_IMUdata.Acc = acc;
	_IMUdata.Gyr = gyr;
	_IMUdata.Ax = acc[0]; _IMUdata.Ay = acc[1]; _IMUdata.Az = acc[2];
	_IMUdata.Gx = gyr[0]; _IMUdata.Gy = gyr[1]; _IMUdata.Gz = gyr[2];
}
void ReaderIMU :: obsEpoch ( ifstream & infile ) { double epochTime = 0 ; vector < double > acc ; vector < double > gyr ; string line ; getline ( infile , line ) ; if ( ! line . empty ( ) ) { istringstream iss ( line ) ; vector < string > words { istream_iterator < string > { iss } , istream_iterator < string > { } } ; epochTime = stod ( words [ 0 ] ) ; acc . push_back ( stod ( words [ 1 ] ) ) ; acc . push_back ( stod ( words [ 2 ] ) ) ; acc . push_back ( stod ( words [ 3 ] ) ) ; gyr . push_back ( stod ( words [ 4 ] ) ) ; gyr . push_back ( stod ( words [ 5 ] ) ) ; gyr . push_back ( stod ( words [ 6 ] ) ) ; } _IMUdata . imuTime = epochTime ; _IMUdata . Acc = acc ; _IMUdata . Gyr = gyr ; _IMUdata . Ax = acc [ 0 ] ; _IMUdata . Ay = acc [ 1 ] ; _IMUdata . Az = acc [ 2 ] ; _IMUdata . Gx = gyr [ 0 ] ; _IMUdata . Gy = gyr [ 1 ] ; _IMUdata . Gz = gyr [ 2 ] ; }
This function extracts and stores epochwise observations from file
This function extracts and stores epochwise observations from file
// Initializing Variables // Read first line // Split words in the line // Extract observation time // Organizing Acceleration Observations // Organizing Gyroscope Observations // Organize IMU Data structure