Shop OBEX P1 Docs P2 Docs Learn Events
Scanning obstacles with PING for robot navigation — Parallax Forums

Scanning obstacles with PING for robot navigation

WombaxWombax Posts: 19
edited 2008-10-26 10:20 in Robotics
Hello.

Is there any suggestion (simple code) for using the PING sensor with a standard servo in order to scan various directions for obstacle avoidance ?

I'm interested in combining servo angle with robot direction and obscale detection.

Thank you,
Luca.

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-01-13 18:52
    Roaming with the PING))) may not be the simplest code, but then integrating the PING))) into navigation, especially with the bracket, requires some calibration of the various servo positions. I would at least refer to that code as a reference. You can download it from the PING))) product page on our website. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • WombaxWombax Posts: 19
    edited 2008-01-13 20:04
    Thank you so much Chris.

    I had a look to the suggested code, which is one possible implementation. However, I was more interested in linking "directly" Ping mounting servo direction with obstacle distance and robot position (a sort of "simplified" relationship between the Ping detector angle and the obstacle avoidance).

    I keep waiting if other suggestion may occur.

    Thank you,
    Luca.
  • DiablodeMorteDiablodeMorte Posts: 238
    edited 2008-01-14 04:04
    I'm not sure exactly what you want but last year I set up a Ping))) on a servo and rotated it's full range. I then converted that into degrees and then plotted those points in polar coordinates. I got a really interesting graph. I've seen this technique used before and I even recently found someone who had actually done this with a Lego robot and then overlaid the data on the video he took of the robot spinning. It was really cool.
  • WombaxWombax Posts: 19
    edited 2008-01-14 19:36
    Thank you DiabloMorte.
    May I have more details concerning the code used?
    Thank you,
    Luca.
  • DgswanerDgswaner Posts: 795
    edited 2008-01-14 21:45
    Have you seen the PingDar code? it isn't exactly what your trying to do but it might be a good start. it is basically "radar" with the PING the code sweeps a servo back and forth and displays what the PING "sees" in the debug window.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "A complex design is the sign of an inferior designer." - Jamie Hyneman, Myth Buster

    DGSwaner
  • ZootZoot Posts: 2,227
    edited 2008-01-15 18:58
    If you want a somewhat ready-to-go place to start, I would use the basic code from the Ping)) Go to and Find Closest Object program. That program already has three key modules of code ready-to-go (presuming you've calibrated your pulse counts):

    - rotating Ping))) pan servo in calibrated angles (brads)
    - measuring and storing Ping))) distance with the ANGLE of the distance (brads)
    - turning the Boe-bot in calibrated angles (brads)

    You could take "go to and find closest object" and change the main logic of the program to "go forward to farthest distance". Instead of scanning for the closest object and finding it's edges and aiming for the center point, find the farthest distance and aim at it.

    The "go to and find closest object" program also includes logic for stopping the Boe-bot when it is about 5cm from the target object -- you could change that portion of the code to have the Boe-bot stop and again scan for farthest distance and go there.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
  • WombaxWombax Posts: 19
    edited 2008-10-26 10:20
    Thank you to you all.

    I could manage to buid a first program from bits and pieces.

    smile.gif

    Luca.
Sign In or Register to comment.