Skip to content

Commit

Permalink
Minor doco updates and copyright notice additions/updates
Browse files Browse the repository at this point in the history
  • Loading branch information
petercorke committed Dec 14, 2014
1 parent 79cf304 commit f63ad18
Show file tree
Hide file tree
Showing 51 changed files with 845 additions and 149 deletions.
59 changes: 41 additions & 18 deletions Animate.m
Expand Up @@ -10,6 +10,29 @@
% for i=1:100
% plot(...);
% anim.add();
% end
%
% To convert the image files to a movie you could use a tool like ffmpeg
% % ffmpeg -r 10 -i movie/*.png out.mp4

% Copyright (C) 1993-2014, by Peter I. Corke
%
% This file is part of The Robotics Toolbox for MATLAB (RTB).
%
% RTB is free software: you can redistribute it and/or modify
% it under the terms of the GNU Lesser General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% RTB is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU Lesser General Public License for more details.
%
% You should have received a copy of the GNU Leser General Public License
% along with RTB. If not, see <http://www.gnu.org/licenses/>.
%
% http://www.petercorke.com


classdef Animate < handle
Expand All @@ -20,16 +43,15 @@
end

methods
%ANIMATE.ANIMATE Create an animation class
%
% A = ANIMATE(NAME, OPTIONS) initializes an animation, and creates a folder
% called NAME to hold the individual frames.
%
% Options::
% 'resolution',R Set the resolution of the saved image in pixels per inch
%

function a = Animate(name, res)
%ANIMATE.ANIMATE Create an animation class
%
% A = ANIMATE(NAME, OPTIONS) initializes an animation, and creates a folder
% called NAME to hold the individual frames.
%
% Options::
% 'resolution',R Set the resolution of the saved image in pixels per inch

a.frame = 0;
a.dir = name;
mkdir(name);
Expand All @@ -42,15 +64,16 @@

end

%ANIMATE.ADD Adds current plot to the animation
%
% A.ADD() prints the current figure in PNG format to the animation
% folder with a unique sequential filename.
%
% A.ADD(FIG) as above but prints figure FIG.
%
% See also: print
function add(a, fh)
%ANIMATE.ADD Adds current plot to the animation
%
% A.ADD() adds the current figure in PNG format to the animation
% folder with a unique sequential filename.
%
% A.ADD(FIG) as above but captures the figure FIG.
%
% See also print.

if nargin < 2
fh = gcf;
end
Expand All @@ -66,4 +89,4 @@ function add(a, fh)
function close(a)
end
end
end
end
19 changes: 19 additions & 0 deletions HiddenFigure.m
@@ -1,3 +1,22 @@

% Copyright (C) 1993-2014, by Peter I. Corke
%
% This file is part of The Robotics Toolbox for MATLAB (RTB).
%
% RTB is free software: you can redistribute it and/or modify
% it under the terms of the GNU Lesser General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% RTB is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU Lesser General Public License for more details.
%
% You should have received a copy of the GNU Leser General Public License
% along with RTB. If not, see <http://www.gnu.org/licenses/>.
%
% http://www.petercorke.com
classdef HiddenFigure

properties
Expand Down
19 changes: 19 additions & 0 deletions PGraph.m
Expand Up @@ -69,6 +69,25 @@
% - Nodes and edges cannot be deleted.
% - Support for edge direction is rudimentary.

% Copyright (C) 1993-2014, by Peter I. Corke
%
% This file is part of The Robotics Toolbox for MATLAB (RTB).
%
% RTB is free software: you can redistribute it and/or modify
% it under the terms of the GNU Lesser General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% RTB is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU Lesser General Public License for more details.
%
% You should have received a copy of the GNU Leser General Public License
% along with RTB. If not, see <http://www.gnu.org/licenses/>.
%
% http://www.petercorke.com

% Peter Corke 8/2009.

% TODO:
Expand Down
19 changes: 19 additions & 0 deletions Plucker.m
Expand Up @@ -15,6 +15,25 @@
% - This is reference class object
% - Link objects can be used in vectors and arrays

% Copyright (C) 1993-2014, by Peter I. Corke
%
% This file is part of The Robotics Toolbox for MATLAB (RTB).
%
% RTB is free software: you can redistribute it and/or modify
% it under the terms of the GNU Lesser General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% RTB is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU Lesser General Public License for more details.
%
% You should have received a copy of the GNU Leser General Public License
% along with RTB. If not, see <http://www.gnu.org/licenses/>.
%
% http://www.petercorke.com

classdef Plucker < handle

properties
Expand Down
19 changes: 19 additions & 0 deletions Polygon.m
Expand Up @@ -35,6 +35,25 @@
% and require a licence. However the author does not respond to email regarding
% the licence, so use with care, and modify with acknowledgement.

% Copyright (C) 1993-2014, by Peter I. Corke
%
% This file is part of The Robotics Toolbox for MATLAB (RTB).
%
% RTB is free software: you can redistribute it and/or modify
% it under the terms of the GNU Lesser General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% RTB is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU Lesser General Public License for more details.
%
% You should have received a copy of the GNU Leser General Public License
% along with RTB. If not, see <http://www.gnu.org/licenses/>.
%
% http://www.petercorke.com

% TODO
% split the code in two. Simple polygon functions in Polgon class, subclass with
% Pankratov code to Polygon2.
Expand Down
19 changes: 19 additions & 0 deletions about.m
Expand Up @@ -6,6 +6,25 @@
% ABOUT X as above but this is the command rather than functional form
%
% See also WHOS.

% Copyright (C) 1993-2014, by Peter I. Corke
%
% This file is part of The Robotics Toolbox for MATLAB (RTB).
%
% RTB is free software: you can redistribute it and/or modify
% it under the terms of the GNU Lesser General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% RTB is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU Lesser General Public License for more details.
%
% You should have received a copy of the GNU Leser General Public License
% along with RTB. If not, see <http://www.gnu.org/licenses/>.
%
% http://www.petercorke.com
function about(var)

if isstr(var)
Expand Down
19 changes: 19 additions & 0 deletions angdiff.m
Expand Up @@ -9,6 +9,25 @@
%
% Return the equivalent angle in the interval [-pi pi).

% Copyright (C) 1993-2014, by Peter I. Corke
%
% This file is part of The Robotics Toolbox for MATLAB (RTB).
%
% RTB is free software: you can redistribute it and/or modify
% it under the terms of the GNU Lesser General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% RTB is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU Lesser General Public License for more details.
%
% You should have received a copy of the GNU Leser General Public License
% along with RTB. If not, see <http://www.gnu.org/licenses/>.
%
% http://www.petercorke.com

function d = angdiff(th1, th2)

if nargin < 2
Expand Down
13 changes: 8 additions & 5 deletions bresenham.m
Expand Up @@ -10,22 +10,25 @@



% Copyright (C) 1993-2011, by Peter I. Corke

% Copyright (C) 1993-2014, by Peter I. Corke
%
% This file is part of The Machine Vision Toolbox for Matlab (MVTB).
% This file is part of The Robotics Toolbox for MATLAB (RTB).
%
% MVTB is free software: you can redistribute it and/or modify
% RTB is free software: you can redistribute it and/or modify
% it under the terms of the GNU Lesser General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% MVTB is distributed in the hope that it will be useful,
% RTB is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU Lesser General Public License for more details.
%
% You should have received a copy of the GNU Leser General Public License
% along with MVTB. If not, see <http://www.gnu.org/licenses/>.
% along with RTB. If not, see <http://www.gnu.org/licenses/>.
%
% http://www.petercorke.com

function p = bresenham(x1, y1, x2, y2)

Expand Down
52 changes: 21 additions & 31 deletions ccodefunctionstring.m
Expand Up @@ -4,47 +4,37 @@
% representing a C-code implementation of a symbolic expression SYMEXPR.
% The C-code implementation has a signature of the form:
%
% void funname(double[][n_o] out, const double in1, const double* in2, const double[][n_i] in3);
% void funname(double[][n_o] out, const double in1,
% const double* in2, const double[][n_i] in3);
%
% depending on the number of inputs to the function as well as the
% dimensionality of the inputs (n_i) and the output (n_o).
% The whole C-code implementation is returned in FUNSTR, while HDRSTR
% contains just the signature ending with a semi-colon (for the use in
% header files).
%
% The argumentlist ARGLIST may contain the following property-value pairs
% PROPERTY, VALUE
% - 'funname', 'name_string'
% 'name_string' is the actual identifier of the obtained C-function. If
% this optional argument is omitted, the variable name of the first input
% argument is used, if possible.
%
% - 'output', 'output_name'
% Defines the identifier of the output variable in the C-function.
%
% - 'vars', {symVar1, symVar2,...}
% The inputs to the C-code function must be defined as a cell array. The
% elements of this cell array contain the symbolic variables required to
% compute the output. The elements may be scalars, vectors or matrices
% symbolic variables. The C-function prototype will be composed accoringly
% as exemplified above.
%
% - 'flag', true or false (default)
% Specifies if only the function signature shall be generated:
% false: generate complete function string including implementation
% body.
% true: generate function signature only.
% Options::
% 'funname',name Specify the name of the generated C-function. If
% this optional argument is omitted, the variable name
% of the first input argument is used, if possible.
% 'output',outVar Defines the identifier of the output variable in the C-function.
% 'vars',varCells The inputs to the C-code function must be defined as a cell array. The
% elements of this cell array contain the symbolic variables required to
% compute the output. The elements may be scalars, vectors or matrices
% symbolic variables. The C-function prototype will be composed accoringly
% as exemplified above.
% 'flag',sig Specifies if function signature only is generated, default (false).
%
% Example::
% % Create symbolic variables
% syms q1 q2 q3
% % Create symbolic variables
% syms q1 q2 q3
%
% Q = [q1 q2 q3];
% % Create symbolic expression
% myrot = rotz(q3)*roty(q2)*rotx(q1)
% Q = [q1 q2 q3];
% % Create symbolic expression
% myrot = rotz(q3)*roty(q2)*rotx(q1)
%
% % Generate C-function string
% [funstr, hdrstr] = ccodefunctionstring(myrot,'output','foo','vars',{Q},'funname','rotate_xyz')
% % Generate C-function string
% [funstr, hdrstr] = ccodefunctionstring(myrot,'output','foo','vars',{Q},'funname','rotate_xyz')
%
% Notes::
% - The function wraps around the built-in Matlab function 'ccode'. It does
Expand Down Expand Up @@ -242,4 +232,4 @@
funstr = sprintf('%s\n%s',...
funstr,sprintf('%s', '}') );
funstr = sprintf('%s\n%s',...
funstr,sprintf('%s', ' ') ); % empty line
funstr,sprintf('%s', ' ') ); % empty line
19 changes: 19 additions & 0 deletions circle.m
Expand Up @@ -11,6 +11,25 @@
%
% Options::
% 'n',N Specify the number of points (default 50)

% Copyright (C) 1993-2014, by Peter I. Corke
%
% This file is part of The Robotics Toolbox for MATLAB (RTB).
%
% RTB is free software: you can redistribute it and/or modify
% it under the terms of the GNU Lesser General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% RTB is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU Lesser General Public License for more details.
%
% You should have received a copy of the GNU Leser General Public License
% along with RTB. If not, see <http://www.gnu.org/licenses/>.
%
% http://www.petercorke.com
function out = circle(centre, rad, varargin)

opt.n = 50;
Expand Down
19 changes: 19 additions & 0 deletions colnorm.m
Expand Up @@ -2,6 +2,25 @@
%
% CN = COLNORM(A) is an Mx1 vector of the normals of each column of the
% matrix A which is NxM.

% Copyright (C) 1993-2014, by Peter I. Corke
%
% This file is part of The Robotics Toolbox for MATLAB (RTB).
%
% RTB is free software: you can redistribute it and/or modify
% it under the terms of the GNU Lesser General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% RTB is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU Lesser General Public License for more details.
%
% You should have received a copy of the GNU Leser General Public License
% along with RTB. If not, see <http://www.gnu.org/licenses/>.
%
% http://www.petercorke.com
function n = colnorm(a)

n = sqrt(sum(a.^2));

0 comments on commit f63ad18

Please sign in to comment.