Skip to content

Commit 7aa3516

Browse files
committed
src/modules/flow/flow.c: fix broken gyro compensation
By switching sign, when compensation is calculated.
1 parent d66e28a commit 7aa3516

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/modules/flow/flow.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ uint8_t compute_flow(uint8_t *image1, uint8_t *image2, float x_rate, float y_rat
678678
{
679679
/* calc pixel of gyro */
680680
float y_rate_pixel = y_rate * (get_time_between_images() / 1000000.0f) * focal_length_px;
681-
float comp_x = histflowx + y_rate_pixel;
681+
float comp_x = histflowx - y_rate_pixel;
682682

683683
/* clamp value to maximum search window size plus half pixel from subpixel search */
684684
if (comp_x < (-SEARCH_SIZE - 0.5f))
@@ -697,7 +697,7 @@ uint8_t compute_flow(uint8_t *image1, uint8_t *image2, float x_rate, float y_rat
697697
{
698698
/* calc pixel of gyro */
699699
float x_rate_pixel = x_rate * (get_time_between_images() / 1000000.0f) * focal_length_px;
700-
float comp_y = histflowy - x_rate_pixel;
700+
float comp_y = histflowy + x_rate_pixel;
701701

702702
/* clamp value to maximum search window size plus/minus half pixel from subpixel search */
703703
if (comp_y < (-SEARCH_SIZE - 0.5f))

0 commit comments

Comments
 (0)