Difference between revisions of "Wall Smoothing"

From Robowiki
Jump to navigation Jump to search
m (fix typo)
m
 
(2 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
| page1        = Implementations
 
| page1        = Implementations
 
}}
 
}}
----
+
{{Youtube|SrbNxXiNp3k}}
A method for avoiding collisions with walls without needing to reverse direction. In other words, instead of reversing direction every time your bot would hit the wall (which can be very predictable), your bot will instead turn as it approaches the wall, then move right along the wall.
+
 
 +
A method for [[Wall Avoidance|avoiding collisions with walls]] without needing to reverse direction. In other words, instead of reversing direction every time your bot would hit the wall (which can be very predictable), your bot will instead turn as it approaches the wall, then move right along the wall.
 +
 
 +
Wall smoothing is not only suitable for [[Movement|movements]] that orbit an enemy, but also in [[Melee]] situations, which require moving relative to multiple enemies. It is also suitable for [[GoTo]]-based movements, such as [[Minimum Risk Movement]]. However, in non-orbital situations, wall smoothing is different, and is difficult. Some simply selects some point far from walls, but it still can’t prevent you from hitting the wall (ocationaly), as your path can still intersect with the wall, even if destination is not. Anyway, correct melee wall smothing borrows several ideas from orbital wall smothing. For details, see [[/Melee Wall Smoothing]]
  
 
== How it works ==
 
== How it works ==
{{Youtube|SrbNxXiNp3k}}
+
 
 
Generally, Wall Smoothing is accomplished by extending an imaginary stick (sometimes called a "blind man's stick") from the front and back of the bot and testing if that stick would touch the wall. If it would, then you adjust the bot's new heading until the stick would not touch the wall. A stick length of about 120 to 150 works well for most bots.
 
Generally, Wall Smoothing is accomplished by extending an imaginary stick (sometimes called a "blind man's stick") from the front and back of the bot and testing if that stick would touch the wall. If it would, then you adjust the bot's new heading until the stick would not touch the wall. A stick length of about 120 to 150 works well for most bots.
  
=== Graphical demonstration ===
+
== Graphical demonstration ==
  
 
[[File:Wallsmooth4.png]]
 
[[File:Wallsmooth4.png]]
  
 
In the image above, our robot (the small blue circle) is driving in a circle around an enemy (the red circle). The enemy is 250 units away. Our Wall Smoothing algorithm is currently using a 150 unit distance, so we're going to pick destinations that lie somewhere on the outer dark blue circle. The bright green circle is our destination if we drive clockwise around our enemy, the darker green circle is our destination if we drive counter-clockwise around our enemy. Since we're not yet near a wall, no smoothing is needed.
 
In the image above, our robot (the small blue circle) is driving in a circle around an enemy (the red circle). The enemy is 250 units away. Our Wall Smoothing algorithm is currently using a 150 unit distance, so we're going to pick destinations that lie somewhere on the outer dark blue circle. The bright green circle is our destination if we drive clockwise around our enemy, the darker green circle is our destination if we drive counter-clockwise around our enemy. Since we're not yet near a wall, no smoothing is needed.
 +
  
 
[[File:Wallsmooth5.png]]
 
[[File:Wallsmooth5.png]]
Line 22: Line 26:
 
# We don't hit any walls.
 
# We don't hit any walls.
 
# We can still drive clockwise or counter-clockwise, so we're less predictable (and therefore harder to shoot) than if we always just reversed direction when we came near a wall.
 
# We can still drive clockwise or counter-clockwise, so we're less predictable (and therefore harder to shoot) than if we always just reversed direction when we came near a wall.
 +
  
 
[[File:Wallsmooth6.png]]
 
[[File:Wallsmooth6.png]]
Line 27: Line 32:
 
If we keep driving clockwise, the "smoothing angle" will get steeper and steeper, meaning that we are driving more towards our enemy instead of perpendicular.
 
If we keep driving clockwise, the "smoothing angle" will get steeper and steeper, meaning that we are driving more towards our enemy instead of perpendicular.
  
== Examples ==
+
== Code ==
 
There are several implementations of Wall Smoothing available on the [[/Implementations]] sub-page.
 
There are several implementations of Wall Smoothing available on the [[/Implementations]] sub-page.
  
 
== See also ==
 
== See also ==
 
* [[Dive Protection]]
 
* [[Dive Protection]]
 +
* [[Wall Avoidance]]
  
 
[[Category:Terminology]]
 
[[Category:Terminology]]
 
[[Category:Movement]]
 
[[Category:Movement]]

Latest revision as of 16:56, 25 January 2024

Sub-pages:
Implementations
Youtube
Youtube has a video of Wall Smoothing in action: click here to watch

A method for avoiding collisions with walls without needing to reverse direction. In other words, instead of reversing direction every time your bot would hit the wall (which can be very predictable), your bot will instead turn as it approaches the wall, then move right along the wall.

Wall smoothing is not only suitable for movements that orbit an enemy, but also in Melee situations, which require moving relative to multiple enemies. It is also suitable for GoTo-based movements, such as Minimum Risk Movement. However, in non-orbital situations, wall smoothing is different, and is difficult. Some simply selects some point far from walls, but it still can’t prevent you from hitting the wall (ocationaly), as your path can still intersect with the wall, even if destination is not. Anyway, correct melee wall smothing borrows several ideas from orbital wall smothing. For details, see /Melee Wall Smoothing

How it works

Generally, Wall Smoothing is accomplished by extending an imaginary stick (sometimes called a "blind man's stick") from the front and back of the bot and testing if that stick would touch the wall. If it would, then you adjust the bot's new heading until the stick would not touch the wall. A stick length of about 120 to 150 works well for most bots.

Graphical demonstration

Wallsmooth4.png

In the image above, our robot (the small blue circle) is driving in a circle around an enemy (the red circle). The enemy is 250 units away. Our Wall Smoothing algorithm is currently using a 150 unit distance, so we're going to pick destinations that lie somewhere on the outer dark blue circle. The bright green circle is our destination if we drive clockwise around our enemy, the darker green circle is our destination if we drive counter-clockwise around our enemy. Since we're not yet near a wall, no smoothing is needed.


Wallsmooth5.png

Now we've been driving around our enemy clockwise for a bit more time, and we're starting to approach a wall. The end of the black field is the side of the battlefield. The gray line represents the closest we can get to that wall, which is 18 units. Since we can't drive directly perpendicular to our opponent for 150 units any more, we choose a "smoothed" point which is closer to the enemy. In other words, we choose the intersection of the gray line and our 150 unit dark blue circle. The advantages of doing this are

  1. We don't hit any walls.
  2. We can still drive clockwise or counter-clockwise, so we're less predictable (and therefore harder to shoot) than if we always just reversed direction when we came near a wall.


Wallsmooth6.png

If we keep driving clockwise, the "smoothing angle" will get steeper and steeper, meaning that we are driving more towards our enemy instead of perpendicular.

Code

There are several implementations of Wall Smoothing available on the /Implementations sub-page.

See also