mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-09-20 22:55:00 +08:00
Fix bugs in homing by actually testing and using the debugger...
This commit is contained in:
@@ -56,17 +56,10 @@ void Controller::start_anticogging_calibration() {
|
||||
bool Controller::home_axis() {
|
||||
if (axis_->config_.min_endstop.enabled) {
|
||||
set_vel_setpoint(-config_.homing_speed, 0.0f);
|
||||
axis_->homing_state_ = HOMING_STATE_HOMING;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
axis_->run_control_loop([&](){
|
||||
if(axis_->min_endstop_state_){
|
||||
axis_->encoder_.set_linear_count(axis_->config_.min_endstop.offset);
|
||||
set_pos_setpoint(0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
return !axis_->min_endstop_state_;
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user