📄 draw.m
字号:
%DRAW Draw differential drive robot.% DRAW(R,IDS,COLOR) draws the differential drive robot R into% the current figure with color COLOR. Enable and disable% display of the identifiers with the flag IDS being 1 or 0.% COLOR is a [r g b]-vector or a Matlab color string such as% 'r' or 'g'.%% DRAW(R,IDS,COLOR,CONTOUR) draws the robot R in color COLOR% as a cross without contour when the flag CONTOUR = 0. %% The robot reference frame is attached to the center of the% wheel base such that the x-axis looks forward.%% H = DRAW(...) returns a column vector of handles to all% graphic objects of the robot drawing. Remember that not all% graphic properties apply to all types of graphic objects.% Use FINDOBJ to find and access the individual objects.%% See also DRAWROBOT.% v.1.0, 12.10.03, Kai Arras, CAS-KTHfunction h = draw(varargin);% ConstantsFSIZE = 0.05;OFFSET = 0.02;held = ishold; hold on;if (nargin == 2) | (nargin == 3), if nargin == 3, r = varargin{1}; ids = varargin{2}; % no ids per default color = varargin{3}; contour = 1; % Use function drawrobot h1 = drawrobot(r.x,color,get(r.robot,'formtype')); end; if nargin == 4; r = varargin{1}; ids = varargin{2}; % no ids per default color = varargin{3}; contour = varargin{4}; if contour, type = get(r.robot,'formtype'); else type = 0; end; % Use function drawrobot h1 = drawrobot(r.x,color,type); end; % Draw robot id if ids, h2 = drawlabel(r.x,int2str(get(r,'id')),FSIZE,OFFSET,color); else h2 = []; end; h = cat(1,h1,h2); % Restore hold status if ~held, hold off; end; else disp('robotdd/draw: Wrong number of input arguments');end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -