Main Content


Create map of LOAM feature points for map building

Since R2022b


    The pcmaploam object creates a map of lidar odometry and mapping (LOAM) feature points. LOAM feature points represent edge points and surface points that are detected using the LOAM algorithm. Use this object for incremental map building workflows. Use the findPose function to find the optimized absolute pose that aligns the points to the map, and use the addPoints function to add points to the map.




    loamMap = pcmaploam(voxelSize) returns an empty LOAM map with the voxel size set by the voxelSize argument.

    loamMap = pcmaploam(voxelSize,mapSize) also specifies the size of the map along each axis (x, y, and z). By default, using the addPoints function to add points outside the existing LOAM map expands the map. If you specify the mapSize argument, the pcmaploam object instead discards points outside the specified boundaries. The mapSize argument sets the MapSize property.

    Use this syntax to improve the speed of the findPose and addPoints functions when mapping large areas.


    expand all

    Points in the LOAM map, specified as an M-by-3 matrix, where M is the number of points. Each row specifies the [x y z] coordinates of a point.

    Voxel size to use for downsampling map points, specified as a positive scalar.

    Size of the LOAM map, specified as a three-element vector of the form [dx dy dz].

    Range of the LOAM map along the x-axis, specified as a two-element vector of the form [xmin xmax].

    Range of the LOAM map along the y-axis, specified as a two-element vector of the form [ymin ymax].

    Range of LOAM map along the z-axis, specified as a two-element vector of the form [zmin zmax].

    Object Functions

    addPointsAdd LOAM points to map
    findPoseFind absolute pose of points in map
    showVisualize LOAM map


    collapse all

    Create a map to store LOAM feature points.

    voxelSize = 0.1;
    loamMap = pcmaploam(voxelSize);

    Create a velodyneFileReader object to read point cloud data from a PCAP file.

    veloReader = velodyneFileReader("lidarData_ConstructionRoad.pcap","HDL32E");

    Read the first point cloud from the file into the workspace.

    ptCloud1 = readFrame(veloReader,1);

    Detect LOAM feature points in the point cloud.

    points1 = detectLOAMFeatures(ptCloud1);

    Downsample the less planar surface points to improve registration speed.

    gridStep = 1;
    points1 = downsampleLessPlanar(points1,gridStep);

    Add the LOAM points of the first point cloud to the map.

    absPose = rigidtform3d;

    Read the fifth point cloud, and detect the LOAM feature points in it.

    ptCloud2 = readFrame(veloReader,5);
    points2 = detectLOAMFeatures(ptCloud2);

    Downsample the less planar surface points.

    points2 = downsampleLessPlanar(points2,gridStep);

    Get a relative pose estimate by using the pcregisterloam function.

    relPose = pcregisterloam(points2,points1);

    Find the absolute pose of the points from the fifth point cloud in the map.

    absPose = findPose(loamMap,points2,relPose);

    Add the LOAM points from the fifth point cloud to the map.


    Visualize the map.


    Figure contains an axes object. The axes object contains 2 objects of type scatter.

    Extended Capabilities

    Version History

    Introduced in R2022b