Lidar
Contents
Hardware
Scanse Sweep is a portable, rotating, horizontal-plane lidar unit. It has a maximum specified range of 40 meters and works best at ranges greater than 0.5 meter. Range data precision is 1 centimeter and range values are in centimeters. Angular resolution is user-configurable by adjusting sample rate and motor rotation frequency. Surface variables like reflectivity and environmental variables like strong illumination by sunlight limit measurement signal quality. Signal quality is a number between 0-255, with smaller numbers indicating poorer signal quality. Angle data precision is 0.0625 degrees and angle values are in degrees, expressed as a 16-bit fixed-point number with twelve integer bits and four fractional bits.
Angle bits | Angle decimal (degrees) |
---|---|
...00000001 | 0.0625 |
...00010000 | 1.0 |
...00010001 | 1.0625 |
The Scanse Sweep lidar unit is connected to an Arduino Micro to capture and process range, angle, and signal quality data during a scan.
Software
Software on the Arduino Micro controls the Scanse Sweep. On startup, the setup() procedure resets the lidar, configures scan frequency and motor rotation frequency, waits for the motor to come up to speed, and configures the lidar to begin scanning. The loop() procedure requests the most recent complete scan reading, filters out invalid readings, and processes the signal for transmission to high level.
Filtering
Readings should be rejected if:
- Range is greater than 4000cm or equal to 1cm
- Angle is not within desired scan angles
- Signal quality is above an arbitrary value
Warning: the lidar is always scanning during operation unless the software signals it to stop (not implemented). The Scanse Sweep is a class 1 laser device and designed to be eye-safe, but placing the eye directly in the path of the beam or the scan plane should be avoided or prevented.
Signal processing
Signal processing is required to limit bytes sent to HighLevel but still allow HighLevel to reconstruct obstacle data from the scan. At maximum sampling frequency, the lidar unit collects 1000 range readings per second. Some of these reading are filtered out. This results in tens or hundreds of readings during each pass. To reduce data bandwidth, the software uses a "max delta" value to break the scan into segments beginning and ending at points with a change in range greater than the max delta. This discards small changes in range, but detects larger changes in range that indicate obstacles. This balances the need to detect both obstacles and continuous surfaces like walls. A single straight surface is broken into several segments centered on the closest point. If obstacles are placed on front of the surface, the change in range for each obstacle produces one or more segments for each obstacle and one or more segments for each section of straight surface. How accurately this process reconstructs the field of obstacles depends on how many points are filtered out before signal processing: if obstacle data is missing, it will not begin or end a segment.
Scanse Sweep
The Scanse Sweep is a lidar sensor. Its head spins around multiple times per second, and collects information about its lateral surroundings. The spin speed and sampling rate can be changed.
It sends readings over a serial connection, each of which includes the angle, distance, signal strength, and other information.
Blasé Johnson worked on the sweep in the summer of 2017. The following is from his 6/22/17 report.
Basic Sweep Obstacle Detection Algorithm
Goal
To use the readings from the sweep to determine if there is an obstacle present within a given distance in front of the trike, and to stop the trike if this is so. Sweep Operation Rotation and Speed The Sweep rotates counterclockwise. Its rotational speed can be set to any integral value between 0 Hz and 10 Hz (number of full rotations per second).
Sampling Rate
The sweep obtains readings according to a given sample rate. Three distinct sample rates can be used for the Sweep: 500 – 600 Hz 750 – 800 Hz 1000 – 1075 Hz\
Sample Data
Each reading from the Sweep contains these data:
- A byte with sync/error bits, where the sync bit indicates whether the current reading is the first reading since the sensor last made a full rotation, one of the error bits indicates a communication error with the Lidar module, and the rest of the bits are reserved for future uses.
- The azimuth (degree of angle with starting position), transmitted as a 16-bit fixed point number, where the 12 MSBs are the integral part and the 4 LSBs are the fractional part.
- The distance from the nearest obstacle in centimeters, transmitted as a 16-bit integer.
- A value representing the signal strength, transmitted as an unsigned 8-bit integer, where 0 is the lowest strength, and 255 is the highest strength.
- A checksum, which is the remainder of the sum of the six previous bytes divided by 255.
Math
The trike will be expected to stop if an obstacle is detected within a certain distance from the front side of the vehicle, within the horizontal span of the trike. These distances are illustrated in Figure 1 as DISTANCE and WIDTH, respectively. The grey lines in Figure 1 show the distances that will be measured by the Sweep if it detects an obstacle at the line. The formula for this distance is DISTANCE/cos(AZIMUTH) . The range of azimuths for the front side of the trike can be computed from the formula sarcsin(WIDTH/(2*DISTANCE)) and 360-arcsin(WIDTH/(2*DISTANCE)) for the right and left corners, respectively.
Process
Once the Sweep begins taking measurements, check the measurements whose azimuths lie within the boundaries of the front side of the trike. For each measurement within this range, determine if the distance from an obstacle in centimeters is equal to or less than DISTANCE/cos(AZIMUTH) . If so, stop the vehicle until a search of the measurements within the front boundary comes back negative, and a certain amount of time has passed since the last obstacle was detected.W
NEXT > Camera
External Links
-- Main.JohnsonB - 2017-11-07
- Figure 1: Distance from trike to detect obstacle & trike width:
<img src="%PUBURLPATH%/%WEB%/%TOPIC%/ScanseTrike.png" alt="ScanseTrike.png" width="397" height="463" />