Merge pull request #645 from odriverobotics/autotuning_offsets

Add input_xxx to the setpoints for autotuning
This commit is contained in:
Oskar Weigl
2021-12-01 15:37:40 -08:00
committed by GitHub
+3 -3
View File
@@ -226,9 +226,9 @@ bool Controller::update() {
autotuning_phase_ = wrap_pm_pi(autotuning_phase_ + (2.0f * M_PI * autotuning_.frequency * current_meas_period));
float c = our_arm_cos_f32(autotuning_phase_);
float s = our_arm_sin_f32(autotuning_phase_);
pos_setpoint_ = autotuning_.pos_amplitude * s; // + pos_amp_c * c
vel_setpoint_ = autotuning_.vel_amplitude * c;
torque_setpoint_ = autotuning_.torque_amplitude * -s;
pos_setpoint_ = input_pos_ + autotuning_.pos_amplitude * s; // + pos_amp_c * c
vel_setpoint_ = input_vel_ + autotuning_.vel_amplitude * c;
torque_setpoint_ = input_torque_ + autotuning_.torque_amplitude * -s;
} break;
default: {
set_error(ERROR_INVALID_INPUT_MODE);