Skip to content

Commit

Permalink
🐛 Right swings now work without flipping rotation axis
Browse files Browse the repository at this point in the history
Merge pull request #262 from EZ-Robotics/bug/make-right-swings-work
  • Loading branch information
ssejrog authored Jan 1, 2025
2 parents 5276abc + 5e7261a commit e185558
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 e185558

Please sign in to comment.