Shop OBEX P1 Docs P2 Docs Learn Events
Object tracking..... — Parallax Forums

Object tracking.....

JlittlemyerJlittlemyer Posts: 4
edited 2009-07-15 04:14 in BASIC Stamp
I was wondering if it is possible to "track" a moving object with the Ping sensor using the BS2?·The setup I’m trying to achieve is a ping sensor mounted to a servo that·will allow the sensor to follow an object from left to right or vice versa.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-07-01 19:48
    It would need to be a relatively slow moving object since you need to allow enough time for the echos to die down before issuing another sound pulse. If you don't know which direction the object is moving in, you have to make several measurements to figure that out (to the left and right of its last known position. If the object is moving directly toward or away from the PING, it easier since you don't have to track it.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-07-01 20:50
    Hello,

    On a tank turret I had once implemented some basic tracking using two PING))) sensors. They were tuned for objects between 5 and 10 feet so that a person or other fairly sized object could be seen by both sensors. When one sensor had a higher range the system would move to keep both sensors on the object by turning the turret. It was supposed to fire a water hose at the target but I did have a few things cause me issues such as an even closer object coming into the FOV or sporadic readings from people due to poor reflection.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • FlyingFishFingerFlyingFishFinger Posts: 461
    edited 2009-07-02 01:41
    I did a tracking ghost as a Halloween prop a few years ago. I used two ultrasonic sensors and aimed to keep the target in between them. If one of them read something, it would move in that direction a bit, then take another reading. This works fairly well if you know at what distance from the sensors your target is.

    Rafae;

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You've got to play the game.
    You can't win.
    You can't break even, except on a very cold day.
    It doesn't get that cold.
    ~Laws of Thermodynamics~
  • JlittlemyerJlittlemyer Posts: 4
    edited 2009-07-02 05:43
    Ive been working on it all day, thanks for the replies. Ive ran into the same problems, without a set distance from the sensors its proving to be a pain. Would there be an easier method other than using a ping sensor? Ive heard of people using an array of IR emitters and detectors to determine the direction of movement. The only problem with using IR is the interference from ambient lights and the short range.
  • SandgroperSandgroper Posts: 62
    edited 2009-07-03 14:34
    If you're tracking people instead of objects you might consider using PIR's.· The only drawback is that they don't read distances.

    The PING will work if you're using it·in·an otherwise movement-free enviroment, especially if the target is relatively close (but not too close to other objects).· Tracking is much easier with two or more PING's though because it allows you to check·for lateral movement.· On mobile robots you can use a ring of sensors and dispense with the power-hungry servo.

    One trick if you're using a PING on a servo is to pan the servo on a centre-left-centre-right cycle.· This is faster than using·the standard·left-centre-right pan, because you don't have to wait for the servo to travel from full right to full left before·repeating each sweep.· Depending on the speed of your servo, it could save up to 200 ms per sweep.· I've used this method for programming a robotic "dog" which "barks" and charges at anyone who gets too close, but retreats to a safe distance when it is approached.· I've also used it for a robotic "statues" game, where the robot creeps up behind you but freezes when you turn around.·

    Another trick is to do a series of overlapping pans and test to see which sectors the PING is active in.··This is slow, but it gives you better directionality.· With a standard·"left - centre - right" pan, an object could be detected in any one (or more) of three rather wide sectors.· If you increase this to·a five or seven sector pan·you·can get a better approximation of·the object's direction.··For instance, if the PING is active in sector one·but not in sector two (reading from left to right), the object must·be at the extreme left.· In a 120 degree sweep, a seven sector pan can give you a resolution of 17 degrees or so, which is·much better than the 40 degrees offered by the·PING.·

    Don't forget that set distance measurement can be a drawback.· It's just as important to detect changes in distance.
  • jeff2.0jeff2.0 Posts: 24
    edited 2009-07-15 03:41
    I am trying to find a way to do this same thing.
    Is it possible to use a small camera as a sensor with a basic stamp?
  • Mike GreenMike Green Posts: 23,101
    edited 2009-07-15 04:12
    jeff2.0,
    Not by itself. A Basic Stamp is incapable of handling the amount of data or the data rate involved from a camera. Have a look at the BoeBot CMUcam which contains a lot of external circuitry including a pretty fast co-processor that handles the video data and analyzes it so only a small amount of data needs to be sent to the Stamp (www.parallax.com/StoreSearchResults/tabid/768/List/0/SortField/4/ProductID/29/Default.aspx?txtSearch=stamp+camera).
  • jeff2.0jeff2.0 Posts: 24
    edited 2009-07-15 04:14
    Thanks Mike.
    I will look for the new member discount thingee and buy them now.
    j
Sign In or Register to comment.