INTRODUCTION Overview Download and Install Quick Start Documentation Publications NONFRAMEWORK CODE Driver Interfaces Drivers Libraries Utilities FRAMEWORK CODE Interfaces Components Libraries Utilities Full Software Listings DEVELOPER Tutorials Examples Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
Laser2d
|
A hardware abstraction component for scanning laser range-finders.
This component dynamically loads an implementation of a Hydro hardware interface hydrointerfaces::LaserScanner2d. You can also load your own implementation as long as the shared library is in the path. See Hydro documentation for the list of available drivers.
This component encapsulates a SICK Laser Range-Finder (see How does the Sick Laser work? ). It can run either as a stand-alone component or an IceBox Service.
Laser2d.Config.DriverLib
(string)Laser Settings
Laser2d.Config.MinRange
(double) [m]Laser2d.Config.MaxRange
(double) [m]Laser2d.Config.FieldOfView
(double) [deg]Laser2d.Config.StartAngle
(double) [deg]Laser2d.Config.NumberOfSamples
(int)Geometry
Laser2d.Config.Offset
(Frame3d) [m, deg]Laser2d.Config.AllowRollCompensation
(bool)Offset
to 180.0 and set AllowRollCompensation=1
. As a result, the laser will appear to be mounted normally (top-side-up) to all clients.Laser2d.Config.Size
(Size3d) [m,m,m]An example configuration file is installed into [ORCA-INSTALL-DIR]/share/orca/cfg/ directory.
For developers: the code conforms to the basic approach described in the notes on Suggestions on the Internal Component Structure.
Note: This article is adapted from a posting by Brian Gerkey to the Player/Stage users mailing list on 2004-07-22.
The mirror in the laser rotates at 75 Hz, so that's its "natural" frequency. It can only sample once per degree, which means the laser can generate a 180-degree scan, with resolution of 1 degree, every 1/75th of a second. If you want 0.5 degree resolution, the laser actually takes two scans at 1 degree resolution, with the second scan offset by 0.5 degrees, then interlaces them to produce a single scan with 0.5 degree resolution. This, of course, requires 1/37.5 seconds. If you want 0.25 degree resolution, this interlacing requires 4 scans, which takes 1/18.75 seconds. This mode is further complicated by the fact that there's a limit of 401 readings per scan, so if you want 0.25 degree resolution, you also have to reduce the angular aperture to <= 100 degrees.
So that's how fast the laser can generate scans. How fast can it shove them down the serial line? Much slower than you might think. A 180-degree scan, at 1-degree resolution, is 180 readings, at 2 bytes per reading. That's 360 bytes. Assuming a perfect 38.4kbps line with zero overhead, you can send 360-byte packets at about 13.3Hz (remember that the small "b" in "kbps" means *bits*, not *bytes*):
38400 bps / 8 / 360 = 13.3 packets/sec
In practice, you see a data rate of between 10Hz and 12Hz, depending on the quality of the serial cable. If you want 0.5 degree resolution, then each scan is doubled in size, to around 720 bytes. The data rate is correspondingly halved, so these packets can theoretically be sent over a 38.4kbps line at 6.67Hz. In practice, you see a rate of around 5Hz.
Now, if you have a 500Kbps RS422 line (e.g., using a USB-serial converter), then the serial line is no longer the rate-limiting component. You can get data as fast as the laser generates it. So, in 1-degree mode, you'll get scans at 75Hz. In 0.5-degree mode, you'll get them 37.5Hz. And so on.
Only the fake driver will build for Windows.
Alex Brooks, Tobias Kaupp, Alex Makarenko
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)