Exemple #1
0
void IMU::loadCalibrationData(IO::File& calibrationFile)
	{
	calibrationFile.setEndianness(Misc::LittleEndian);
	
	/* Read the accelerometer matrix: */
	for(int i=0;i<3;++i)
		for(int j=0;j<4;++j)
			calibrationData.accelerometerMatrix(i,j)=Scalar(calibrationFile.read<Misc::Float64>());
	
	// DEBUGGING
	std::cout<<"Accelerometer matrix: "<<calibrationData.accelerometerMatrix<<std::endl;
	
	/* Read the gyroscope matrix: */
	for(int i=0;i<3;++i)
		for(int j=0;j<4;++j)
			calibrationData.gyroscopeMatrix(i,j)=Scalar(calibrationFile.read<Misc::Float64>());
	
	// DEBUGGING
	std::cout<<"Gyroscope matrix: "<<calibrationData.gyroscopeMatrix<<std::endl;
	
	if(calibrationData.magnetometer)
		{
		/* Read the magnetometer matrix: */
		for(int i=0;i<3;++i)
			for(int j=0;j<4;++j)
				calibrationData.magnetometerMatrix(i,j)=Scalar(calibrationFile.read<Misc::Float64>());
		
		// DEBUGGING
		std::cout<<"Magnetometer matrix: "<<calibrationData.magnetometerMatrix<<std::endl;
		}
	}
void LensDistortionParameters::write(IO::File& file) const
{
    file.setEndianness(Misc::LittleEndian);
    file.write<double>(center.getComponents(),2);
    file.write<double>(radiusScale2);
    file.write<double>(kappa,2);
    file.write<double>(rho,3);
}