Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sumo-user] Relative distance in ring road

Hi,

I have drawn a ring road following this tutorial, where gives me a circle that is not perfect (not smooth and the radius at different position may vary a bit). I also had re-routers so that vehicles drive for multiple rounds.

I need to compute the relative distance between vehicles. I tried the function vehice.getdistance(). However, this will give me some errors in calculation. For example, if vehicle A in its second round is close to vehicle B in its third round, then the relative distance is a large value that contains a perimeter of the ring road. 

I also thought about using x,y coordinates and the angle, and convert it to distance. However, this seems not accurate, given that my ring road is not a perfect circle.

I am wondering if there are any good ways to compute relative distance correctly in this case. Thanks!

Best,
Cindy

Back to the top