Skip to content
Snippets Groups Projects
Commit 19bc39e7 authored by ChristophTobler's avatar ChristophTobler Committed by Lorenz Meier
Browse files

added a offset parameter for lidar in inav

parent 0a76347c
No related branches found
No related tags found
No related merge requests found
......@@ -543,6 +543,7 @@ int position_estimator_inav_thread_main(int argc, char *argv[])
/* update lidar separately, needed by terrain estimator */
if (updated) {
orb_copy(ORB_ID(distance_sensor), distance_sensor_sub, &lidar);
lidar.current_distance += params.lidar_calibration_offset;
}
if (updated) { //check if altitude estimation for lidar is enabled and new sensor data
......
......@@ -323,6 +323,18 @@ PARAM_DEFINE_FLOAT(INAV_DISAB_MOCAP, 0);
*/
PARAM_DEFINE_FLOAT(INAV_LIDAR_EST, 0);
/**
* LIDAR calibration offset
*
* LIDAR calibration offset. Value will be added to the measured distance
*
* @min -20
* @max 20
* @unit m
* @group Position Estimator INAV
*/
PARAM_DEFINE_FLOAT(INAV_LIDAR_OFF, 0.0f);
/**
* Disable vision input
*
......@@ -375,6 +387,7 @@ int inav_parameters_init(struct position_estimator_inav_param_handles *h)
h->flow_module_offset_y = param_find("INAV_FLOW_DIST_Y");
h->disable_mocap = param_find("INAV_DISAB_MOCAP");
h->enable_lidar_alt_est = param_find("INAV_LIDAR_EST");
h->lidar_calibration_offset = param_find("INAV_LIDAR_OFF");
h->att_ext_hdg_m = param_find("ATT_EXT_HDG_M");
return 0;
......@@ -409,6 +422,7 @@ int inav_parameters_update(const struct position_estimator_inav_param_handles *h
param_get(h->flow_module_offset_y, &(p->flow_module_offset_y));
param_get(h->disable_mocap, &(p->disable_mocap));
param_get(h->enable_lidar_alt_est, &(p->enable_lidar_alt_est));
param_get(h->lidar_calibration_offset, &(p->lidar_calibration_offset));
param_get(h->att_ext_hdg_m, &(p->att_ext_hdg_m));
return 0;
......
......@@ -68,6 +68,7 @@ struct position_estimator_inav_params {
float flow_module_offset_y;
int32_t disable_mocap;
int32_t enable_lidar_alt_est;
float lidar_calibration_offset;
int32_t att_ext_hdg_m;
};
......@@ -98,6 +99,7 @@ struct position_estimator_inav_param_handles {
param_t flow_module_offset_y;
param_t disable_mocap;
param_t enable_lidar_alt_est;
param_t lidar_calibration_offset;
param_t att_ext_hdg_m;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment