Collide avoidance using Goldenstein's Attract/Repel formula
Posted: 09 Jan 2011, 13:07
I found a research paper that describe a formula for collision avoidance algorithm!! I believe the (usage of this) formula is quite straightforward and we can build it now using Spring's current available function (I imagine in LUA). The challenge is just to put the correct input into this formula and use the result for unit steering.
In other word:
This collision avoidance strategy is feasible. The objective is to "port" this formula into Spring sourceCode (or Spring's LUA). Thus the result is a state of the art collision avoidance strategy.
___
First, for details I refer to 2 paper:
http://scholar.google.com/scholar?hl=en ... a=N&tab=ws
http://www.google.com/search?hl=en&q=Sc ... 14bc218727
(both is free for download)
The first paper contain the collision avoidance formulas that uses input in form of "angle toward an obstacle" or "angle toward a target". HERE's MORE ABOUT THE FORMULA:{
First we find the angle of the target and then use:
"F.target=constant*math.sin(agentHeadingAngle - obstacleAngle.with.respec.to.Agent)"
to get a graph shape that describe the max value when agent is heading the right way, and then
"F.obstacle= R*W*D"
to get the heading where it has max value when an agent heading the wrong way.
,
and the value of W and R and D is:
R= ((agentAngle - obstacleAngle.w.r.t.Agent) / subtendedAngleOfObstacle.as.seen.by.agent ) * exponen.to.the.power.of(1- abs(
((agentAngle - obstacleAngle.w.r.t.Agent) / subtendedAngleOfObstacle.as.seen.by.agent )))
W= 1/2(math.tanh('h' (math.cos(agentAngle - obstacleAngle.w.r.t.Agent) - math.cos(2* subtendedAngleOfObstacle.as.seen.by.agent +constant2)))+1)
--- 'h' = 4/(math.cos(2*subtendedAngleOfObstacle.as.seen.by.agent) -math.cos(2*subtendedAngleOfObstacle.as.seen.by.agent +constant3))
D= exponen.to.the.power.of(-distance/constant4).
,
lastly is the velocity:
velocity= (closestObstacleDistance- safetyDistance)/time.to.contact
*next is an algoritmic way to sum both "F.target" and "F.obstacle" in way which yeild correct result* }
The aim is to sum all "F.obstacle" to get the whole graph (perceived by that unit) that'll describe where the unit shouldn't go.
You can sum directly but the author says that it may cause unit to bump into obstacle. The author use some matrix summation to sum all the F.obstacle and use some condition (if else) to set constant (in above equation) to make unit behave appropriately. The first paper tells you everything about collision avoidance.
__
THe second paper tells you about the above IDEAS plus ideas to improve the LOS system; by using somesort of "Delaunay triangulation" to reduce the need to update the unit's environment, and fluid equation to make units flow like water. I'm sure the collision avoidance part is feasible, while the other 2 equations were not quite accessible yet.
The Pseudocode was:
1: for each instant t do
2: for each agent do
3: Calculate ¤êtar and╬ö¤êtar (see Fig. 2);
4: Use (2) to calculate ftar and also Ôêé ftar/Ôêé¤å;
5: Wt = 0, fobs = 0, D fobs = 0;
6: for each Obstacle i do
7: Calculate ¤êobsi and╬ö¤êobsi ;
8: Using (5), (6), (8) and (4) calculate Ri ,
Di , Wi , fobsi and Ôêé fobsi/Ôêé¤å;
9: Wt = Wt +Wi , fobs = fobs+ fobsi and
D fobs = D fobs+Ôêé fobsi/Ôêé¤å;
10: end for
11: Calculate ╬│12 (32), ╬▒2 (33) and ╬▒1 (34) (╬│21
is a constant, here set to 0.05);
12: Using initial value as w = [0, 0], simulate
(21) until it stops at a fixed point;
13: Use (10) to calculate ╦Ö¤å;
14: Use one of the velocity methods to calculate
the forward velocity;
15: Find next position and orientation (¤å) of the
agent through forward integration.
16: end for
In other word:
This collision avoidance strategy is feasible. The objective is to "port" this formula into Spring sourceCode (or Spring's LUA). Thus the result is a state of the art collision avoidance strategy.
___
First, for details I refer to 2 paper:
http://scholar.google.com/scholar?hl=en ... a=N&tab=ws
http://www.google.com/search?hl=en&q=Sc ... 14bc218727
(both is free for download)
The first paper contain the collision avoidance formulas that uses input in form of "angle toward an obstacle" or "angle toward a target". HERE's MORE ABOUT THE FORMULA:{
First we find the angle of the target and then use:
"F.target=constant*math.sin(agentHeadingAngle - obstacleAngle.with.respec.to.Agent)"
to get a graph shape that describe the max value when agent is heading the right way, and then
"F.obstacle= R*W*D"
to get the heading where it has max value when an agent heading the wrong way.
,
and the value of W and R and D is:
R= ((agentAngle - obstacleAngle.w.r.t.Agent) / subtendedAngleOfObstacle.as.seen.by.agent ) * exponen.to.the.power.of(1- abs(
((agentAngle - obstacleAngle.w.r.t.Agent) / subtendedAngleOfObstacle.as.seen.by.agent )))
W= 1/2(math.tanh('h' (math.cos(agentAngle - obstacleAngle.w.r.t.Agent) - math.cos(2* subtendedAngleOfObstacle.as.seen.by.agent +constant2)))+1)
--- 'h' = 4/(math.cos(2*subtendedAngleOfObstacle.as.seen.by.agent) -math.cos(2*subtendedAngleOfObstacle.as.seen.by.agent +constant3))
D= exponen.to.the.power.of(-distance/constant4).
,
lastly is the velocity:
velocity= (closestObstacleDistance- safetyDistance)/time.to.contact
*next is an algoritmic way to sum both "F.target" and "F.obstacle" in way which yeild correct result* }
The aim is to sum all "F.obstacle" to get the whole graph (perceived by that unit) that'll describe where the unit shouldn't go.
You can sum directly but the author says that it may cause unit to bump into obstacle. The author use some matrix summation to sum all the F.obstacle and use some condition (if else) to set constant (in above equation) to make unit behave appropriately. The first paper tells you everything about collision avoidance.
__
THe second paper tells you about the above IDEAS plus ideas to improve the LOS system; by using somesort of "Delaunay triangulation" to reduce the need to update the unit's environment, and fluid equation to make units flow like water. I'm sure the collision avoidance part is feasible, while the other 2 equations were not quite accessible yet.
The Pseudocode was:
1: for each instant t do
2: for each agent do
3: Calculate ¤êtar and╬ö¤êtar (see Fig. 2);
4: Use (2) to calculate ftar and also Ôêé ftar/Ôêé¤å;
5: Wt = 0, fobs = 0, D fobs = 0;
6: for each Obstacle i do
7: Calculate ¤êobsi and╬ö¤êobsi ;
8: Using (5), (6), (8) and (4) calculate Ri ,
Di , Wi , fobsi and Ôêé fobsi/Ôêé¤å;
9: Wt = Wt +Wi , fobs = fobs+ fobsi and
D fobs = D fobs+Ôêé fobsi/Ôêé¤å;
10: end for
11: Calculate ╬│12 (32), ╬▒2 (33) and ╬▒1 (34) (╬│21
is a constant, here set to 0.05);
12: Using initial value as w = [0, 0], simulate
(21) until it stops at a fixed point;
13: Use (10) to calculate ╦Ö¤å;
14: Use one of the velocity methods to calculate
the forward velocity;
15: Find next position and orientation (¤å) of the
agent through forward integration.
16: end for