mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-09-26 03:23:39 +08:00
Update endstops before checking for errors
This commit is contained in:
@@ -400,6 +400,13 @@ void ODrive::control_loop_cb(uint32_t timestamp) {
|
||||
odrv.oscilloscope_.update();
|
||||
}
|
||||
|
||||
for (auto& axis : axes) {
|
||||
MEASURE_TIME(axis.task_times_.endstop_update) {
|
||||
axis.min_endstop_.update();
|
||||
axis.max_endstop_.update();
|
||||
}
|
||||
}
|
||||
|
||||
MEASURE_TIME(task_times_.control_loop_checks) {
|
||||
for (auto& axis: axes) {
|
||||
// look for errors at axis level and also all subcomponents
|
||||
@@ -432,11 +439,6 @@ void ODrive::control_loop_cb(uint32_t timestamp) {
|
||||
MEASURE_TIME(axis.task_times_.sensorless_estimator_update)
|
||||
axis.sensorless_estimator_.update();
|
||||
|
||||
MEASURE_TIME(axis.task_times_.endstop_update) {
|
||||
axis.min_endstop_.update();
|
||||
axis.max_endstop_.update();
|
||||
}
|
||||
|
||||
MEASURE_TIME(axis.task_times_.controller_update)
|
||||
axis.controller_.update(); // uses position and velocity from encoder
|
||||
|
||||
|
||||
Reference in New Issue
Block a user