Skip to content

Commit

Permalink
fix: pid controller prev_errors vector pointer init
Browse files Browse the repository at this point in the history
  • Loading branch information
conquat committed Jun 12, 2024
1 parent 826ffe8 commit b3c93c1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pid/pid.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ void pid_init(PidController_t *pid_controller,
pid_controller->ki = ki;
pid_controller->kd = kd;
pid_controller->integrator = 0.0;
pid_controller->prev_errors = prev_errors;
pid_controller->n_prev_errors = n_prev_errors;
pid_controller->prev_error_index = pid_controller->n_prev_errors - 1;
for (int i = 0; i < pid_controller->n_prev_errors; ++i) {
Expand Down

0 comments on commit b3c93c1

Please sign in to comment.