lopsteel.blogg.se

Occupancy grid mapping matlab code
Occupancy grid mapping matlab code









occupancy grid mapping matlab code

GridXBinSize = round(abs(spatialLimits(1,2) - spatialLimits(1,1)) / gridStep) % The occupancy grid is created by scaling the points from 0m - 5m in % height to the probability values of % Set the occupancy grid size to 100 m with a resolution of 0.2 m Title( 'Point cloud before and after preprocessing') PcViewAxes = pcshowpair(ptCloud, ptCloudProcessed) % Visualize and compare the point cloud before and after preprocessing.įigure( 'Name', 'Processed Point Clouds', 'NumberTitle', 'off') PtCloudProcessed = pointCloud(locationPts) LocationPts(:,3) = locationPts(:,3) + sensorHeight SensorHeight = groundTruthPosesLidar(1).Translation(3)

occupancy grid mapping matlab code

This information can be obtained from the lidar % point cloud % Since we use the Z-values to determine the occupancy in a grid image, % move the point cloud by sensor height so that more points are included to % calculate occupancy % Set the sensor height. PtCloudNonEgo = select(ptCloudClipped,~egoFixed) % Find the indices of the points other than the ego vehicle and create a % point cloud with these pointsĮgoIndices = findNeighborsInRadius(ptCloudClipped,sensorLocation,vehicleRadius) ĮgoFixed = false(ptCloudClipped.Count,1) % Segment and remove ego vehicle % Set location of the sensor and vehicle radius PtCloudClipped = select(ptCloudDenoised,indices) Indices = findPointsInROI(ptCloudDenoised,roi) This is done to improve the processing performance % and also to include only the areas of interest % Set the limits to select the point cloud In summary, these are the steps used to calculate the vehicle odometry: This technique is also used in pcregistercorr. By successively composing these transformations, you transform each point cloud back to the reference frame of the first point cloud. Use a phase correlation registration algorithm to calculate the 2-D relative transformation between two images. Hence, convert the point clouds into 2-D occupancy grid images by projecting the points onto the ground plane. To build a 2-D occupancy grid map, 2-D pose estimations are sufficient. This approach of incrementally estimating the trajectory is called odometry. From these poses, the estimated trajectory of the vehicle is determined. In order to build a map using the collected point clouds, the relative poses between the successive point clouds need to be estimated. GroundTruthPosesLidar = helperGetLidarGroundTruth(simOut) Vehicle Odometry Using Phase Correlation Algorithm % Extract ground truth for the lidar data as an array of rigid3d objects

occupancy grid mapping matlab code

PtCloudArr = helperGetPointClouds(simOut)

occupancy grid mapping matlab code

Error( "Unreal Engine Simulation is supported only on Microsoft" + char(174) + " Windows" + char(174) + ".")











Occupancy grid mapping matlab code