create a map and trajectory (not rand)
parent
563abc2b3f
commit
ebd6fb96d8
|
@ -0,0 +1,16 @@
|
|||
% Christian Potthast
|
||||
% Create a map with random landmarks
|
||||
|
||||
function map = create_random_landmarks(visibilityTh, mappingArea, steps)
|
||||
map=[];
|
||||
points1=1:visibilityTh:mappingArea(1);
|
||||
points2=1:visibilityTh:mappingArea(2);
|
||||
for i=1:size(points1,2)
|
||||
map=[map,[points1(1,i)-steps;points2(1,i)],[points1(1,i);points2(1,i)-steps]];
|
||||
end
|
||||
|
||||
% for i=1:size(points1,2)
|
||||
% for j=1:size(points2,2)
|
||||
% map=[map,[points1(1,i);points2(1,j)]];
|
||||
% end
|
||||
% end
|
|
@ -0,0 +1,20 @@
|
|||
% Christian Potthast
|
||||
% random walk from a robot
|
||||
|
||||
function pose = walk(initial, velocity, steps)
|
||||
|
||||
pose(:,1) = initial;
|
||||
bearing = 0.7854; % 45?
|
||||
|
||||
|
||||
for step = 2:steps
|
||||
|
||||
%bearing = bearing + 0.05;
|
||||
|
||||
pose(1,step) = pose(1,step-1) + sin(bearing) * velocity;
|
||||
pose(2,step) = pose(2,step-1) + cos(bearing) * velocity;
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue