nobleo / path_tracking_pid

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

Preliminary custom units implementation. #70

Closed lewie-donckers closed 2 years ago

lewie-donckers commented 2 years ago

Not a proper PR so no thorough review required (for now).

I just wanted to show you what the code would look like when using a custom units library. It currently supports Speed, Acceleration, Duration, Distance and Area.

Not all members/parameters/calculations have been changed yet. Please focus on Controller as most changes have been made there.

The calculation of d_end_phase on line 591 is particularly interesting. There a distance is calculated based on the current speed, target acceleration and target speed.

Also nice work on the original implementation because all units I have seen so far were correctly used.

I'll work on an example using the Boost units library next week. So you can compare the two.