@ -61,7 +61,7 @@ And much more so PLEASE PM me on DIYDRONES to add your contribution to the List
@@ -61,7 +61,7 @@ And much more so PLEASE PM me on DIYDRONES to add your contribution to the List
#include <APM_PI.h> // PI library
#include <RC_Channel.h> // RC Channel Library
#include <AP_RangeFinder.h> // Range finder library
// convert raw change to horizontal movement in cm
x_cm=-change_x*avg_altitude*conv_factor;// perhaps this altitude should actually be the distance to the ground? i.e. if we are very rolled over it should be longer?
y_cm=-change_y*avg_altitude*conv_factor;// for example if you are leaned over at 45 deg the ground will appear farther away and motion from opt flow sensor will be less