AHRSInterface.GyroCal.GyroCal C# (CSharp) Method

GyroCal() public method

public GyroCal ( AHRS sensor ) : System
sensor AHRS
return System
        public GyroCal(AHRS sensor)
        {
            int i = 0;

            InitializeComponent();

            this.sensor = sensor;

            // Add DataReceived event handler.
            sensor.DataReceivedEvent += new DataReceivedDelegate(DataReceivedEventHandler);
            sensor.confReceivedEvent += new confReceivedDelegate(confReceivedEventHandler);
            confReceivedEventHandler(i);

            data_collection_enabled = false;
            next_data_index = 0;

            loggedData = new double[SAMPLES, 3];
            threshold = 1.5 * 3.14159 / 180;

            bias = new double[3];

            calMat = new double[3, 3];
            calMat[0, 0] = 1.0;
            calMat[1, 1] = 1.0;
            calMat[2, 2] = 1.0;

            D = new GeneralMatrix(SAMPLES, 10);

            for (i = 0; i < SAMPLES; i++)
            {
                loggedData[i,0] = 0;
                loggedData[i, 1] = 0;
                loggedData[i, 2] = 0;
            }
        }