计算车辆的方向(Veins/Omnet ++/Sumo) [英] Calculate direction of a vehicle (Veins/Omnet++/Sumo)

查看:196
本文介绍了计算车辆的方向(Veins/Omnet ++/Sumo)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过TraCIMobility计算(获取)车辆的方向?我想知道两辆车是否正朝相反的方向行驶.我想我可以通过 getAngleRad()方法(如果它们沿相同方向移动,它们将落在同一象限中,如果它们沿相反方向移动,则它们将处于相对象限中),但是我不确定它是否正确. (子问题:而且,getAngleRad()返回的确切值是什么? 每个象限?)

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?)

推荐答案

您是正确的:getAngleRad()以弧度(从-pi到但不包括+pi)返回车辆的航向.值0表示车辆正在向东行驶;值pi/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.

这篇关于计算车辆的方向(Veins/Omnet ++/Sumo)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆