How to define XY coordinates are on left and right side

6 次查看(过去 30 天)
Hi,
I am working for the radar locations , where i have azimuth angles for each objects, with the help of this i am able to partially define the locations are on left/right side during straight road but unable to define it when there are sharp curve roads.
could you please do help me out to separate the above attached .mat file with XY coordinates belogn on Left/Right side ?
  3 个评论
SatyaPrakash Gupta
SatyaPrakash Gupta 2020-4-14
sorry missed to attached the vehicle trajectory , earlier attached are locations and now i have attached Vehicle trajectory . therefore it would be greateful , if you could help me with the code which tells the locations are on Left/Right with respect to the Vehicle Trajectory coordinates
Rik
Rik 2020-4-15
Comment posted as flag by SatyaPrakash Gupta:
Can anyone from Mathwork will help me to resolve this issue , thank you

请先登录,再进行评论。

回答(1 个)

KSSV
KSSV 2020-4-14
Follow the below steps.
  1. Pick a point (x,y) from the set of points.
  2. Using knnsearch get N number of points close to the (x,y) in trajectory points.
  3. Using polyfit, fit a striaght line with the N points.
  4. Use this: https://math.stackexchange.com/questions/324589/detecting-whether-a-point-is-above-or-below-a-slope. To know whether point is abive or below the given line.
This is the mehtod which I think shall work. There might be more elegant methods.
  1 个评论
SatyaPrakash Gupta
SatyaPrakash Gupta 2020-4-14
编辑:SatyaPrakash Gupta 2020-4-14
I believe that it will not work as well because when the vehicle is on the right side, then the closest locations will only visible on the right (using knnsearch), i just tried but not sucess.
could you help me with the code , I have been trying since 1-2 weeks, using cross product , azuimuth angle, yaw angle but did not successed and therefore i have raised this question.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Vehicle Scenarios 的更多信息

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by