Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
Fix error in control algorithm.
Browse files Browse the repository at this point in the history
  • Loading branch information
aentinger committed May 15, 2024
1 parent 94420b8 commit b4ee809
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,11 @@ void Node::control_yaw()
auto const motor_vel_lower_limit = _motor_base_vel - 0.2 * m/s;
auto const motor_vel_upper_limit = _motor_base_vel + 0.2 * m/s;

auto motor_left_vel = _motor_base_vel - pid_res * m/s;
auto motor_left_vel = _motor_base_vel + pid_res * m/s;
motor_left_vel = std::max(motor_left_vel, motor_vel_lower_limit);
motor_left_vel = std::min(motor_left_vel, motor_vel_upper_limit);

auto motor_right_vel = _motor_base_vel + pid_res * m/s;
auto motor_right_vel = _motor_base_vel - pid_res * m/s;
motor_right_vel = std::max(motor_right_vel, motor_vel_lower_limit);
motor_right_vel = std::min(motor_right_vel, motor_vel_upper_limit);

Expand Down

0 comments on commit b4ee809

Please sign in to comment.