fmu + px4io: fixes for MC_AIRMODE parameter

- fmu: in case of _mot_t_max==0 _airmode was not set in the mixer
- px4io: param_val is a float
This commit is contained in:
Beat Küng
2018-03-23 10:35:08 +01:00
committed by Roman Bapst
parent 99ce9cc2a8
commit 0d9693347f
2 changed files with 6 additions and 4 deletions
+3 -2
View File
@@ -1294,7 +1294,6 @@ PX4FMU::cycle()
// factor 2 is needed because actuator outputs are in the range [-1,1]
const float delta_out_max = 2.0f * 1000.0f * dt / (_max_pwm[0] - _min_pwm[0]) / _mot_t_max;
_mixers->set_max_delta_out_once(delta_out_max);
_mixers->set_airmode(_airmode);
}
if (_thr_mdl_fac > FLT_EPSILON) {
@@ -1363,6 +1362,8 @@ PX4FMU::cycle()
ORB_PRIO_DEFAULT);
}
_mixers->set_airmode(_airmode);
perf_end(_ctl_latency);
}
}
@@ -1791,7 +1792,7 @@ void PX4FMU::update_params()
param_handle = param_find("MC_AIRMODE");
if (param_handle != PARAM_INVALID) {
int val;
int32_t val;
param_get(param_handle, &val);
_airmode = val > 0;
PX4_DEBUG("%s: %d", "MC_AIRMODE", _airmode);
+3 -2
View File
@@ -1226,8 +1226,9 @@ PX4IO::task_main()
parm_handle = param_find("MC_AIRMODE");
if (parm_handle != PARAM_INVALID) {
param_get(parm_handle, &param_val);
(void)io_reg_set(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_AIRMODE, SIGNED_TO_REG(param_val));
int32_t param_val_int;
param_get(parm_handle, &param_val_int);
(void)io_reg_set(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_AIRMODE, SIGNED_TO_REG(param_val_int));
}
}