Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Robotics Algorithm Anyone?
Message
From
08/01/2006 20:54:37
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
To
08/01/2006 18:05:22
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01082862
Message ID:
01084580
Views:
37
>Hi Dragan,
>
>My name is Simon. I am actually the real guy behind this thread. You see, my friend Gary Wynne kindly posted my original question. However I believed it was time to sign-up for my own account and give Gary a break :)
>
>Thank you for all your thoughts to-date. You input is greatly appreciated!
>
>In your last post you discussed the use of R-Theta or polar coordinates. Would you be able to provide some example pseduo-code for calculating the R-Theta values, so I can better understand your last post?
>
>Here is my shot at it. It is invariably wrong:-
>
>nOffset = 120 -- number pixels from center of obstacle to center of image
>nDegreesPerPixel = pi() / 180 * (nMaxAngle / nMaxPixels)
>nTheta = nOffset * nDegreePerPixel
>r = pi()/180 && < -- here
>x=r*cos(ntheta)
>y=r*sin(ntheta)


I've used 'r' to denote the radius, which is the R in the "R-theta". In polar coordinates you have one point (the pole) and the direction of your initial angle (on Earth, that'd be the prime meridian). Then the positio of any point can be defined by its distance from the pole, and the angle between it and the initial line (on Earth, the PM). Just Google "polar coordinates" - http://en.wikipedia.org/wiki/Coordinates_(elementary_mathematics) is a good place where most of it is explained.

Now in your code there's only one thing wrong, the way you calculated r. The r should be the distance between the camera and the object. And you're calculating the nTheta for the angle, and then using theta instead - I've fixed that in your code.

Now how would you calculate the distance, that's several messages upstream from this - and I figure Garry can show you how the UT interface (very unorthodox, but we're used to it and it works excellent once you break it in) can be made to show you a lot of things. For one, click the icon below the message which looks like a stack of white sheets, and you should get the whole thread. (IOW, welcome to UT :)

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform