问题
Is it possible to calculate(get) direction of vehicle in Veins(via TraCIMobility)? I want to know if two vehicles are traveling in opposing directions or not. I think I can do that via getAngleRad() method (if they are moving in the same direction they fall in the same quadrant and if moving opposite they are in opposite quadrants), but I am not sure if its correct. (Sub-Question: Also, what are the exact values that getAngleRad() would return for each quadrant?)
回答1:
You are correct: getAngleRad()
returns the vehicle's heading in radians (from -pi
up to, but excluding, +pi
). A value of 0
means the vehicle is heading east; a value of pi/2
means it is heading north; etc.
来源:https://stackoverflow.com/questions/37975250/calculate-direction-of-a-vehicle-veins-omnet-sumo