Skip to content

Commit

Permalink
[STEERING] Add missing tan call for ackermann (#1117)
Browse files Browse the repository at this point in the history
(cherry picked from commit b81be48)
  • Loading branch information
qinqon authored and mergify[bot] committed Jun 19, 2024
1 parent b9cc260 commit e3dc53e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions steering_controllers_library/src/steering_odometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ bool SteeringOdometry::update_from_velocity(
{
steer_pos_ = steer_pos;
double linear_velocity = traction_wheel_vel * wheel_radius_;
const double angular_velocity = tan(steer_pos) * linear_velocity / wheelbase_;
const double angular_velocity = std::tan(steer_pos) * linear_velocity / wheelbase_;

return update_odometry(linear_velocity, angular_velocity, dt);
}
Expand All @@ -136,7 +136,7 @@ bool SteeringOdometry::update_from_velocity(
(right_traction_wheel_vel + left_traction_wheel_vel) * wheel_radius_ * 0.5;
steer_pos_ = steer_pos;

const double angular_velocity = tan(steer_pos_) * linear_velocity / wheelbase_;
const double angular_velocity = std::tan(steer_pos_) * linear_velocity / wheelbase_;

return update_odometry(linear_velocity, angular_velocity, dt);
}
Expand All @@ -148,7 +148,7 @@ bool SteeringOdometry::update_from_velocity(
steer_pos_ = (right_steer_pos + left_steer_pos) * 0.5;
double linear_velocity =
(right_traction_wheel_vel + left_traction_wheel_vel) * wheel_radius_ * 0.5;
const double angular_velocity = steer_pos_ * linear_velocity / wheelbase_;
const double angular_velocity = std::tan(steer_pos_) * linear_velocity / wheelbase_;

return update_odometry(linear_velocity, angular_velocity, dt);
}
Expand Down

0 comments on commit e3dc53e

Please sign in to comment.