mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-08-18 18:20:15 +08:00
Merge pull request #645 from odriverobotics/autotuning_offsets
Add input_xxx to the setpoints for autotuning
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user