EZ-Robotics / EZ-Template

Simple plug-and-play PROS template that handles drive base functions for VEX robots.
https://ez-robotics.github.io/EZ-Template/
Mozilla Public License 2.0
70 stars 27 forks source link

🐛[BUG] - Remove excess injected points at the start of a path #152

Open ssejrog opened 1 month ago

ssejrog commented 1 month ago

Point injecting should ignore the first few points.

From (0, 0) to (0, 24) in an injected pure pursuit, this would currently happen.

starting at (0, 0)
(0, 0.5)
(0, 1)
(0, 1.5)
(0, 2)
(0, 2.5)
...
(0, 23.5)
(0, 24)

It should instead do this, where 7 is LOOK_AHEAD.

starting at (0, 0) 
(0, 7)
(0, 7.5)
(0, 8)
(0, 8.5)
...
(0, 23.5
(0, 24)

I think this new behavior is better because it avoids excess iterations.

With spacing of 0.5 in the current system, an extra 140ms would pass before 0,7 becomes the target. This is 140ms of "slew" that's introduced. Exit conditions also rely on what the current target is, creating edge cases where additional time is added before the robot will exit.