Wednesday, October 30, 2019

physics - How do I make a vehicle move to a point and stop without overshooting or oscillating?


Ok so consider we have a vehicle like the one I described in my answer to this question, with a 2D position, velocity, angular velocity, and drag/friction. It can accelerate and break by a variable amount, but not stop dead instantly or reach top speed instantly. How can I make it move to a particular point and stop - in the fastest time possible - without overshooting or oscillating?


I was thinking something like:



  • turn towards target position.

  • accelerate

  • look 1 tick ahead, asking "If I applied the breaks next tick, would I overshoot the target?"

  • If it would overshoot, apply the breaks now by some amount.



I'm sure this is a solved problem and there is a probably a better method than the one I described.




No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...