View unanswered posts | View active topics It is currently Thu Apr 17, 2014 6:12 pm






Reply to topic  [ 5 posts ] 
Creating An Autonomous Driver 
Author Message
Rookie

Joined: Mon Dec 17, 2012 3:26 pm
Posts: 2
Post 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 1126 times ]
Mon Dec 17, 2012 3:35 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1343
Post 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.


Mon Dec 17, 2012 9:28 pm
Profile
Rookie

Joined: Thu Sep 13, 2012 9:43 am
Posts: 47
Post 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?


Tue Dec 18, 2012 5:02 am
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1343
Post 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.


Tue Dec 18, 2012 5:33 am
Profile
Rookie

Joined: Mon Dec 17, 2012 3:26 pm
Posts: 2
Post 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.


Tue Dec 18, 2012 9:06 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.