Subject:
|
RE: Pictures of lego-scanner
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Thu, 21 Jan 1999 11:05:29 GMT
|
Original-From:
|
Simen Svale Skogsrud <simen@mopSTOPSPAM.no>
|
Reply-To:
|
<simen@mop.ANTISPAMno>
|
Viewed:
|
1307 times
|
| |
| |
>
> That's pretty cunning! I see that you use two sets of tracks for each
> side of the bot. Does this mean that you get some slipping on various
> surfaces, hence cluttering the direction vector calculated?
The double sets of tracks are just there to be cool. They do not contribute
much to the functionality of the bot... that aside it has no problem with
slipping, I have it run in a near perfect octagon and it usually end up
pointing the same way as it started.
> Also, did you spend much time calibrating the direction traveled based
> the drive difference? I can imagine that driving one 360° circle and
> noting the difference should suffice?
No, I just made a program that turned the bot until I pressed a
touch-sensor. I did this three or four times pressing the sensor after one
complete revolution, and got the same result every time +/- 1 or 2 counts,
so that was no problem. I had a bigger problem converting degrees to counts
as that implies a certain amount of floating point math and the RCX has no
fpu... I use fractioned integers (i do that for the vector calculations as
well).
The formula for converting from degrees to rotation counts is:
counts := (full_circle_counts/360)*degrees_to_turn;
where full_circle_counts are the number obtained during calibration and
degrees_to_turn are the amount of degrees_to_turn. If you implement this
directly in NQC you end up getting very inaccurate results, so you have to
keep in mind always multiplying first. Better results are obtained by
shifting around on the equation:
counts := (full_circle_counts*degrees_to_turn)/360
This does the trick for this equation, but in other parts of my program
where I use vector calculations I have had great success using fractioned
integers. That is done by doing every intermediate calculation with numbers
that are e.g. multiplied by 100, and the dividing the result by 100 before
using them. If you do that you will have two digits of fractional precision
while calculating. If you do this you must take great care in not
overflowing in any part of your calculations as the RCX will not warn you,
just yield wrong answers. The integers in the RCX are 16 bit signed ones
that is between -32767 and +32768 (just about).
Simen
--
Did you check the web site first?: http://www.crynwr.com/lego-robotics
|
|
Message is in Reply To:
| | Re: Pictures of lego-scanner
|
| (...) side of the bot. Does this mean that you get some slipping on various surfaces, hence cluttering the direction vector calculated? Also, did you spend much time calibrating the direction traveled based the drive difference? I can imagine that (...) (26 years ago, 21-Jan-99, to lugnet.robotics)
|
3 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
Active threads in Robotics
|
|
|
|