Hi All
I would still like some pointers to navigation algorithms that are proven to work.
My current process is roughly as follows
main loop {
if first time in main loop { navigate() }
else { scanWhileDriving() }
}
navigate() {
while not clearAhead() {
scanForPath()
turnTowardsPath()
}
goForeward
}
scanWhileDriving() {
Scan 30 degrees each side of straight ahead (60 deg to 120 deg)
if anything closer than collisionThreshold detected {
stop
navigate()
}
}
clearAhead() {
Scan at [60, 75, 90, 105, 120] degrees (90 being straight ahead)
if anything closer than clearPathThreshold { return false }
else { return true }
}
scanForPath() {
Scan 80 degrees each side of straight ahead ( 10 deg to 170 deg)
Return furthest distance >= clearPathThreshold and angle distance found at
}
turnTowardsPath() {
lookStraighAhead
turn leftOrRightBasedOnAngle until furthestDistance found
}
I would appreciate any comments or pointers or even some grown-up navigation algorithms...
I placed the while not clearAhead in the navigate loop because when it turns towards the clear distance it stops turning when the wheels will still have collision danger...