From ebd6fb96d86ab42cd8808319dedbb516e1afd82a Mon Sep 17 00:00:00 2001 From: Viorela Ila Date: Sat, 24 Oct 2009 14:06:17 +0000 Subject: [PATCH] create a map and trajectory (not rand) --- matlab/create_landmarks.m | 16 ++++++++++++++++ matlab/walk.m | 20 ++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 matlab/create_landmarks.m create mode 100644 matlab/walk.m diff --git a/matlab/create_landmarks.m b/matlab/create_landmarks.m new file mode 100644 index 000000000..e19d4d5af --- /dev/null +++ b/matlab/create_landmarks.m @@ -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 diff --git a/matlab/walk.m b/matlab/walk.m new file mode 100644 index 000000000..0fab6f3a3 --- /dev/null +++ b/matlab/walk.m @@ -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 + + +