Shop OBEX P1 Docs P2 Docs Learn Events
good wall following technique? — Parallax Forums

good wall following technique?

ArchiverArchiver Posts: 46,084
edited 2004-04-12 18:27 in General Discussion
Hi to all.

I'm trying to design an algorithm for a wall-following robot.
I got 3 working distance sensors connected to it, going front, left
and right.
Anyone got an idea as to how it can be programmed to follow the wall
at roughly 20 cm? By the way, it's a 2-wheel robot.
I tried having it turn slightly when it sensed its too close or too
far, but then the direction for the sensors would also be changed, so
it often times ends up crashing into the wall.

Please reply if anyone got an idea.
Thank you.

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-04-11 00:20
    I tried the same thing you did, and I got the same results that you got. I'm
    adding a compass to my robot.

    ________


    Original Message
    From: "rich2kchan" <rich2kchan@y...>
    To: <basicstamps@yahoogroups.com>
    Sent: Saturday, April 10, 2004 5:07 PM
    Subject: [noparse][[/noparse]basicstamps] good wall following technique?


    > Hi to all.
    >
    > I'm trying to design an algorithm for a wall-following robot.
    > I got 3 working distance sensors connected to it, going front, left
    > and right.
    > Anyone got an idea as to how it can be programmed to follow the wall
    > at roughly 20 cm? By the way, it's a 2-wheel robot.
    > I tried having it turn slightly when it sensed its too close or too
    > far, but then the direction for the sensors would also be changed, so
    > it often times ends up crashing into the wall.
    >
    > Please reply if anyone got an idea.
    > Thank you.
    >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    > Yahoo! Groups Links
    >
    >
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-11 01:34
    I use an algorithm similar to what you described, and it works fine. Try
    mounting your sensors at an angle forward as opposed to perpendicular to your
    robot and the wall.

    John Baker
    http://www.geocities.com/johnsrobotics/

    rich2kchan <rich2kchan@y...> wrote:
    Hi to all.

    I'm trying to design an algorithm for a wall-following robot.
    I got 3 working distance sensors connected to it, going front, left
    and right.
    Anyone got an idea as to how it can be programmed to follow the wall
    at roughly 20 cm? By the way, it's a 2-wheel robot.
    I tried having it turn slightly when it sensed its too close or too
    far, but then the direction for the sensors would also be changed, so
    it often times ends up crashing into the wall.

    Please reply if anyone got an idea.
    Thank you.



    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject and Body of
    the message will be ignored.

    Yahoo! Groups Links






    Do you Yahoo!?
    Yahoo! Tax Center - File online by April 15th

    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-12 18:27
    > I'm trying to design an algorithm for a wall-following robot.
    > I got 3 working distance sensors connected to it, going front, left
    > and right.
    > Anyone got an idea as to how it can be programmed to follow the wall
    > at roughly 20 cm? By the way, it's a 2-wheel robot.
    > I tried having it turn slightly when it sensed its too close or too
    > far, but then the direction for the sensors would also be changed, so
    > it often times ends up crashing into the wall.

    I'd go with four sensors, one at each diagonal; if the robot is facing north
    the sensors would be at north-east, south-east, south-west & north-west.

    The west sensors would only be used for collision avoidance. The east
    sensors would be used for wall alignment and distance.

    while (1)
    if ((NE + SE) > 40) // too far away?
    steer_right();
    else
    {
    if (NE > SE) // headed away from wall?
    steer_right();
    else
    steer_left();
    }
    }

    --
    Enjoy,
    George Warner,
    Schizophrenic Optimization Scientists
    Apple Developer Technical Support (DTS)
Sign In or Register to comment.