![]() |
If I were doing what you asked in your original post (thought about it actually) is put a pot on the optical sensor to give you feedback where it's pointing. Then, if you know that straight ahead is 90 degrees, for example (if you are sweeping from 0 degrees to 180 degrees), you can then get an idea based on the voltage where the container is in relation to your position. Then, as you rotate or move your robot towards the box, rotate the sensor to keep the signal.
Then, as you are moving towards the boxes, keep scanning (only if you lose signal)for the tape to correct the direction. You should close right in on it... |
Quote:
Personally, I'd be more worried about the inherent inacuracies of the the stamp processor. If you based your robot's movements on a calculated distance, you'd likely hit the stack and knock it over or fall short and pick up nothing. |
Trying to use trig functions in BASIC is just a waste of time. We thought about creating our own inverse functions for our fully automated GPS-guided robot, but after research this option turned out to be way too complicated. Stamp simply is too archaic to be used for complicated math formulas. If you reseach, you'll find several threads on the topic. We used a type of dead reckoning for the robot, which was somewhat inaccurate, but successful.
|
In all honesty, the trig functions probably aren't that useful. It is far easier to do a simple lookup/lookdown to get the distance straight from your angle. Or, better yet, to get the motor speed directly from the angle.
|
Quote:
|
Share the wealth
C'mon nwagers.....you know you want to share this code.
|
So, what the majority of you all are saying is that the trig function solution is a waste of time...
i might still write a program for it just because i love math and it would look really cool so i still have a question for anyone who cares: Where is the reflective tape on the boxes?? is it all the way around or is it only on corners?? Thanx for the help!!!:) :confused: |
The reflective tape will be on two opposing corners of the boxes. Have fun doing trig functions in PBASIC, be careful that it doesnt slow the loop down far enough that it causes a run error from missed data!
|
OK, so now i'm a little scared (and running outta time) to do stuff with the sensors .:( However, I am woried about any complex coding causing run time errors. what might happen (our code last year was simple) as a result of using trig or calc in methods (referring to run time) ???
|
ok
ok there is a sin function in pbasic just to let everyone know so calm down read the pbasic manual and if you dont belive me put sin in the coding and you will see no error
fools |
Fady, once again- people are smarter than you. Don't call me a fool. Also, if the loop gets large enough, I think these people are saying that a run time error will occur- not a logic error.
So anyway, I'm still worried about it. I'm willing to sacrrifice 5 seconds of atonamous mode to run through the math, is that enough time to take 4 sensor readings and go through about 7 calculations (not the taylors calc method, just SIN, and angle arithmetic using the 255 rotation thing)??? |
| All times are GMT -5. The time now is 11:57. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi