ROBOTC.net forums
http://www.robotc.net/forums/

Creating An Autonomous Driver
http://www.robotc.net/forums/viewtopic.php?f=1&t=5274
Page 1 of 1

Author:  Programmrz [ Mon Dec 17, 2012 3:35 pm ]
Post subject:  Creating An Autonomous Driver

I am trying to create a car, and i almost done. I am having trouble with object avoidance, however. My car is supposed to see the car in front of it, take the left lane, accelerate, and then go back to the right lane. The problem is, I don't have enough sensor ports. I have a tetrix Motor and servo controller, daisy chained, 2 light sensors ( for keeping in the lane) , and a sonar sensor, to detect the car in front. Because of this, i don't know if I have passed the car or not. here is my pseu code. I will be grateful if anyone can help me write this out. Thanks :biggrin: :biggrin: :biggrin:

Code:
 if( SensorValue(sonarSensor) <=15 )
      //TURNLEFT until RIGHTLIGHTSENSOR SEES sees WHITE
      //STRAIGHTEN UNTIL BOTH LightSensors see black
      //CONTINUE FOR 3 SEC, TURN RIGHT
      //STRAIGHTEN WHEN LEFTLIGHTSENSOR SEES WHITE
     //CONTINUE

    }


Attachments:
File comment: This the overtake senario
Overtake.png
Overtake.png [ 44.92 KiB | Viewed 3728 times ]

Author:  MHTS [ Mon Dec 17, 2012 9:28 pm ]
Post subject:  Re: Creating An Autonomous Driver

There are many ways to solve this. One way is to put the sonar sensor on a rotating platform (on a LEGO motor). Normally, the sonar sensor will point straight ahead. When you detect obstacle in front, you will switch to the left lane and turn the sonar to point to the right. So you will know precisely when you pass the car. Then you can turn back to the right lane and turn the sonar back straight ahead. This, of course, is assuming there is no obstacle on the left lane since your sonar sensor is no longer pointing forward. If your scenario does need to account for obstacle on the left lane as well, then you need to implement a "radar". A sonar sensor that can scan between left, forward and right back and forth.

Author:  MikeJMcFarlane [ Tue Dec 18, 2012 5:02 am ]
Post subject:  Re: Creating An Autonomous Driver

MHTS wrote:
There are many ways to solve this. One way is to put the sonar sensor on a rotating platform (on a LEGO motor). Normally, the sonar sensor will point straight ahead. When you detect obstacle in front, you will switch to the left lane and turn the sonar to point to the right. So you will know precisely when you pass the car. Then you can turn back to the right lane and turn the sonar back straight ahead. This, of course, is assuming there is no obstacle on the left lane since your sonar sensor is no longer pointing forward. If your scenario does need to account for obstacle on the left lane as well, then you need to implement a "radar". A sonar sensor that can scan between left, forward and right back and forth.


I'm doing something similar at the moment. The problem I am finding is that the ultrasound sensor has a 'cone' of detection so detects anything within approx 30º, or misses smaller objects. Do you know any ways to improve this e.g. works better when objects are within say 100mm and at right angles to the sensor?

Author:  MHTS [ Tue Dec 18, 2012 5:33 am ]
Post subject:  Re: Creating An Autonomous Driver

MikeJMcFarlane wrote:
I'm doing something similar at the moment. The problem I am finding is that the ultrasound sensor has a 'cone' of detection so detects anything within approx 30º, or misses smaller objects. Do you know any ways to improve this e.g. works better when objects are within say 100mm and at right angles to the sensor?

I don't understand. According to your problem description, there should not be any problem detecting the "obstacle" as an entire car. Is your scenario including small objects on the road? If you explain your scenario, we will see how that can be solved.

Author:  Programmrz [ Tue Dec 18, 2012 9:06 am ]
Post subject:  Re: Creating An Autonomous Driver

The way with the rotating sonic sensor appeals to me. I will do that. There will not be any objects on the left lane so thanks!

For MikeJMcFarlane , the robots are small enough to fit under a HPI racing body cover http://www.hpiracing.com/products/en/7712/ and both robots will be driving on a small 'city' track. The body is big enough to be detected by the sonar sensor when it is slightly pointed downwards. On car will accept a Bluetooth transmission to nt overtake if a car overtakes in front of it. so I don't have both cars continue to overtake each other.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/