From ed510d4f87f278ae9f700a179959a365aaa33f2a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 6 Dec 2014 18:14:43 +1100 Subject: [PATCH] AP_OpticalFlow: run PX4 flow sensor at 10Hz Pair-Programmed-With: Paul Riseborough --- libraries/AP_OpticalFlow/AP_OpticalFlow_PX4.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libraries/AP_OpticalFlow/AP_OpticalFlow_PX4.cpp b/libraries/AP_OpticalFlow/AP_OpticalFlow_PX4.cpp index 2871e5a89f..266e69e680 100644 --- a/libraries/AP_OpticalFlow/AP_OpticalFlow_PX4.cpp +++ b/libraries/AP_OpticalFlow/AP_OpticalFlow_PX4.cpp @@ -47,6 +47,11 @@ void AP_OpticalFlow_PX4::init(void) return; } + // change to 10Hz update + if (ioctl(_fd, SENSORIOCSPOLLRATE, 10) != 0) { + hal.console->printf("Unable to set flow rate to 10Hz\n"); + } + // if we got this far, the sensor must be healthy _flags.healthy = true; }