You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In 'rov_simulation' Simulink, when I click the run button, it reports an error.
“Error evaluating 'InitFcn' callback for block_diagram 'ROV_Simulation'. Callback string is:
end
x_tet = x_tet + xi;
P10 = [xi yi zi]';
P9 = [x_tet(10) yi z_tet(10)]';
P8 = [x_tet(9) yi z_tet(9)]';
P7 = [x_tet(8) yi z_tet(8)]';
P6 = [x_tet(7) yi z_tet(7)]';
P5 = [(x_tet(6)) yi z_tet(6)]';
P4 = [x_tet(5) yi z_tet(5)]';
P3 = [x_tet(4) yi z_tet(4)]';
P2 = [x_tet(3) yi z_tet(3)]';
P1 = [x_tet(2) yi z_tet(2)]';
P0 = [xi yi 0]';
Reason: Cannot modify the contents of the Subsystem Reference block 'ROV_Simulation/External Forces' from within callbacks of the model 'ROV_Simulation'. To modify the contents, please use a self-modifying system encapsulation on the Subsystem Reference module.”
The text was updated successfully, but these errors were encountered:
In 'rov_simulation' Simulink, when I click the run button, it reports an error.
“Error evaluating 'InitFcn' callback for block_diagram 'ROV_Simulation'. Callback string is:
load('Simulation_busses.mat');
%Load simulator preferences
load("simparam.mat");
%Load Thruster settings
load("TAM.mat");
load("thrusterLimit.mat");
%Load External forces
load("External_forces.mat");
%Load Reference Case study
load("Reference_trajectory_case_study.mat");
if(not(isMATLABReleaseOlderThan("R2021b")))
set_param('ROV_Simulation/External Forces/Tether', 'commented', double(not(Sim_param.extTetUse)))
set_param('ROV_Simulation/External Forces/Manual disturbance', 'commented', double(not(Sim_param.extManUse)))
end
%Load sensors
load("Dependencies\Workspaces\Sensors.mat");
noise = NoiseSelection();
%Load Initial Conditions
load("InitCond.mat");
nu_Init = [nu_IC.u nu_IC.v nu_IC.w nu_IC.p nu_IC.q nu_IC.r];
eta_Init = [eta_IC.N eta_IC.E eta_IC.D eta_IC.phi eta_IC.theta eta_IC.psi];
% Load Physical parameters:
if(get_param('ROV_Simulation/Equation of Motion', 'use_app_parameters') == "on")
Env = LoadEnvironment(Sim_param.Env);
end
% Load robot chosen in "Equation of Motion" block:
if(get_param('ROV_Simulation/Equation of Motion', 'use_app_parameters') == "on")
Robot = LoadRobotParameters(Sim_param.Robot);
else
ROV_Constants;
Robot = ROV_Struct2Bus(ROV);
end
% Pos Rov
xi = eta_Init(1);
yi = eta_Init(2);
zi = eta_Init(3);
knots = 11;
len_tet = 35;
ln_tet = len_tet / (knots - 1);
z_tet_i = 0;
z1 = zi / 2 - ln_tet;
len_1 = len_tet / 2 - ln_tet;
x_tet = zeros(knots, 1);
z_tet = zeros(knots, 1);
if zi == len_tet
z_tet = linspace(0, zi, knots)';
else
x1 = sqrt(len_1^2 - z1^2);
a1 = (z1 - z_tet_i) / (x1 - 0);
x_inc = x1 / ((knots - 1) / 2 - 1);
end
x_tet = x_tet + xi;
P10 = [xi yi zi]';
P9 = [x_tet(10) yi z_tet(10)]';
P8 = [x_tet(9) yi z_tet(9)]';
P7 = [x_tet(8) yi z_tet(8)]';
P6 = [x_tet(7) yi z_tet(7)]';
P5 = [(x_tet(6)) yi z_tet(6)]';
P4 = [x_tet(5) yi z_tet(5)]';
P3 = [x_tet(4) yi z_tet(4)]';
P2 = [x_tet(3) yi z_tet(3)]';
P1 = [x_tet(2) yi z_tet(2)]';
P0 = [xi yi 0]';
Reason: Cannot modify the contents of the Subsystem Reference block 'ROV_Simulation/External Forces' from within callbacks of the model 'ROV_Simulation'. To modify the contents, please use a self-modifying system encapsulation on the Subsystem Reference module.”
The text was updated successfully, but these errors were encountered: