Using Infrared to do the parallel parking.
SolEmo
Posts: 15
Pls help me!! I really needed your help on this. Cos i try to figure it out for a long time but i could not find the solutions to it. Pls help me!! I have to done it within 2 weeks.
Comments
Welcome to the forums.
A couple of questions:
What IR Sensor are you using?
What microprocessor are you using?
This would probably better done with ultrasonic sensors. They would have to be waterproof if it is a vehicle application.
I second the use of ultrasonic. possibly even laser range finder, but could be bad if the objects you are ranging are reflective...
as an alternative for prototyping you could use an XBox kinect and the freenect drivers with python/java. this would require a laptop to be present at all times, but those are some awesome sensors!!
For the record, the show's host, Joe Grant is actually a member on the Parallax Forums, and has designed several products that Parallax sells, such as speech synthisis, the new laser rangefinder, RFID module, etc.
Hope this helps!
-John
Do you have a schematic and/or picture of your circuit/setup?
When you post your code, use code tags to preserve the formatting. Here's a link to a tutorial on how to use code tags.
Okay, I'm just going to give you some friendly advice to start off with (I learnt it the same way you are), whenever asking for help, try and provide the people with as much information as possible, this information might include:
1) Robot Base
2) Theory of operation
3) Possible schematics, or good explination of electronics
4) Code (using the "code" tags, or using pastebin.com/github (or equivalent) link)
5) Any other information you have
6) A good context always help us understand where you're coming from
7) List of parts in use (kind of comes under the header of 3)
But, anyway, on to the code!
I'll be honest, I don't know much about the SumoBot, nor have I read it's manual, but that's where I'd start, take a flip through, make good use of the index and the contents, look for stuff to do with IR manuvering. If you want some more specific stuff, you can look in the BoeBot handbook:
http://www.parallax.com/Portals/0/Downloads/docs/books/edu/Roboticsv3_0.pdf
You'll probably find what you are after in chapter 7 (page 221). I'd take a read through of that, understand how to control IR sensors. A good excersize to test your knowledge could be trying to set up a small demo of where it gets the Infrared readings, and then dumps it to serial, and see if it works right.
After you understand that, then you can move onto coding the parallel parking, I don't quite know what's involved in that, but let's assume the layout of the cars/robots are somewhat like what's demonstrated on this webpage:
http://www.wikihow.com/Parallel-Park
So, for this, I'd have a sensor facing to the right of the robot, at the back, and the same thing, at the front, so you have 2 right facing sensors, one at the front, one at the back. Then I would have another 2 sensors, one facing forwards, and one facing backwards. Then to park I would have some logic simiar to this:
10 Go forwards until the back right sensor detects a Car
20 Keep going forwards till it no longer detects the car //At this point, the robot should have passed the first car, located in the upper right hand side of the picture on that webpage
30 Drive forwards a little more, until the front right sensor detects another car
40 Then move backwards in such a way as to move into the car space...
I know these instructions are somewhat sparce, but it's up to you to figure out the rest. Although I've provided the above information, it's by no means the most efficient way of doing it.
If you don't have the paper copy of the SumoBot manual, it can be found here:
http://www.parallax.com/Portals/0/Downloads/docs/prod/sic/AppliedSumo-v1.0.pdf
On a finishing note, on forums like this, and places like stack overflow, it's generally accepted that we don't "do the code for you", I'm not sure if you were asking to do that or not, but ultimatly, it's an assignment given to you by your teachers, so it's up to you to solve it. We can give a helping hand, and nudge you in the right direction, but we can't solve your problems for you. Lastly, often it's a good idea to do some work on something first, and then come to the forums after you've nutted over it for ours. If you come on before you've even tried, not that I'm saying you have, and ask for a solution, then you may get looked down upon. If you've done a fair bit of work, but you aren't getting anywhere, then it's time for you to come on the forums, present what you've done, say what you've tried, what's worked, what's not, and then let people help you.
Anyway, all in all I hope this helps you!
-John