Skip to content

Commit

Permalink
issue EZ-Robotics#59 - set_relative_turn_pid changed casing of variab…
Browse files Browse the repository at this point in the history
…les to snake_case and made it relative to current target, not current heading
  • Loading branch information
mkhlb committed Sep 1, 2022
1 parent 1599e17 commit c80ce74
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/EZ-Template/drive/set_pid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,14 @@ void Drive::set_turn_pid(double target, int speed) {

void Drive::set_relative_turn_pid(double target, int speed) {
// Compute absolute target by adding to current heading
double absoluteTarget = get_gyro() + target;
double absolute_target = turnPID.get_target() + target;

// Print targets
if (print_toggle) printf("Turn Started... Target Value: %f\n", absoluteTarget);
if (print_toggle) printf("Turn Started... Target Value: %f\n", absolute_target);

// Set PID targets
turnPID.set_target(absoluteTarget);
headingPID.set_target(absoluteTarget);
turnPID.set_target(absolute_target);
headingPID.set_target(absolute_target);
set_max_speed(speed);

// Run task
Expand Down

0 comments on commit c80ce74

Please sign in to comment.