Discussion:
Calculating the turning radius of a robot
Mike Oliver
2015-06-26 06:51:53 UTC
Permalink
Hi Everyone,
I have been working on a new wall smoothing algorithm and I've run into a
bit of an issue I cant seem to figure out. I'm trying to calculate the
turning radius of a robot given its velocity. I can get its change in
degrees per tick based on its velocity *10 - 0.75 * Math.abs(getVelocity())*,
but that doesn't really help me find the radius of its arc.

By plotting the points of my bot along its arc I was able to estimate its
radius. These values are close, but not 100% accurate. Does anyone know of
a proper formula for calculating the radius without requiring 3 sample
points along the arc?

Here are my findings: Velocity : Arc Radius

8 : 114.627
7 : 84.464
6 : 62:159
5: 45.862
4: 32.764
3: 22.186
2: 13.492
1: 6.205
0 : 0

Thanks for your time!
--
You received this message because you are subscribed to the Google Groups "robocode" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robocode+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Johannes Slotta
2015-06-26 09:34:58 UTC
Permalink
Hi,

In theory of a continuous movement, these values should be
velocity/turning rate in radians, your values are close, the one for 6
is a bit off. Formula:
velocity / ((10-0.75*velocity)/(180/Math.PI))

In Reality, with discrete time steps, it is a bit more complicated (but
not much): velocity/2/sin(turning rate/2), or
velocity/2 / Math.sin((10-0.75*velocity)/(180*Math.PI)/2)

Values are (I used your values for first column):

measured continuous discrete
8 114.627 114.5915590262 114.6148333914
7 84.464 84.4358855982 84.4600705286
6 62.159 62.5044867415 62.5284914701
5 45.862 45.8366236105 45.8593571413
4 32.764 32.740445436 32.7608164788
3 22.186 22.1790114244 22.1959283285
2 13.492 13.4813598854 13.4937305748
1 6.205 6.1941383257 6.2008702328
0 0 0 0

HTH,
Johannes
Post by Mike Oliver
Hi Everyone,
I have been working on a new wall smoothing algorithm and I've run into a
bit of an issue I cant seem to figure out. I'm trying to calculate the
turning radius of a robot given its velocity. I can get its change in
degrees per tick based on its velocity 10 - 0.75 * Math.abs(getVelocity()),
but that doesn't really help me find the radius of its arc.
By plotting the points of my bot along its arc I was able to estimate its
radius. These values are close, but not 100% accurate. Does anyone know of
a proper formula for calculating the radius without requiring 3 sample
points along the arc?
Here are my findings: Velocity : Arc Radius
8 : 114.627
7 : 84.464
6 : 62:159
5: 45.862
4: 32.764
3: 22.186
2: 13.492
1: 6.205
0 : 0
Thanks for your time!
--
You received this message because you are subscribed to the Google Groups "robocode" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "robocode" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robocode+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Johannes Slotta
2015-06-26 09:37:40 UTC
Permalink
Should be 180/Math.PI instead of 180*Math.PI of course ;-)
Hi,
In theory of a continuous movement, these values should be velocity/turning
velocity / ((10-0.75*velocity)/(180/Math.PI))
In Reality, with discrete time steps, it is a bit more complicated (but not
much): velocity/2/sin(turning rate/2), or
velocity/2 / Math.sin((10-0.75*velocity)/(180*Math.PI)/2)
measured continuous discrete
8 114.627 114.5915590262 114.6148333914
7 84.464 84.4358855982 84.4600705286
6 62.159 62.5044867415 62.5284914701
5 45.862 45.8366236105 45.8593571413
4 32.764 32.740445436 32.7608164788
3 22.186 22.1790114244 22.1959283285
2 13.492 13.4813598854 13.4937305748
1 6.205 6.1941383257 6.2008702328
0 0 0 0
HTH,
Johannes
Post by Mike Oliver
Hi Everyone,
I have been working on a new wall smoothing algorithm and I've run into a
bit of an issue I cant seem to figure out. I'm trying to calculate the
turning radius of a robot given its velocity. I can get its change in
degrees per tick based on its velocity 10 - 0.75 *
Math.abs(getVelocity()),
but that doesn't really help me find the radius of its arc.
By plotting the points of my bot along its arc I was able to estimate its
radius. These values are close, but not 100% accurate. Does anyone know of
a proper formula for calculating the radius without requiring 3 sample
points along the arc?
Here are my findings: Velocity : Arc Radius
8 : 114.627
7 : 84.464
6 : 62:159
5: 45.862
4: 32.764
3: 22.186
2: 13.492
1: 6.205
0 : 0
Thanks for your time!
--
You received this message because you are subscribed to the Google Groups
"robocode" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "robocode" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "robocode" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robocode+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Mike Oliver
2015-06-26 14:42:12 UTC
Permalink
Ah! Thats exactly what I was looking for, I figured there was an easier
solution to my approach. Thanks Johannes!
Post by Johannes Slotta
Should be 180/Math.PI instead of 180*Math.PI of course ;-)
Post by Johannes Slotta
Hi,
In theory of a continuous movement, these values should be
velocity/turning
Post by Johannes Slotta
rate in radians, your values are close, the one for 6 is a bit off.
velocity / ((10-0.75*velocity)/(180/Math.PI))
In Reality, with discrete time steps, it is a bit more complicated (but
not
Post by Johannes Slotta
much): velocity/2/sin(turning rate/2), or
velocity/2 / Math.sin((10-0.75*velocity)/(180*Math.PI)/2)
measured continuous discrete
8 114.627 114.5915590262 114.6148333914
7 84.464 84.4358855982 84.4600705286
6 62.159 62.5044867415 62.5284914701
5 45.862 45.8366236105 45.8593571413
4 32.764 32.740445436 32.7608164788
3 22.186 22.1790114244 22.1959283285
2 13.492 13.4813598854 13.4937305748
1 6.205 6.1941383257 6.2008702328
0 0 0 0
HTH,
Johannes
Post by Mike Oliver
Hi Everyone,
I have been working on a new wall smoothing algorithm and I've run into
a
Post by Johannes Slotta
Post by Mike Oliver
bit of an issue I cant seem to figure out. I'm trying to calculate the
turning radius of a robot given its velocity. I can get its change in
degrees per tick based on its velocity 10 - 0.75 *
Math.abs(getVelocity()),
but that doesn't really help me find the radius of its arc.
By plotting the points of my bot along its arc I was able to estimate
its
Post by Johannes Slotta
Post by Mike Oliver
radius. These values are close, but not 100% accurate. Does anyone
know
Post by Johannes Slotta
Post by Mike Oliver
of
a proper formula for calculating the radius without requiring 3 sample
points along the arc?
Here are my findings: Velocity : Arc Radius
8 : 114.627
7 : 84.464
6 : 62:159
5: 45.862
4: 32.764
3: 22.186
2: 13.492
1: 6.205
0 : 0
Thanks for your time!
--
You received this message because you are subscribed to the Google
Groups
Post by Johannes Slotta
Post by Mike Oliver
"robocode" group.
To unsubscribe from this group and stop receiving emails from it, send
an
Post by Johannes Slotta
Post by Mike Oliver
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google
Groups
Post by Johannes Slotta
"robocode" group.
To unsubscribe from this group and stop receiving emails from it, send
an
Post by Johannes Slotta
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "robocode" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robocode+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...