Generating a 2D point cloud map

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 个评论

How does the cloud look like?
multi_measure_obstacle.png
single_measure.png
something like that....in the first picture there are multiple measurments overlapped and in the second picture is one measurment.
I think it's possible to make it somehow with linspace and additional errors .
the restriction later is, that the maze just have angles of 90°... maybe this makes it easier.
You have black line and want red points? Is it correct?
111Untitled.png
Ramon
Ramon 2019-9-27
编辑:Ramon 2019-9-27
yes, but it has to be something like a normal distribution...like 68% are on the line and the others are offset to the black line....something like that
Any ideas how to implement it?
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.

请先登录,再进行评论。

更多回答(0 个)

类别

Community Treasure Hunt

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

Start Hunting!

Translated by