go_away

Author Topic: Finding the nearest object with IR sensor.  (Read 1654 times)

0 Members and 1 Guest are viewing this topic.

Offline Fredrik AnderssonTopic starter

  • Robot Overlord
  • ****
  • Posts: 216
  • Helpful? 0
Finding the nearest object with IR sensor.
« on: November 27, 2007, 09:15:21 AM »
I have a little problem here. On Thursday i will present a prototype robot for our school project. It's mostly a test on the hardware we are going to use.

The robot is about the same as the upgraded 50$ robot. It has two servo motors for wheels, one IR sensor, and a servo for it.

How can i make the robot find the nearest object and drive in the direction of it. It should look around in every direction. I've tried with two different approaches: First i tried making the robot scan 180 degrees with the IR several times and spinning the whole body about 90 degreed in between. The nearest value and the position of the IR:s servo on that time where stored. When it cycled that four times (a whole orbit) it started matching the nearest value with what it saw. If match it would drive in that direction. The second approach is similar, but with the difference that it only was spinning its whole body, with the IR looking forward all the time. Both approaches worked somehow, but the first one was a little more accurate.

The problem is that i never can make sure that it rotates the suggested amount. I have to time it, which will generate poorer results if it's on for example a rug. I can't really change any hardware now if you suggest that i should get an encoder or something like that. I don't really have the time to get those parts.

Any suggestions on how i should do?
Current project: Pirrh - Portable Intelligent Round Rolling Hexapod

Offline Fredrik AnderssonTopic starter

  • Robot Overlord
  • ****
  • Posts: 216
  • Helpful? 0
Re: Finding the nearest object with IR sensor.
« Reply #1 on: November 27, 2007, 03:15:07 PM »
Should i maybe try a completely different approach.

The behavior I'm going for is somewhat like that of a cat. The robot should like to drive near walls, and don't like to be in open spaces. I also have a pair of photovore sensors connected, so it will like to stay in dark areas.

I was thinking of having it scaling down the distance it's looking for starting from near and going farer from there. It first rotates an orbit searching for really near objects, then looking for objects slightly further away and so on. Yeah, I'm going to try that. Still, feel free to give me any advice or suggestion.
Current project: Pirrh - Portable Intelligent Round Rolling Hexapod

Offline JonHylands

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 562
  • Helpful? 3
  • Robot Builder/ Software Developer
Re: Finding the nearest object with IR sensor.
« Reply #2 on: November 27, 2007, 03:37:41 PM »
With my mini-sumo Seeker 2, it hunts for the opponent. It never assumes its blindly pointing directly at the object once it sees it. It homes on the object even while the object moves around. It does this by constantly checking if the object is in view with both IR sensors, and turning towards the one that does see it if only one does.

That's harder to do with just one sensor, but you just need to constantly update where you think the other object is relative to your robot as you turn towards it.

Track it in real-time, in other words. Don't take a reading, and then blindly turn to the direction you think it was. Think about how you would navigate to a tree in the middle of a park. You don't take a bearing on it, close your eyes, and then turn in the direction your head was pointing, and then walk the right number of steps to get to the tree. You'd never hit it dead on.

- Jon

 


Get Your Ad Here

data_list