Where is the function to update and get the raw Inertial Sensor values?

Development question: I’m trying to obtain the raw form of the gyro outputs from the backend. Following ins.update() in main loop eventually takes me to the AP_InertialSensor class update() function (Lines 1535 to 1537 in AP_InertialSensor.cpp) :

 for (uint8_t i=0; i<_backend_count; i++) {
            _backends[i]->update();
        }

This call to update the backend of the inertial sensor takes me to a virtual function within the AP_InertialSensor_Backend class (Line 50 in AP_InertialSensor_Backend.h):

    virtual bool update() = 0; 

This function is virtual and I cant find an override in AP_InertialSensor_Backend.cpp so i’ve hit a dead end. What function is to occur here to update the INS values (ideally getting the raw forms before any processing/filtering) ?

Look for the update override in a specific backend, such as AP_InertialSensor_LSM9DS0.cpp which is a subclass of AP_InertialSensor_Backend. Also look at the common functions update_accel and update_gyro implemented in AP_InertialSensor_Backend.
VSCode is pretty good at showing all of the overrides:

2 Likes