mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-09-24 17:53:39 +08:00
Fix some merging pains with the anticogging_saver
This commit is contained in:
@@ -88,7 +88,7 @@ bool Controller::anticogging_calibration(float pos_estimate, float vel_estimate)
|
||||
}
|
||||
if (config_.anticogging.index < 3600) {
|
||||
config_.control_mode = CTRL_MODE_POSITION_CONTROL;
|
||||
input_pos_ = config_.anticogging.index * config_.anticogging.cogging_ratio;
|
||||
input_pos_ = config_.anticogging.index * axis_->encoder_.getCoggingRatio();
|
||||
input_vel_ = 0.0f;
|
||||
input_current_ = 0.0f;
|
||||
input_pos_updated();
|
||||
@@ -100,7 +100,7 @@ bool Controller::anticogging_calibration(float pos_estimate, float vel_estimate)
|
||||
input_vel_ = 0.0f;
|
||||
input_current_ = 0.0f;
|
||||
input_pos_updated();
|
||||
config_.anticogging.use_anticogging = true; // We're good to go, enable anti-cogging
|
||||
config_.anticogging.anticogging_valid = true; // We're good to go, enable anti-cogging
|
||||
config_.anticogging.calib_anticogging = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ public:
|
||||
make_protocol_property("homing_speed", &config_.homing_speed),
|
||||
make_protocol_property("inertia", &config_.inertia),
|
||||
make_protocol_property("input_filter_bandwidth", &config_.input_filter_bandwidth,
|
||||
[](void* ctx) { static_cast<Controller*>(ctx)->update_filter_gains(); }, this)
|
||||
[](void* ctx) { static_cast<Controller*>(ctx)->update_filter_gains(); }, this),
|
||||
make_protocol_object("anticogging",
|
||||
make_protocol_ro_property("index", &config_.anticogging.index),
|
||||
make_protocol_property("anticogging_valid", &config_.anticogging.anticogging_valid),
|
||||
|
||||
Reference in New Issue
Block a user