mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 04:23:34 +08:00
added a offset parameter for lidar in inav
This commit is contained in:
committed by
Lorenz Meier
parent
0a76347c9d
commit
19bc39e7ad
@@ -543,6 +543,7 @@ int position_estimator_inav_thread_main(int argc, char *argv[])
|
|||||||
/* update lidar separately, needed by terrain estimator */
|
/* update lidar separately, needed by terrain estimator */
|
||||||
if (updated) {
|
if (updated) {
|
||||||
orb_copy(ORB_ID(distance_sensor), distance_sensor_sub, &lidar);
|
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
|
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);
|
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
|
* 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->flow_module_offset_y = param_find("INAV_FLOW_DIST_Y");
|
||||||
h->disable_mocap = param_find("INAV_DISAB_MOCAP");
|
h->disable_mocap = param_find("INAV_DISAB_MOCAP");
|
||||||
h->enable_lidar_alt_est = param_find("INAV_LIDAR_EST");
|
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");
|
h->att_ext_hdg_m = param_find("ATT_EXT_HDG_M");
|
||||||
|
|
||||||
return 0;
|
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->flow_module_offset_y, &(p->flow_module_offset_y));
|
||||||
param_get(h->disable_mocap, &(p->disable_mocap));
|
param_get(h->disable_mocap, &(p->disable_mocap));
|
||||||
param_get(h->enable_lidar_alt_est, &(p->enable_lidar_alt_est));
|
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));
|
param_get(h->att_ext_hdg_m, &(p->att_ext_hdg_m));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ struct position_estimator_inav_params {
|
|||||||
float flow_module_offset_y;
|
float flow_module_offset_y;
|
||||||
int32_t disable_mocap;
|
int32_t disable_mocap;
|
||||||
int32_t enable_lidar_alt_est;
|
int32_t enable_lidar_alt_est;
|
||||||
|
float lidar_calibration_offset;
|
||||||
int32_t att_ext_hdg_m;
|
int32_t att_ext_hdg_m;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -98,6 +99,7 @@ struct position_estimator_inav_param_handles {
|
|||||||
param_t flow_module_offset_y;
|
param_t flow_module_offset_y;
|
||||||
param_t disable_mocap;
|
param_t disable_mocap;
|
||||||
param_t enable_lidar_alt_est;
|
param_t enable_lidar_alt_est;
|
||||||
|
param_t lidar_calibration_offset;
|
||||||
param_t att_ext_hdg_m;
|
param_t att_ext_hdg_m;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user