Skip to content

Commit 1ebd776

Browse files
committed
Use length instead of lengthSquared checking for pure pid
1 parent 9fb6c0b commit 1ebd776

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/software/embedded/motion_control/position_controller.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Vector PositionController::step(const Point& position,
77
const Vector distance_from_destination =
88
target_trajectory.getDestination() - position;
99

10-
if (distance_from_destination.lengthSquared() < LINEAR_PURE_PID_THRESHOLD_METERS)
10+
if (distance_from_destination.length() < LINEAR_PURE_PID_THRESHOLD_METERS)
1111
{
1212
// if target destination is close enough, use pure PID for velocity
1313
return Vector{x_pid_close_.step(distance_from_destination.x(), delta_time),

0 commit comments

Comments
 (0)