From 3787fafdff5f53ac71ff90bbf7b21505bf3f7bfd Mon Sep 17 00:00:00 2001 From: Paul Riseborough Date: Fri, 30 Dec 2016 07:30:44 +1100 Subject: [PATCH] px4flow: update default rotation and documentation The driver performs the rotation from sensor frame to body frame. The recommended installation default is with the Y sensor axis pointing forward. --- src/drivers/px4flow/px4flow.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/drivers/px4flow/px4flow.cpp b/src/drivers/px4flow/px4flow.cpp index a6d3aed6ed..e2fac83789 100644 --- a/src/drivers/px4flow/px4flow.cpp +++ b/src/drivers/px4flow/px4flow.cpp @@ -256,12 +256,12 @@ PX4FLOW::init() /* sensor is ok, but we don't really know if it is within range */ _sensor_ok = true; - /* get rotation */ + /* get yaw rotation from sensor frame to body frame */ param_t rot = param_find("SENS_FLOW_ROT"); /* only set it if the parameter exists */ if (rot != PARAM_INVALID) { - int32_t val = 0; + int32_t val = 6; // the recommended installation for the flow sensor is with the Y sensor axis forward param_get(rot, &val); _sensor_rotation = (enum Rotation)val; @@ -538,7 +538,7 @@ PX4FLOW::collect() report.sensor_id = 0; - /* rotate measurements according to parameter */ + /* rotate measurements in yaw from sensor frame to body frame according to parameter SENS_FLOW_ROT */ float zeroval = 0.0f; rotate_3f(_sensor_rotation, report.pixel_flow_x_integral, report.pixel_flow_y_integral, zeroval);