Code covered by the BSD License
-
simiam
A MATLAB-based educational bridge between theory and pratice in robotics.
-
GetArg(S, Name, Default)
-
ParseArgs(Args, varargin)
Check input arguments
-
findjobj(container,varargin)
findjobj Find java objects contained within a specified java container or Matlab GUI handle
-
launch()
Copyright (C) 2013 Georgia Tech Research Corporation
-
CellProps
Helper class for GridLayout
-
GridLayout
Main layout-manager class
-
mcodekit.list.dl_list
Copyright (C) 2012 Jean-Pierre de la Croix
-
mcodekit.list.dl_list_iterator
Copyright (C) 2012 Jean-Pierre de la Croix
-
mcodekit.list.dl_list_node
Copyright (C) 2012 Jean-Pierre de la Croix
-
simiam.app.ControlApp
Copyright (C) 2013, Georgia Tech Research Corporation
-
simiam.controller.AOandGTG
Copyright (C) 2013, Georgia Tech Research Corporation
-
simiam.controller.AvoidObstac...
Copyright (C) 2013, Georgia Tech Research Corporation
-
simiam.controller.Controller
CONTROLLER is a template for all user-defined controllers.
-
simiam.controller.FollowWall
Copyright (C) 2013, Georgia Tech Research Corporation
-
simiam.controller.GoToAngle
GOTOANGLE steers the robot towards a angle with a constant velocity using PID
-
simiam.controller.GoToGoal
GOTOGOAL steers the robot towards a goal with a constant velocity using PID
-
simiam.controller.SlidingMode
Copyright (C) 2013, Georgia Tech Research Corporation
-
simiam.controller.Stop
-
simiam.controller.Supervisor
SUPERVISOR switches between controllers and handles their inputs/outputs.
-
simiam.controller.khepera3.K3...
SUPERVISOR switches between controllers and handles their inputs/outputs.
-
simiam.robot.Khepera3
Copyright (C) 2013, Georgia Tech Research Corporation
-
simiam.robot.Robot
Copyright (C) 2013, Georgia Tech Research Corporation
-
simiam.robot.dynamics.Differe...
Copyright (C) 2013, Georgia Tech Research Corporation
-
simiam.robot.dynamics.Dynamics
Copyright (C) 2013, Georgia Tech Research Corporation
-
simiam.robot.sensor.Proximity...
Copyright (C) 2013, Georgia Tech Research Corporation
-
simiam.robot.sensor.WheelEnco...
Copyright (C) 2013, Georgia Tech Research Corporation
-
simiam.simulator.Obstacle
Copyright (C) 2013, Georgia Tech Research Corporation
-
simiam.simulator.Physics
Copyright (C) 2013, Georgia Tech Research Corporation
-
simiam.simulator.Simulator
SIMULATOR is responsible for stepping the program through the simulation.
-
simiam.simulator.World
Copyright (C) 2013, Georgia Tech Research Corporation
-
simiam.ui.AppWindow
Copyright (C) 2013, Georgia Tech Research Corporation
-
simiam.ui.Drawable
Copyright (C) 2013, Georgia Tech Research Corporation
-
simiam.ui.Pose2D
Copyright (C) 2013, Georgia Tech Research Corporation
-
simiam.ui.Surface2D
Copyright (C) 2013, Georgia Tech Research Corporation
-
simiam.util.Plotter
PLOTTER supports plotting data in 2D with a reference signal.
-
View all files
from
Sim.I.am
by Jean-Pierre de la Croix
A MATLAB-based educational bridge between theory and practice in robotics.
|
| ParseArgs(Args, varargin)
|
function varargout = ParseArgs(Args, varargin)
% Check input arguments
assert(nargin >= 2, ...
'Function takes at least two arguments.');
assert(nargout == nargin-1, ...
'Number of output arguments must be equal with the number of input arguments minus 1.');
assert(iscell(Args) && (isempty(Args) || isvector(Args)), ...
'Args must be a cell vector.');
for i = 1:length(varargin)
assert(iscellstr(varargin{i}) && isvector(varargin{i}), ...
'All input arguments except the first one must be cell vectors of strings.');
end
% Convert Args to structure
if numel(Args) == 1
if isstruct(Args{1})
ArgStruct = Args{1};
else
error('If Args has only one element, that element must be a structure.');
end
else
ArgStruct = NameValue2Struct(Args{:});
end
% Make a cell array with all names in varargin
NumNames = sum(cellfun(@length,varargin));
AllNames = cell([1 NumNames]);
k = 0;
for i = 1:length(varargin)
for j = 1:length(varargin{i})
k = k + 1;
AllNames{k} = varargin{i}{j};
end
end
assert(k == NumNames);
% Check if Args contains only arguments with names that are not among those in varargin
ArgNames = fieldnames(ArgStruct);
for i = 1:length(ArgNames)
if ~any(strcmp(ArgNames{i},AllNames))
error('Unknown parameter: ''%s''',ArgNames{i});
end
end
% Create output structures
for i = 1:nargout
ParamStruct = struct();
for j = 1:length(varargin{i})
ParamName = varargin{i}{j};
if isfield(ArgStruct,ParamName)
ParamStruct.(ParamName) = ArgStruct.(ParamName);
else
ParamStruct.(ParamName) = [];
end
end
varargout{i} = ParamStruct;
end
function Struct = NameValue2Struct(varargin)
for n = 2:2:nargin
if iscell(varargin{n})
% Put cell arrays in another cell array so that we don't get a
% structure vector after the conversion
varargin{n} = {varargin{n}};
end
end
Struct = struct(varargin{:});
end
end
|
|
Contact us