Calculating 3d Displacement using Sensor Stick

Hi I have a hexacopter that has a GPS antenna on top of it and a radar antenna on the bottom of it. I want to be able to know where the radar antenna is during flight so I can use the positional data from the GPS antenna and then just add the displacement from the GPS antenna to the radar antenna. Obviously if my hexacopter was level the whole flight then the displacement between the antennas would be constant but its not the hexacopter will exhibit some roll, pitch and yaw during flight.

I have a 9DOF sparkfun sensor stick and would like to use it to be able to measure the roll, pitch and yaw angles and then use a matlab script to calculate the real time displacement between the two antennas.

My question is does the sensor stick output roll, pitch and yaw angles or do you have to calculate that yourself by examining the data from the sensor stick?

Also has anyone done anything similar to this project?

Thank you,

Brian

You need AHRS (Attitude, Heading and Reference System) software to produce yaw, pitch and roll angles from the sensor stick. There are a number of possibilities, depending on which MCU you have. One example is this: https://richardstechnotes.wordpress.com … /rtimulib/

For best results (and sometimes to get any results at all) it is essential to calibrate the accelerometer and the magnetometer. My favorite procedure is this one: http://sailboatinstruments.blogspot.com … ation.html