modalai_esc: directly using deadband param value instead of converting it to RPM

This commit is contained in:
modaltb 2022-10-04 17:14:59 -07:00 committed by GitHub
parent 0af87ec745
commit 06a0aedbdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -966,8 +966,8 @@ void ModalaiEsc::mix_turtle_mode(uint16_t outputs[MAX_ACTUATORS])
float)_parameters.turtle_motor_percent / 100.f);
// Add a little bit to the motorOutputMin so props aren't spinning when sticks are centered
float dead_band_rpm = ((float)_parameters.turtle_motor_deadband / 100.0f) * _rpm_fullscale;
motor_output = (motor_output < _rpm_turtle_min + dead_band_rpm) ? 0.0f : (motor_output - dead_band_rpm);
motor_output = (motor_output < _rpm_turtle_min + _parameters.turtle_motor_deadband) ? 0.0f :
(motor_output - _parameters.turtle_motor_deadband);
// using the output map here for clarity as PX4 motors are 1-4
switch (_output_map[i].number) {