removeInvalidData
Description
Examples
Plot Lidar Scan and Remove Invalid Points
Specify lidar data as vectors of ranges and angles. These values include readings outside of the sensors range.
x = linspace(-2,2); ranges = abs((1.5).*x.^2 + 5); ranges(45:55) = 3.5; angles = linspace(-pi/2,pi/2,numel(ranges));
Create a lidar scan by specifying the ranges and angles. Plot all points of the lidar scan.
scan = lidarScan(ranges,angles); plot(scan)
Remove invalid points based on a specified minimum and maximum range.
minRange = 0.1; maxRange = 7; scan2 = removeInvalidData(scan,'RangeLimits',[minRange maxRange]); hold on plot(scan2) legend('All Points','Valid Points')
Input Arguments
scan
— Lidar scan readings
lidarScan
object
Lidar scan readings, specified as a lidarScan
object.
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: ["RangeLimits",[0.05 2]
RangeLimits
— Range reading limits
two-element vector
Range reading limits, specified as a two-element vector,
[minRange maxRange]
, in meters. All range
readings and corresponding angles outside these range limits are
removed
Data Types: single
| double
AngleLimits
— Angle limits
two-element vector
Angle limits, specified as a two-element vector, [minAngle
maxAngle]
in radians. All angles and corresponding range
readings outside these angle limits are removed.
Angles are measured counter-clockwise around the positivez-axis.
Data Types: single
| double
Output Arguments
validScan
— Lidar scan readings
lidarScan
object
Lidar scan readings, specified as a lidarScan
object. All invalid lidar scan
readings are removed.
Version History
Introduced in R2020b
See Also
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)