Shop OBEX P1 Docs P2 Docs Learn Events
Automobile Autopilot(sort of) — Parallax Forums

Automobile Autopilot(sort of)

PhilldapillPhilldapill Posts: 1,283
edited 2009-09-16 09:17 in General Discussion
I'm in the "tinkering" stage of a project I'd like to make involving a automated steering mechanism for my car. The general idea is:

1. Get a small camera mounted on the side of the car to "watch" the line on the side of the road.
2. Using a microcontroller, analyze the image and determine the error(how far to the right or left the line is)
3. Have a mechanical mechanism to adjust the steering so that the car remains on the road.

I've got the mechanical mechanism idea down pretty well, so that's not really an issue. The real issue is about the camera and microcontroller. Any suggestions for a simple camera or imaging device? I'd like to use the propeller for this, but I'm worried if it would have the image processing power and speed to be up for the job.

The imaging doesn't have to be SUPER clear. Since the road boundry lines are pretty much uniform throughout the United States, I was thinking using a lens filter to detect the particular color of the line. If I can get a rough estimate of where the line is, relative to the car, I think that should be sufficient. I believe ViewPort could handle this, but I'd like this system to be laptop free - hence the use of the Propeller.
·

Comments

  • SRLMSRLM Posts: 5,045
    edited 2009-08-18 17:42
    Assuming that you've considered the safety and legal implications of this project...

    Two (or more) of these linear cameras would probably work. Just don't try and use the system on old country backroads where the sideline is on the broken edge of the pavement.
  • ManetherenManetheren Posts: 117
    edited 2009-08-19 12:25
    I would say look for both side lines, but it might not like the broken lines.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tia'Shar Manetheren
  • kwinnkwinn Posts: 8,697
    edited 2009-08-19 14:08
    Phil, that is a big project. For sure the easiest part is the mechanical link to the steering.

    If you mount the camera outside make sure it is well protected. I would mount it inside where it is protected and can use the front of the hood as a reference for the relative position of the vehicle.

    The problem with using the propeller for image processing is the lack of memory. By itself it is fast enough to do some basic image manipulation, but when you add the time required to access external memory it gets a lot slower. Even at a resolution of 320 x 240 x 8 you need 76,800 bytes to store the image.
    Four props might be able to handle the images at that resolution. As much as I like the propeller I would be tempted to look at an alternative that could address at least 512K of memory for the image processing.
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-19 14:39
    I would think a cmucam2 or 2plus would be a great option. Unlike the linescan sensor it will give you better resolution and a faster capture speed. Just a thought.

    Also, kwinn, couldn't adding extra ram and an sd card get around some of this?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • waltcwaltc Posts: 158
    edited 2009-08-19 14:43
    You might look at what the entrants to the DARPA Grand Challenge used in their autonomous vehicles.

    Put another way its going take a lot more than a Prop.
  • LilDiLilDi Posts: 229
    edited 2009-08-19 21:05
    Camera vibration will be a big hurdle as well. I da no. Why do I feel like dusting off the Dawin award in preparation for upcoming events. The DARPA solution will probably cost more than your car (before you test it). Stereo vision system, Sick laser radar, high tech GPS, artificial neural network and really good car insurance, just to name a few. Man this is going to be great...

    Post Edited (LilDi) : 8/19/2009 9:25:31 PM GMT
  • PhilldapillPhilldapill Posts: 1,283
    edited 2009-08-19 21:48
    These are great ideas. Right now, just to get it up and going, I'm going to use a head-mounted accelerometer to do the steering. Basically, I tilt my head to the left to turn left, tilt to the right to turn right. Once the mechanical side is done, and I've got some good filtering, then I'll move on to the camera method.

    Of course, I'll always have my hands ready to grab the wheel in case my gadget goes a bit nutty. I'd rather not total my car just to play with some electronics...
  • SRLMSRLM Posts: 5,045
    edited 2009-08-19 22:11
    PhillDaPill said...
    Right now, just to get it up and going, I'm going to use a head-mounted accelerometer to do the steering. Basically, I tilt my head to the left to turn left, tilt to the right to turn right.

    I think that's a very bad idea. Since an accelleromter can't tell the difference between a tilt and a turn, I think you'd get into a situation where the turn is unstable: you tilt your head a little, the car turns, it thinks you've tilted more, so it turns even more, and so on. A better solution would use an IMU. DIY drones sells one for about $100.
  • LilDiLilDi Posts: 229
    edited 2009-08-19 22:24
    So you turn your head to the right and the sensor reacts by turning the car right, but the car turning right is seen by the sensor as more turning to the right. Would make a great spin out. Can anyone recommend a good trophy polish. LOL
  • PhilldapillPhilldapill Posts: 1,283
    edited 2009-08-19 22:30
    Hmmm, I agreed with you for a second, but just erased what I had said. At first, I thought you were right. I thought there would be a positive feedback thing going on. However, that would only happen if I tilted my head the OTHER way. If I tilt my head to the right, and the steering adjusts to turn right, then I would actually have negative feedback. Let's say that my Z direction for the accelerometer is the axis that is vertical, and the X axis is parallel to the direction of travel(Y axis means nothing here). If I tilt my head to the left, the outward acceleration of the car would in fact counteract the acceleration due to gravity. Basically, the car would think that I tilted my head a little back to vertical. If anything, I may have some unstable oscillations where the car gets a little jerky - I just need good filtering of the signal.

    I am right, right?
  • SeariderSearider Posts: 290
    edited 2009-08-20 01:02
    There are a few more potential failure modes to copensate for.

    1. You are driving down the road and someone next you honks their horn. You quickly turn your head to look ...

    2. You spill a drink and look down ...

    3. a bee gets in the car ...

    sounds like fun though.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    Searider
  • ManetherenManetheren Posts: 117
    edited 2009-08-20 11:36
    What happens when you turn your head to look at your blindspots? Especially if someone is in them.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tia'Shar Manetheren
  • ManetherenManetheren Posts: 117
    edited 2009-08-20 11:37
    This is a very good idea of a project, but there are many different hazards associated with it. I always thought that traffic would go alot better if every car was on some sort of autopilot working together. A massive Auto-Net.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tia'Shar Manetheren
  • LilDiLilDi Posts: 229
    edited 2009-08-20 16:53
    Cadillac sells a car or mini van that alerts the driver when they are about to cross the center line or the outside shoulder line. I'm guessing the sensors are under the car. Maybe you could scale back this project to that idea.
  • HimszyHimszy Posts: 28
    edited 2009-09-16 01:48
    SRLM said...
    Assuming that you've considered the safety and legal implications of this project...

    Two (or more) of these linear cameras would probably work. Just don't try and use the system on old country backroads where the sideline is on the broken edge of the pavement.
    Apologies for kicking up an old thread but I'm looking at a very similar project.

    SRLM, could I just ask you to explain your·two or more cameras comment?

    At the moment I'm thinking along the lines of a camera mounted in each wing mirror angled slightly out so that the middle of the camera is where the line should be.
  • AJ-9000AJ-9000 Posts: 52
    edited 2009-09-16 09:17
    LilDi said...
    Cadillac sells a car or mini van that alerts the driver when they are about to cross the center line or the outside shoulder line. I'm guessing the sensors are under the car. Maybe you could scale back this project to that idea.

    The Lexus LS460 has gone one step further and has electric power steering to actualy steer the car to hold its lane using a Lane Keeping Assist system, although the driver must remain active otherwise the system will deactivate. See http://en.wikipedia.org/wiki/Lane_departure_warning_system
Sign In or Register to comment.