Author
Topic: to cartesian scans (Read 5353 times)

i actually have to build a matrix (cartesian coordinates)from my ranges data with anglesim havin the problem of estimation,,the error,, its just about transforming the polar data into cartesian data, but there is always that error,whats the best way to do this with minimum error?im using matlab which is goin to recieve the data as a matrix that has 2 raws (one for range and the other for angle) and 180 columns(the number of readings)i need to end up with a matrix with lets say 200 raws and 200 columns cartesian coordinates,,i need the algo for minimum errorthanks already 4 helps

i know, thats gum ,but that wasnt my question.. again..well, the cartesian matrix isnt x and y for each reading only, i mean i want to make a matrix that represents the area that has been scanned with cartesian data ,like an image.....

so the problem that arises is when you do simple math to have the x and y for the polars you somtimes get a floating point numbers (eg 5.4)assigning this to my wanted matrix would presents an error,, is 5.4 5 or 6 ?)

This is all assuming that a decimal coordinate occupies 2 cells. If not, the code could be easily changed and applied to other situations. The key thing is the checking for a decimal and round-down function (floor).

well maybe that lets say x with its floating point will settle inside a specific square(element) in the matrixmaybe its better to assign all the elements surrounding it by 1 also,, i think i should go with the error

hey guys, as im generating my grif from the polar data im facing another problem, its about that there would be squares unmapped because of obstacles ,the problem is that during a scan,how do i identify mapped squares from unmapped ones?

yea i know that but how would you be able to identify each square based on one scan?, obstacles are easy to identify (transforming plar to cartesian)but when an obstacle is identified the squares just behinde it would not be mapped,im talking about those,how would you identify em,,?

the first row contains distance values(nearest obstacle, 255 = no obstacle) the second contains the coresponding angles

now in pc i will convert these polar data into cartesian (easy) BUT this way iwill be able to identify squares that are obstacles,, what about whats behind the obstacle?? sure unmapped(unknown) but how do i know which ones would be unknown??

considering the data with angle 45 is 127 so this way i know that the obstacle is in a specific square AND the other squares wich lies behind it with angle 45 are unknown, this is easy because at angle 45 its easy to know which squares would be unmappedbut at angles like 78 you can plot the obstacle but how would you know what squares behinde the obstacle to mark as unknown?

i did plot the green ones by hand(guess) but assume that its the same pic without green squares,can you fing the algorithm to mark them as green?

i forgot to tell you about someway to do it but i would want to mention it cuz its long n looks dumb

its for example you have a 200 at angle 60you mark this one as obstacle then you incremet it(the distance,200 here) by 3(or any small number) n you mark the coresponding squareas unknown and you still do this until you reach 255

its for example you have a 200 at angle 60you mark this one as obstacle then you incremet it(the distance,200 here) by 3(or any small number) n you mark the coresponding squareas unknown and you still do this until you reach 255

so its like this but instead of marking unknown ones i mark known ones