Skip to content
Snippets Groups Projects
Commit c14ae924 authored by Marco Luigi Gaibotti's avatar Marco Luigi Gaibotti
Browse files

[msa-refactoring][classes] Updated LoadConfig, added Environment

parent 92f25349
No related branches found
No related tags found
1 merge request!2Final data structure
......@@ -14,7 +14,8 @@ classdef Component < Config
varsIn = 0
end
obj.mission = mission;
if nargin == 0, return; end
%if isempty(mission.name) && nargin > 0, warning('Mission arguments are empty. Returning an uninitialized component...'); end
if isempty(mission.name), return; end
if ~isstruct(varsIn) && varsIn == 0
obj.loadConfig();
else
......
......@@ -27,6 +27,20 @@ classdef Environment < Component
motor Motor
end
methods
function obj = Environment(mission, motor, varIn)
arguments(Input)
mission Mission = Mission()
motor Motor = Motor()
varIn = 0
end
if nargin > 0 && nargin < 2, error('Too few arguments. Type help for more info'); end
if nargin > 3, error('Too many arguments.'); end
obj@Component(mission, varIn);
obj.motor = motor;
end
end
methods
function g0 = get.g0(obj)
g0 = gravitywgs84(obj.z0, obj.lat0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment