Skip to content

Commit 8c99191

Browse files
mergify[bot]qinqon
andauthored
[STEERING] Add missing tan call for ackermann (#1117) (#1176)
(cherry picked from commit b81be48) Co-authored-by: Enrique Llorente Pastora <[email protected]>
1 parent b9cc260 commit 8c99191

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

steering_controllers_library/src/steering_odometry.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ bool SteeringOdometry::update_from_velocity(
123123
{
124124
steer_pos_ = steer_pos;
125125
double linear_velocity = traction_wheel_vel * wheel_radius_;
126-
const double angular_velocity = tan(steer_pos) * linear_velocity / wheelbase_;
126+
const double angular_velocity = std::tan(steer_pos) * linear_velocity / wheelbase_;
127127

128128
return update_odometry(linear_velocity, angular_velocity, dt);
129129
}
@@ -136,7 +136,7 @@ bool SteeringOdometry::update_from_velocity(
136136
(right_traction_wheel_vel + left_traction_wheel_vel) * wheel_radius_ * 0.5;
137137
steer_pos_ = steer_pos;
138138

139-
const double angular_velocity = tan(steer_pos_) * linear_velocity / wheelbase_;
139+
const double angular_velocity = std::tan(steer_pos_) * linear_velocity / wheelbase_;
140140

141141
return update_odometry(linear_velocity, angular_velocity, dt);
142142
}
@@ -148,7 +148,7 @@ bool SteeringOdometry::update_from_velocity(
148148
steer_pos_ = (right_steer_pos + left_steer_pos) * 0.5;
149149
double linear_velocity =
150150
(right_traction_wheel_vel + left_traction_wheel_vel) * wheel_radius_ * 0.5;
151-
const double angular_velocity = steer_pos_ * linear_velocity / wheelbase_;
151+
const double angular_velocity = std::tan(steer_pos_) * linear_velocity / wheelbase_;
152152

153153
return update_odometry(linear_velocity, angular_velocity, dt);
154154
}

0 commit comments

Comments
 (0)