Sensor Lab 1

Objective

This lab has two objectives:

(1) Low pass filter the accelerometers and rate gyros using a variable sample rate.

(2) Write your own routines to estimate roll and pitch angles.

Assignment

1. In kestrel.c comment the line that calls gather_sensors() and replace it with a new function, like my_gather_sensors(). Copy the content of gather_sensors.lib below into that library.

2. Modify the section of the code that low pass filters the rate gyros and the accelerometers, so that the low pass filter takes into account the variable sample rate.

3. In kestrel.c comment the line that calls process_euler() and replace it with a new function. Something like estimate_states().

4. Write a state estimation scheme for the roll and pitch angles based soley on the accelerometers.

Additional Material

gather_sensors.lib

The function process_euler() modifies the following variables:

m_floats[MF_PHI_TURN_RATE]  
m_floats[MF_HEADING_RATE]  
m_floats[MF_TRUE_PSI]  
m_floats[MF_PSI_GPS]  
m_floats[MF_PSI_MAG]   
m_floats[MF_PSI_GPS_E_WEIGHT]    
m_bytes[MB_NEW_GPS_HEADING_INFO]   
m_floats[MF_PHI]  
m_floats[MF_THETA]  
m_floats[MF_PSI]



For quadrotors we are primarily interested in 
m_floats[MF_PHI]   - estimated roll angle
m_floats[MF_THETA] - estimated pitch angle
m_floats[MF_PSI]   - estimated yaw angle