Generating a 2D point cloud map

11 ビュー (過去 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 Center および File ExchangePoint Cloud Processing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by