Screen_Grab_Sonar_Radar_Thing_w_numbers.JPG (124654Bytes)
So here we go... I have been sick of "regular" navigation for quite a while now (more than a year now). The whole idea of "just keep going and if there is something there, react to it" is just not doing it for me any more. For the last year or so, I have been thinking about and working on a new system of "may I go". The theory is basic: Before you start going somewhere, check that there is somewhere to go! In the system I am using now, a 180 degree scan is performed and the sonar readings and angle is sent to processing. From there, paths are determined and the "best path" is chosen from all the available paths. As we sit now, the system is a follows:
Whole scan
Find "sections" or paths
Tell me how many "available" paths there are.
Weed out the "paths" that are not wide enough for Walter to fit through
(in this version of the code) Pick the widest one
Find the center of this "widest path", figure out how far to turn to get to this heading
Turn there and go!
Now, I can add as many options as I want as to what path to choose and why. Also there can be more weeding-out as well, i.e. ignore all paths that are wicked close, etc. Now that I have the basic system down, I can expand almost endlessly.
Please watch the video as it explains quite a bit.
Here is my data:
And the numbers:
Now, when you see the first arrays, the ones with all the raw distance numbers, you will see that the widest paths don't have the most numbers of readings in them. --I have no idea why. The final data I am getting is all coming out clean as a whistle so the funny numbers must be a problem with how I am writing to the arrays in the first place. Again, I don't know and I am not going to look to far into this as the final numbers are spot-on.
Index 1 Contains Array: [172.64, 172.64, 172.37999, 172.37999, 171.86, 171.86, ]
Index 2 Contains Array: [172.64, 172.64, 172.37999, 172.37999, 171.86, 171.86, 150.41, 150.41, 149.11, 149.11, 148.33, 148.33, 140.53001, 140.53001, 138.58, 138.58, 138.44998, 138.44998, 137.8, 137.8, 137.15, 137.15, 137.15, 137.15, 137.28001, 137.28001, 137.28001, 137.28001, 137.15, 137.15, 137.67, 137.67, ]
Index 3 Contains Array: [172.64, 172.64, 172.37999, 172.37999, 171.86, 171.86, 150.41, 150.41, 149.11, 149.11, 148.33, 148.33, 140.53001, 140.53001, 138.58, 138.58, 138.44998, 138.44998, 137.8, 137.8, 137.15, 137.15, 137.15, 137.15, 137.28001, 137.28001, 137.28001, 137.28001, 137.15, 137.15, 137.67, 137.67, 158.34, 158.34, 137.93, 137.93, 137.93, 137.93, ]
Index 4 Contains Array: [172.64, 172.64, 172.37999, 172.37999, 171.86, 171.86, 150.41, 150.41, 149.11, 149.11, 148.33, 148.33, 140.53001, 140.53001, 138.58, 138.58, 138.44998, 138.44998, 137.8, 137.8, 137.15, 137.15, 137.15, 137.15, 137.28001, 137.28001, 137.28001, 137.28001, 137.15, 137.15, 137.67, 137.67, 158.34, 158.34, 137.93, 137.93, 137.93, 137.93, 101.4, 101.4, 100.1, 100.1, 96.85, 96.85, 96.07, 96.07, 95.42, 95.42, 89.57, 89.57, 96.2, 96.2, 98.28, 98.28, 98.409996, 98.409996, 101.009995, 101.009995, ]
Index 5 Contains Array: [172.64, 172.64, 172.37999, 172.37999, 171.86, 171.86, 150.41, 150.41, 149.11, 149.11, 148.33, 148.33, 140.53001, 140.53001, 138.58, 138.58, 138.44998, 138.44998, 137.8, 137.8, 137.15, 137.15, 137.15, 137.15, 137.28001, 137.28001, 137.28001, 137.28001, 137.15, 137.15, 137.67, 137.67, 158.34, 158.34, 137.93, 137.93, 137.93, 137.93, 101.4, 101.4, 100.1, 100.1, 96.85, 96.85, 96.07, 96.07, 95.42, 95.42, 89.57, 89.57, 96.2, 96.2, 98.28, 98.28, 98.409996, 98.409996, 101.009995, 101.009995, 120.899994, 120.899994, 121.03001, 121.03001, 122.329994, 122.329994, 123.11, 123.11, 124.409996, 124.409996, 124.409996, 124.409996, 117.39, 117.39, 117.39, 117.39, ]
Index 6 Contains Array: [172.64, 172.64, 172.37999, 172.37999, 171.86, 171.86, 150.41, 150.41, 149.11, 149.11, 148.33, 148.33, 140.53001, 140.53001, 138.58, 138.58, 138.44998, 138.44998, 137.8, 137.8, 137.15, 137.15, 137.15, 137.15, 137.28001, 137.28001, 137.28001, 137.28001, 137.15, 137.15, 137.67, 137.67, 158.34, 158.34, 137.93, 137.93, 137.93, 137.93, 101.4, 101.4, 100.1, 100.1, 96.85, 96.85, 96.07, 96.07, 95.42, 95.42, 89.57, 89.57, 96.2, 96.2, 98.28, 98.28, 98.409996, 98.409996, 101.009995, 101.009995, 120.899994, 120.899994, 121.03001, 121.03001, 122.329994, 122.329994, 123.11, 123.11, 124.409996, 124.409996, 124.409996, 124.409996, 117.39, 117.39, 117.39, 117.39, 99.06, 99.06, 98.28, 98.28, 91.78, 91.78, 89.829994, 89.829994, 89.7, 89.7, 89.7, 89.7, 89.7, ]
Total Number of Available Paths : 6
Path Number 1 Last ray number for that path : 7
Path Number 2 Last ray number for that path : 33
Path Number 3 Last ray number for that path : 39
Path Number 4 Last ray number for that path : 59
Path Number 5 Last ray number for that path : 75
Path Number 6 Last ray number for that path : 88
Path Number 1 Width 7
Path Number 2 Width 26
Path Number 3 Width 6
Path Number 4 Width 20
Path Number 5 Width 16
Path Number 6 Width 13
Path Number 2 is a wide enough path
Path Number 4 is a wide enough path
Path Number 5 is a wide enough path
The Widest Path Available is Path Number 2
Chosen heading is 40 degrees from left edge