mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 23:43:33 +08:00
UAVCAN driver: support throttle linearization (THR_MLD_FAC parameter)
Signed-off-by: RomanBapst <bapstroman@gmail.com>
This commit is contained in:
@@ -425,6 +425,12 @@ void UavcanNode::update_params()
|
||||
if (param_handle != PARAM_INVALID) {
|
||||
param_get(param_handle, &_airmode);
|
||||
}
|
||||
|
||||
param_handle = param_find("THR_MDL_FAC");
|
||||
|
||||
if (param_handle != PARAM_INVALID) {
|
||||
param_get(param_handle, &_thr_mdl_factor);
|
||||
}
|
||||
}
|
||||
|
||||
int UavcanNode::start_fw_server()
|
||||
@@ -905,6 +911,7 @@ int UavcanNode::run()
|
||||
// but this driver could well serve multiple groups.
|
||||
unsigned num_outputs_max = 8;
|
||||
|
||||
_mixers->set_thrust_factor(_thr_mdl_factor);
|
||||
_mixers->set_airmode(_airmode);
|
||||
|
||||
// Do mixing
|
||||
|
||||
@@ -211,6 +211,7 @@ private:
|
||||
perf_counter_t _perf_control_latency;
|
||||
|
||||
Mixer::Airmode _airmode = Mixer::Airmode::disabled;
|
||||
float _thr_mdl_factor = 0.0f;
|
||||
|
||||
// index into _poll_fds for each _control_subs handle
|
||||
uint8_t _poll_ids[NUM_ACTUATOR_CONTROL_GROUPS_UAVCAN];
|
||||
|
||||
Reference in New Issue
Block a user