mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-09-23 00:59:54 +08:00
Add _src to estimate pointers
This commit is contained in:
@@ -278,8 +278,8 @@ bool Axis::run_lockin_spin(const LockinConfig_t &lockin_config) {
|
||||
|
||||
// Note run_sensorless_control_loop and run_closed_loop_control_loop are very similar and differ only in where we get the estimate from.
|
||||
bool Axis::run_sensorless_control_loop() {
|
||||
controller_.pos_estimate_linear_ = nullptr;
|
||||
controller_.pos_estimate_circular_ = nullptr;
|
||||
controller_.pos_estimate_linear_src_ = nullptr;
|
||||
controller_.pos_estimate_circular_src_ = nullptr;
|
||||
controller_.pos_estimate_valid_src_ = nullptr;
|
||||
controller_.vel_estimate_src_ = &sensorless_estimator_.vel_estimate_;
|
||||
controller_.vel_estimate_valid_src_ = &sensorless_estimator_.vel_estimate_valid_;
|
||||
@@ -302,8 +302,9 @@ bool Axis::run_closed_loop_control_loop() {
|
||||
}
|
||||
|
||||
// To avoid any transient on startup, we intialize the setpoint to be the current position
|
||||
controller_.pos_setpoint_ = *controller_.pos_estimate_linear_;
|
||||
controller_.input_pos_ = *controller_.pos_estimate_linear_;
|
||||
// TODO: use circular src if in circular mode.
|
||||
controller_.pos_setpoint_ = *controller_.pos_estimate_linear_src_;
|
||||
controller_.input_pos_ = *controller_.pos_estimate_linear_src_;
|
||||
|
||||
// Avoid integrator windup issues
|
||||
controller_.vel_integrator_torque_ = 0.0f;
|
||||
@@ -353,7 +354,7 @@ bool Axis::run_homing() {
|
||||
}
|
||||
|
||||
// To avoid any transient on startup, we intialize the setpoint to be the current position
|
||||
controller_.pos_setpoint_ = *controller_.pos_estimate_linear_;
|
||||
controller_.pos_setpoint_ = *controller_.pos_estimate_linear_src_;
|
||||
|
||||
// Avoid integrator windup issues
|
||||
controller_.vel_integrator_torque_ = 0.0f;
|
||||
|
||||
Reference in New Issue
Block a user