Project

General

Profile

Statistics
| Revision:

root / branches / 16299_s10 / matlab / visualizeRobots.m @ 1794

History | View | Annotate | Download (536 Bytes)

1
function [mov] = visualizeRobots(f,n,Xs,Ys,Thetas,idx,color,makeMovie,mov,winsize)
2

    
3
clf;
4
axis([-10 10 -10 10])
5
axis manual
6
set( gca,'nextplot','add' );
7
for j = 1:n
8
    h = plot_arrow( Xs(j,idx),Ys(j,idx),Xs(j,idx)+cos(Thetas(j,idx)),Ys(j,idx)+sin(Thetas(j,idx)),...
9
        'color',color(j,:),'facecolor',color(j,:),'edgecolor',color(j,:) );
10
    set( h,'linewidth',2 );
11
end
12
hold off;
13

    
14
if makeMovie == true
15
    if idx < 3 %so we don't see giant arrows
16
        clf
17
    end
18
    mov(:,idx) = getframe(f,winsize);
19
else
20
    mov = [];
21
end
22

    
23
end