steviet91 / furmulaone_source

Source repo for the car and track models
MIT License
0 stars 0 forks source link

More robust start/finish of laps #21

Closed Thonners closed 4 years ago

Thonners commented 4 years ago

Resetting the vehicle's position results in a new lap being triggered (and a lap being 'completed'

Lap checking could potentially be improved with a few vector based checks of the starting line coords (fail fast to keep runtime down):

Thonners commented 4 years ago

On second thoughts, much simpler to check for intersection between the start line and the line between p(t-1), p(t), where p(t) is the position of the vehicle at time t.

Still need some logic to deal with vehicle resets (perhaps just setting lapcount to 0 on reset)

steviet91 commented 4 years ago

Method two sounds simpler to implement and should exit quickly thanks to the improvements you made for the lidar intersections. Resetting the lapcounter sound reasonable, if someone has needed to reset then their data should be voided