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?)
            Asked
            
        
        
            Active
            
        
            Viewed 993 times
        
    1 Answers
2
            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.
        Julian Heinovski
        
- 1,822
 - 3
 - 16
 - 27
 
        Christoph Sommer
        
- 6,893
 - 1
 - 17
 - 35