Offsetting race track centre line data

20 vues (au cours des 30 derniers jours)
Kieran Reeves
Kieran Reeves le 20 Mai 2020
Commenté : Furkan Bek le 26 Nov 2021
Hi
I have read through many of the posts on here but I am struggling to find a solution wherby I need to offset the centre line coordinates of a track. As the race circuit is a closed system, typical ways of offsetting a curve seems to create cross over of the inner and outer circuit parameters.
I have the centre line of the race track (attached file) that has been extracted from the race vehicle at 20Hz, so quite a large data set. I do have 5 and 2 Hz if it is easier. I need to create an inner and outer circuit limit that contains the same amount of points but with an offset of 7.5m either side of the centre line, to make the overall track width 15m from inner to outer. This data is set with global coordinates so the 0,0 is based at the centre of the overall track architeture. The first x,y coordinates can be set to 0,0 (centre of start/finish line) if that also helps with the solution.
I have tried this code but potentially messed it up so it so did not work for my coordinates: https://uk.mathworks.com/matlabcentral/answers/427870-i-have-one-curve-i-want-to-create-another-curve-offset-to-that-one-at-right-angle
Can anybody help in creating the 2 additional (inner and outer) plots that have the 7.5m offset from the centre line?
Regards
Kieran

Réponse acceptée

darova
darova le 20 Mai 2020
Try the attached script. It's pretty simple. I leaved some comments so all should be clear
There is a function self_inter inside the script. It calculates points where a curve is intersecting itself. You can cancel/remove it if you don't need it
Result
  3 commentaires
darova
darova le 20 Mai 2020
My pleasure
Furkan Bek
Furkan Bek le 26 Nov 2021
This was very helpful, thank you for sharing this.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by