Pages: [1]   Go Down
Author Topic: distance sensing navigation algorithms anyone?  (Read 1727 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 0
Posts: 111
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey guys. Now that I have my robot base working (3D printed base & caterpillar tracks and turns on a carpet!! wohoo) I am attempting to add some intelligence.

First step is some pointless and continuous wandering around without bumping into things using a sharp IR distance sensor on a small servo.

Can anyone point me to some algorithms for said navigation using a distance sensor. Even high level pseudo code (probably preferred) would be good to compare with my currently non-functioning navigation approach.

cheers
Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 5579
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey guys. Now that I have my robot base working (3D printed base & caterpillar tracks and turns on a carpet!! wohoo) I am attempting to add some intelligence.

First step is some pointless and continuous wandering around without bumping into things using a sharp IR distance sensor on a small servo.

Can anyone point me to some algorithms for said navigation using a distance sensor. Even high level pseudo code (probably preferred) would be good to compare with my currently non-functioning navigation approach.

cheers

Completely untested pseudocode:

Code:
Loop:

While (Read Distance From Sensor) < MinimumDistance

MoveBackwardBySmallAmount

TurnByRandomAmountRandomlyLeftOrRight

End If

MoveForward

 smiley
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Offline Offline
Full Member
***
Karma: 0
Posts: 111
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi All

I would still like some pointers to navigation algorithms that are proven to work.

My current process is roughly as follows

Code:


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...

Logged

Houston Area
Offline Offline
Jr. Member
**
Karma: 0
Posts: 68
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm working on the same thing.
I building a robotic lawnmower.
Have a look at SLAM. I'm using a sonic sensor because I think it can give me better range and more accurate. I will use IR to sense close objects perhaps from behind.
I have the sensor mounted so I can pan and tilt.
There are a few other techniques if you google but I thought SLAM was the best choice for me.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you considered taking a braitenberg vehicle approach, this works pretty well for obstacle avoidance.

http://en.wikipedia.org/wiki/Braitenberg_vehicle

Or perhaps Potential Fields would be more suitable - have a read of "AI Robotics" by Robin Murphy, this is a good reference book as a starter and it pretty readable.

Logged

Pages: [1]   Go Up
Jump to: