05-07-2017 01:41 PM
Good Afternoon,
I am using myRIO and URG-04LX-UG01 together and trying to get the distance of the obstacle, but the URG-04LX-UG01 is only giving me magnitudes and directions with a very huge size of array.
I tried to get the distance with practical way to get an equation that represent a relation between the magnitude and distance. but that did not work since the magnitudes were almost the same in all cases.
Any idea how to get the distance ?
Thanks
05-08-2017 01:53 PM
Hello AishaRadwan
Have you tried to implement an average with all the data?
Regards
05-08-2017 02:23 PM
Hello Mr. David22JRA,
You mean to take the average of the magnitudes and the directions?
how that will help to find the distance?
Appreciate your response
05-09-2017 02:53 PM
Hello AishaRadwan
Could you upload a graphical example?
Feel free to use any graph or any diagram
Regards
06-29-2017 08:36 PM
Hi the equation is very easy , if you want the magnitude and angle of an obstacle :
The angle of the obstacle:
we had:A (D, Theta) list of vector with distance and angles
Ax=D*cos(Thetha)
Ay=D*sin(Thetha)
AXtotal=Sum(Ax)
AYtotal=Sum(Ay)
angle=atan2(Ay,Ax)
for the distance to the object:
d=sum(D)/(number of distances)
I hope this help