nobleo / path_tracking_pid

Path Tracking PID offers a tuneable PID control loop, decouling steering and forward velocity
Apache License 2.0
129 stars 38 forks source link

Simplify the math being done to calculate direction to goal #82

Closed rokusottervanger closed 2 years ago

rokusottervanger commented 2 years ago

A simple dot product would give the desired outcome: the length of the projection of one vector onto the other, with the sign of the cosine of the angle between the two vectors (which is what we're looking for).

https://github.com/nobleo/path_tracking_pid/blob/61c6cc828bd98dddd8cc14cbabdd62353a89ad3c/src/controller.cpp#L581-L593