create a map and trajectory (not rand)

release/4.3a0
Viorela Ila 2009-10-24 14:06:17 +00:00
parent 563abc2b3f
commit ebd6fb96d8
2 changed files with 36 additions and 0 deletions

16
matlab/create_landmarks.m Normal file
View File

@ -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

20
matlab/walk.m Normal file
View File

@ -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