Closed GoogleCodeExporter closed 9 years ago
I have tested and found that this only happens when connected to the brick with
USB...this is a very uncommon occurrence because the connection method is
abstracted
away to the heart of the library. Therefore, it was not caught in testing (not
that
there is any testing before "stable" releases).
It appears that I have to do another bugfix rev, too bad.
Original comment by marcus@wanners.net
on 5 Jun 2010 at 12:25
Original comment by marcus@wanners.net
on 5 Jun 2010 at 12:26
This should be fixed in v1.1.2, please test it.
Original comment by marcus@wanners.net
on 8 Jun 2010 at 12:18
I've just looked at the fix you applied with r125. It seems you added a
"static" pause of 5ms every time the US sensor is polled. I just wanted to note:
Extended tests, as described in the mentioned link here
http://forums.nxtasy.org/index.php?showtopic=4153, showed that you should limit
the US polling rate to 50Hz, i.e. make sure the US sensor is not polled more
often than once every 20ms. Using a pause of 5ms is probably too low.
The other problem: This static pause causes a performance penalty for "regular"
uses where the US sensor is not polled inside a loop. Every "regulard" single
reading will be 5ms (or 20ms, if you add the safe value) slower. This is
especially annoying with Bluetooth connections, where you need every ms.
My suggestion: Record the last time for each port when the US sensor was
polled, and only wait if the port on the same sensor is polled again within
less than 20ms. A code example for this approach in MATLAB can be found here:
http://www.mindstorms.rwth-aachen.de/trac/browser/tags/version-4.03/RWTHMindstor
msNXT/GetUltrasonic.m#L95
I hope I shed a bit more light on this issue!
Linus
Original comment by linus.at...@gmx.de
on 22 Jun 2010 at 11:29
Ok, I have fixed the issue in the trunk in a much better way, the one you
suggested. It has the added advantage of not slowing down the already-sluggish
bluetooth connection.
Original comment by marcus@wanners.net
on 23 Jun 2010 at 2:17
Original comment by marcus@wanners.net
on 20 Aug 2010 at 2:00
Original issue reported on code.google.com by
Tully.Foote
on 4 Jun 2010 at 11:59Attachments: