Shop OBEX P1 Docs P2 Docs Learn Events
Scribbler 2 Enhanced Obstacle Avoidance (Video) — Parallax Forums

Scribbler 2 Enhanced Obstacle Avoidance (Video)

Duane DegnDuane Degn Posts: 10,588
edited 2020-03-07 19:07 in Robotics
After Mark pointed out the problems of using a Ping with the S2, I tried adding my MaxBotix LV-EZ0 ultrasound sensor to the S2.

I found the weakness with the ultrasound was its inability to see our couch. I changed the original program to keep track of how long it had been since the previous obstacle so if the robot encountered the same obstacle twice it would head off in the opposite direction.

I posted my very first YouTube video of the robot avoiding a few obstacles. (I'm going to see if I can embed it here. Now it works.)



The S2 periodically plays a note. The pitch of the note is dependent on the range detected by the ultrasound sensor. The S2 will play high pitched notes when the range is close. The interval between notes also decreases for close range readings.

As the program is now, the robot speeds a lot of time driving across the room it's in. I might modify the program latter to follow a wall or to try to find the farthest point away from its starting position.

I'm pleased with the program so far.

In the video, both the serial pin and the analog pin on the MaxBotix sensor are connected to the S2. The attached program only uses the information from the serial pin since it has better resolution than using the S2's ADC method.

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-01-09 09:44
    Save a spot for other information.
  • TtailspinTtailspin Posts: 1,326
    edited 2012-01-09 09:58
    Thats good stuff. :thumb::thumb:

    S2's are the most beepingiest noise making little things.. Smart, but noisy..:smile:

    -Tommy
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-01-09 10:08
    Ttailspin wrote: »
    Thats good stuff. :thumb::thumb:

    S2's are the most beepingiest noise making little things.. Smart, but noisy..:smile:

    -Tommy

    There's a line in the code:
    s2.set_volume(_Volume)
    

    I presently have the volume set to 50 but if I think I'm disturbing my wife, I'll change it to 5.

    I'm working on a robot remote right now. One things I'd like to be able to control remotely is the volume of robot.

    I used the Scribbler 2 GUI to generate code to produce the sounds. I'm pretty sure the volume control slider in the GUI doesn't affect the volume of sound made by the robot. The volume needs to changed inside the Spin code.
  • ercoerco Posts: 20,256
    edited 2012-01-09 13:08
    Sweet! And quite an advantageous location for the sign proudly bearing the prestigious DEGN moniker!
  • mindrobotsmindrobots Posts: 6,506
    edited 2012-01-09 13:27
    Great work! (once again)

    It's interesting how the ultrasound thinks the couch it doesn't very well see is even a clearer path than the wide open spaces behind it.

    (yes, the S2's can beep and squawk a lot! I'm picturing Phil and "poor" Browser during testing and development!)
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-01-09 14:01
    erco wrote: »
    Sweet! And quite an advantageous location for the sign proudly bearing the prestigious DEGN moniker!

    That wasn't on purpose. A neighbor gave that to us for Christmas(maybe this year?). We babysit her kids every so often so she made it as a kind of "thank you" gift (I think). It has the phrase "where love is" across the front in smaller white letters. Maybe I could get her make one with "where robot are" for us too.

    Her ten year old son (her oldest child) comes over on Saturday sometimes to discuss his latest ideas on the robot he whats to make. I believe the current plan it to have the robot spray weed killer on weeds and scoop the dog poops in their back yard. I'm under the impression he's responsible for removing weeds and and other undesirables from the backyard.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-01-09 14:11
    mindrobots wrote: »
    Great work! (once again)

    It's interesting how the ultrasound thinks the couch it doesn't very well see is even a clearer path than the wide open spaces behind it.

    (yes, the S2's can beep and squawk a lot! I'm picturing Phil and "poor" Browser during testing and development!)

    Thanks Rick.

    Yes, the ultrasound doesn't just pass through the material of the couch, it's absorbed by it. The couch is just barely too high for the IR sensor to see. When the ultrasound sensor compresses the material, it can then see the frame underneath.

    All the sounds made by the S2 in the video are sounds I added. I removed the original sounds in the object avoidance program. I used the sounds as a debugging aid. I can tell what part of the program is being executed based on the sound the S2 makes.

    The search for a clear path would go a lot faster if I removed the sounds (or at least didn't require the S2 to wait for one sound to finish before playing the next).
  • Martin_HMartin_H Posts: 4,051
    edited 2012-01-09 16:46
    Cool modification of the S2.

    The IR sensors on the Scribblers are pretty low to the floor, and they often miss things that don't go all the way to the floor. We've had our S1 end up under the bed, couch, end table, etc. Then it gets wedge and the stall sensor kicks in.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-01-10 05:28
    Martin_H wrote: »
    Cool modification of the S2.

    The IR sensors on the Scribblers are pretty low to the floor, and they often miss things that don't go all the way to the floor. We've had our S1 end up under the bed, couch, end table, etc. Then it gets wedge and the stall sensor kicks in.

    Thinking it would make a better video, I started to enclose part of our living room with boxes and sheets of stiff plastic so the S2 would hit an obstacle more frequently. I found artificial environment is just about perfect for the S2's IR sensors and the ultrasound sensor was rarely triggered. I think the ultrasound really shines with detecting furniture legs. The IR sensors seem to have a hard time seeing furniture legs. So I abandoned the artificial setup and started the video with the S2 headed for some furniture with legs (and a nice "DEGN" sign).

    Our kitchen is a great room for showing off the S2's IR sensors. The room has nice flat, light colored, walls. The ultrasound rarely has a chance to help avoid a wall in the kitchen.
  • Roboticsmaster128Roboticsmaster128 Posts: 32
    edited 2012-01-17 18:48
    That's really nice.it gives the robot pretty good navigation
Sign In or Register to comment.