Skip to content

Commit

Permalink
Right swings should now work
Browse files Browse the repository at this point in the history
  • Loading branch information
ssejrog committed Jan 1, 2025
1 parent 32d4e0d commit 5e7261a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/EZ-Template/drive/set_pid/set_swing_pid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,9 @@ void Drive::pid_swing_set(e_swing type, double target, int speed, int opposite_s
used_motion_chain_scale = 0.0;

// Flip the swing from left-right if rotation axis is flipped
if (odom_theta_direction_get())
current_swing = type == ez::LEFT_SWING ? ez::RIGHT_SWING : ez::LEFT_SWING;

current_swing = type;
if (odom_theta_direction_get())
current_swing = current_swing == ez::LEFT_SWING ? ez::RIGHT_SWING : ez::LEFT_SWING;

// Figure out if going forward or backward
int side = type == ez::LEFT_SWING ? 1 : -1;
Expand Down

0 comments on commit 5e7261a

Please sign in to comment.