Skip to content
Snippets Groups Projects
Commit 0b369cf7 authored by Randy Mackay's avatar Randy Mackay
Browse files

Optflow - added reference to FastSerial to resolve compile error on Arduino 1.0.

          also removed reference to DCM (no longer required) and removed some old code.
parent 455f1a80
No related branches found
No related tags found
No related merge requests found
...@@ -108,31 +108,4 @@ AP_OpticalFlow::update_position(float roll, float pitch, float cos_yaw_x, float ...@@ -108,31 +108,4 @@ AP_OpticalFlow::update_position(float roll, float pitch, float cos_yaw_x, float
_last_altitude = altitude; _last_altitude = altitude;
_last_roll = roll; _last_roll = roll;
_last_pitch = pitch; _last_pitch = pitch;
} }
\ No newline at end of file
/*
{
// only update position if surface quality is good and angle is not over 45 degrees
if( surface_quality >= 10 && fabs(_dcm->roll) <= FORTYFIVE_DEGREES && fabs(_dcm->pitch) <= FORTYFIVE_DEGREES ) {
altitude = max(altitude, 0);
Vector3f omega = _dcm->get_gyro();
// calculate expected x,y diff due to roll and pitch change
float exp_change_x = omega.x * radians_to_pixels;
float exp_change_y = -omega.y * radians_to_pixels;
// real estimated raw change from mouse
float change_x = dx - exp_change_x;
float change_y = dy - exp_change_y;
// convert raw change to horizontal movement in cm
float x_cm = -change_x * 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?
float y_cm = -change_y * 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
vlon = (float)x_cm * sin_yaw_y - (float)y_cm * cos_yaw_x;
vlat = (float)y_cm * sin_yaw_y - (float)x_cm * cos_yaw_x;
}
}
*/
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
write_register() : writes a value to one of the sensor's register (will be sensor specific) write_register() : writes a value to one of the sensor's register (will be sensor specific)
*/ */
#include <FastSerial.h>
#include <AP_Math.h> #include <AP_Math.h>
#include <AP_DCM.h>
#include <AP_Common.h> #include <AP_Common.h>
// standard rotation matrices // standard rotation matrices
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment