Generating a 2D point cloud map

조회 수: 10 (최근 30일)
Ramon
Ramon 2019년 9월 25일
편집: Ramon 2019년 9월 29일
Hello there
I have to generate point clouds which represents a room or a floor, as example. Also it should be able to add an error to the generator of the point cloud to make it more real (like a noise).
With a small section of the map it should than be possible to find out the location of this small section. Like SLAM without the mapping. Just localisation.
Maybe someone has a solution or some ideas to solve this.
Kind regard
Ramon
  댓글 수: 6
darova
darova 2019년 9월 27일
Any ideas how to implement it?
Ramon
Ramon 2019년 9월 28일
편집: Ramon 2019년 9월 29일
Yes, i made some functions to make lines with errors.
%% Functions
% Function for generating a line out of points with an additional random
% error for one axis
function[v_ret] = calc_v(start,fin,N,error)
dv = (fin-start)/N;
v = linspace(start,fin,N);
if dv == 0
dv = 1;
end
v_ret = v-(-error + (error+error)*rand(1,N))*dv;
end
% Function to concatenate two arrays. Returns concatenated array.
function[arr_x,arr_y] = concator(array_x,extension_x,array_y,extension_y)
arr_x = [array_x extension_x];
arr_y = [array_y extension_y];
end
% Function to add a cos-error
function[arrayWithError] = addCosError(arr,step,err_amp,err_step)
format = size(arr(1:step:end));
len = format(2);
i = linspace(1,err_step,len);
arr(1:step:end) = arr(1:step:end) + err_amp*cos(pi.*i);
arrayWithError = arr;
end
% Function for generate a point line for mapping
function [arr_x,arr_y] = setLine(x_start,x_fin,y_start,y_fin,rand_error,step_to_add_error,err_amp,err_period)
if (x_fin - x_start) > (y_fin - y_start)
N = x_fin - x_start;
else
N = y_fin - y_start;
end
arr_x = addCosError(calc_v(x_start,x_fin,N,rand_error),step_to_add_error,err_amp,err_period);
arr_y = addCosError(calc_v(y_start,y_fin,N,rand_error),step_to_add_error,err_amp,err_period);
end
The result is like this:
An example map without errors.
And the example map with errors.

댓글을 달려면 로그인하십시오.

채택된 답변

Ramon
Ramon 2019년 9월 28일
  댓글 수: 1
darova
darova 2019년 9월 28일
The best solution is the solution made by yourself :)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Point Cloud Processing에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by