mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 00:03:33 +08:00
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.
This commit is contained in:
committed by
Lorenz Meier
parent
eca2aeccf9
commit
3787fafdff
@@ -256,12 +256,12 @@ PX4FLOW::init()
|
|||||||
/* sensor is ok, but we don't really know if it is within range */
|
/* sensor is ok, but we don't really know if it is within range */
|
||||||
_sensor_ok = true;
|
_sensor_ok = true;
|
||||||
|
|
||||||
/* get rotation */
|
/* get yaw rotation from sensor frame to body frame */
|
||||||
param_t rot = param_find("SENS_FLOW_ROT");
|
param_t rot = param_find("SENS_FLOW_ROT");
|
||||||
|
|
||||||
/* only set it if the parameter exists */
|
/* only set it if the parameter exists */
|
||||||
if (rot != PARAM_INVALID) {
|
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);
|
param_get(rot, &val);
|
||||||
|
|
||||||
_sensor_rotation = (enum Rotation)val;
|
_sensor_rotation = (enum Rotation)val;
|
||||||
@@ -538,7 +538,7 @@ PX4FLOW::collect()
|
|||||||
|
|
||||||
report.sensor_id = 0;
|
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;
|
float zeroval = 0.0f;
|
||||||
|
|
||||||
rotate_3f(_sensor_rotation, report.pixel_flow_x_integral, report.pixel_flow_y_integral, zeroval);
|
rotate_3f(_sensor_rotation, report.pixel_flow_x_integral, report.pixel_flow_y_integral, zeroval);
|
||||||
|
|||||||
Reference in New Issue
Block a user