mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
Flow driver: Handle rotation parameter if present
This commit is contained in:
@@ -62,6 +62,7 @@
|
|||||||
|
|
||||||
#include <systemlib/perf_counter.h>
|
#include <systemlib/perf_counter.h>
|
||||||
#include <systemlib/err.h>
|
#include <systemlib/err.h>
|
||||||
|
#include <systemlib/param/param.h>
|
||||||
|
|
||||||
#include <conversion/rotation.h>
|
#include <conversion/rotation.h>
|
||||||
|
|
||||||
@@ -255,6 +256,17 @@ 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 */
|
||||||
|
param_t rot = param_find("SENS_FLOW_ROT");
|
||||||
|
|
||||||
|
/* only set it if the parameter exists */
|
||||||
|
if (rot != PARAM_INVALID) {
|
||||||
|
int32_t val = 0;
|
||||||
|
param_get(rot, &val);
|
||||||
|
|
||||||
|
_sensor_rotation = (enum Rotation)val;
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user