Skip to content

Commit 48cfaaf

Browse files
committed
v2p16. Compatible with MF-Swift v2312, MATLAB Online compatible.
1 parent b4f8a60 commit 48cfaaf

22 files changed

+77
-9
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<?xml version='1.0' encoding='UTF-8'?>
2-
<Info Type="Basic" GroupUUID="3938fbca-90f5-48cc-8294-fd0c0ecd2fdc" Visible="1" Icon="" File="Scripts_Data/Simscape_Vehicle_Library_Demo_Script.html" Name="Demo Script" />
2+
<Info Type="Basic" GroupUUID="3938fbca-90f5-48cc-8294-fd0c0ecd2fdc" Visible="1" Icon="" File="Scripts_Data/Simscape_Vehicle_Library_Demo_Script_web.m" Name="Demo Script" />
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<?xml version='1.0' encoding='UTF-8'?>
2-
<Info Type="Basic" GroupUUID="3938fbca-90f5-48cc-8294-fd0c0ecd2fdc" Visible="1" Icon="" File="Libraries/sm_car_doc/sm_car_doc_overview.html" Name="Templates" />
2+
<Info Type="Basic" GroupUUID="3938fbca-90f5-48cc-8294-fd0c0ecd2fdc" Visible="1" Icon="" File="Libraries/sm_car_doc/sm_car_doc_overview_web.m" Name="Templates" />
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<?xml version='1.0' encoding='UTF-8'?>
2-
<Info Type="Basic" GroupUUID="3938fbca-90f5-48cc-8294-fd0c0ecd2fdc" Visible="1" Icon="" File="Workflows/Exercises/Overview/Simscape_Vehicle_Templates_Exercises.html" Name="Exercises" />
2+
<Info Type="Basic" GroupUUID="3938fbca-90f5-48cc-8294-fd0c0ecd2fdc" Visible="1" Icon="" File="Workflows/Exercises/Overview/Simscape_Vehicle_Templates_Exercises_web.m" Name="Exercises" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<Info>
3+
<Category UUID="FileClassCategory">
4+
<Label UUID="28727d18-c61e-4ad0-97da-d16cf001687d" />
5+
</Category>
6+
</Info>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<Info />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<Info>
3+
<Category UUID="FileClassCategory">
4+
<Label UUID="28727d18-c61e-4ad0-97da-d16cf001687d" />
5+
</Category>
6+
</Info>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<Info>
3+
<Category UUID="FileClassCategory">
4+
<Label UUID="28727d18-c61e-4ad0-97da-d16cf001687d" />
5+
</Category>
6+
</Info>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<Info>
3+
<Category UUID="FileClassCategory">
4+
<Label UUID="28727d18-c61e-4ad0-97da-d16cf001687d" />
5+
</Category>
6+
</Info>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<Info>
3+
<Category UUID="FileClassCategory">
4+
<Label UUID="28727d18-c61e-4ad0-97da-d16cf001687d" />
5+
</Category>
6+
</Info>

Libraries/Event/Scene/Double_Lane_Change/sm_car_scenedata_double_lane_change.m

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function scene_data = sm_car_scenedata_double_lane_change
22
%% Floor and Grid parameters
3-
% Copyright 2018-2020 The MathWorks, Inc.
3+
% Copyright 2018-2022 The MathWorks, Inc.
44

55
scene_data.Name = 'Double_Lane_Change';
66
scene_data.Dashes.pitch = 7.5; % m
@@ -19,7 +19,13 @@
1919
scene_data.Road.clr = [1 1 1]*0.5; % [R G B]
2020
scene_data.Road.opc = 1; % (0-1)
2121
scene_data.Road.x = 218.4; % m
22-
scene_data.Road.y = -1.2; % m
22+
23+
% Adjustments due to Unreal scene change in R2022b
24+
if(verLessThan('matlab','9.13'))
25+
scene_data.Road.y = -1.2; % m
26+
else
27+
scene_data.Road.y = -1.2-2.5; % m
28+
end
2329
scene_data.Road.z = 0; % m
2430
scene_data.Road.roll = 0*pi/180; % rad
2531
scene_data.Road.pitch = 0*pi/180; % rad

Libraries/Event/Scene/Double_Lane_Change/sm_car_trajectory_double_lane_change.m

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
function sm_car_trajectory_double_lane_change
22
% Function to construct double-lane change maneuver
3-
% Copyright 2018-2021 The MathWorks, Inc.
3+
% Copyright 2018-2022 The MathWorks, Inc.
44

55
cd(fileparts(which(mfilename)))
66
% Parameters for trajectory
7-
maneuver_lateral_offset = -3.35; % m
7+
8+
% Adjustments due to Unreal scene change in R2022b
9+
if(verLessThan('matlab','9.13'))
10+
maneuver_lateral_offset = -3.35; % m
11+
else
12+
maneuver_lateral_offset = -3.35-2.5; % m
13+
end
814
cone_set_lat_separation = 4.2; % m
915

1016
% Longitudinal gate locations (m)
-81.1 KB
Binary file not shown.

Libraries/Event/sm_car_gen_init_database.m

+10-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
% Define vehicle-level initial conditions for maneuvers
33
% Vehicle position, orientation, initial speed, initial wheel speed
44
%
5-
% Copyright 2019-2020 The MathWorks, Inc.
5+
% Copyright 2019-2022 The MathWorks, Inc.
66

77
%% Vehicle-level data
88
% Vehicle Name #Axles Wheel Radius (m) Init Z-Offset (m)
@@ -184,10 +184,18 @@
184184
%% Scene Double Lane Change, Slow Start
185185
InitSet.Double_Lane_Change.Type = 'Double_Lane_Change';
186186
InitSet.Double_Lane_Change.Instance = '';
187+
188+
% Adjustments due to Unreal scene change in R2022b
189+
if(verLessThan('matlab','9.13'))
190+
sChassisY = -3.35;
191+
else
192+
sChassisY = -3.35-2.5;
193+
end
194+
187195
InitSet.Double_Lane_Change.Data = {...
188196
'aChassis','rad', 0, 0, 0;
189197
'vChassis','m/s', 2.5, 0, 0;
190-
'sChassis','m', 5, -3.35, 0};
198+
'sChassis','m', 5, sChassisY, 0};
191199

192200
%% Scene Double Lane Change, Slow Start
193201
InitSet.Double_Lane_Change_ISO3888.Type = 'Double_Lane_Change_ISO3888';
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web('sm_car_doc_overview.html')

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ adjust the libraries so that variant can be selected.
3030
3. Modify parameter values in the "Vehicle" data structure in the MATLAB workspace.
3131

3232
### **Release History**
33+
**v2.16 -- April 2024**
34+
1. Compatible with MF-Swift v2312
35+
2. Adjusted double-lane change to match Unreal scene (R2022b and higher)
36+
3. Made project shortcuts compatible with MATLAB Online
37+
4. Fixed capitalization error in sm_car_database_Maneuver.xlsx (...Hockenheim_F_ --> Hockenheim_f_)
38+
39+
**v2.15 -- March 2024**
40+
1. Compatible with R2024a. Updated scripts to run with Fast Restart
41+
3342
**v2.15 -- September 2023**
3443
1. Mass and inertia of driver and passengers are adjustable
3544
2. Added test harness to check driver and passenger mass
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web('Simscape_Vehicle_Library_Demo_Script.html')

Scripts_Data/sm_car_startupMFSwift.m

+4
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@
6666
library_path = [curr_proj.RootFolder filesep 'Libraries' filesep 'Vehicle' filesep 'Tire' filesep 'MFSwift' filesep 'MFSwift_2212'];
6767
elseif(mfswift_ver==2306)
6868
library_path = [curr_proj.RootFolder filesep 'Libraries' filesep 'Vehicle' filesep 'Tire' filesep 'MFSwift' filesep 'MFSwift_2306'];
69+
elseif(mfswift_ver==2312)
70+
library_path = [curr_proj.RootFolder filesep 'Libraries' filesep 'Vehicle' filesep 'Tire' filesep 'MFSwift' filesep 'MFSwift_2312'];
6971
end
7072
addpath(library_path);
7173
% Add opencrg tools to path
@@ -92,6 +94,8 @@
9294
library_path = [curr_proj.RootFolder filesep 'Libraries' filesep 'Vehicle' filesep 'Tire' filesep 'MFSwift' filesep 'MFSwift_2212'];
9395
elseif(mfswift_ver==2306)
9496
library_path = [curr_proj.RootFolder filesep 'Libraries' filesep 'Vehicle' filesep 'Tire' filesep 'MFSwift' filesep 'MFSwift_2306'];
97+
elseif(mfswift_ver==2312)
98+
library_path = [curr_proj.RootFolder filesep 'Libraries' filesep 'Vehicle' filesep 'Tire' filesep 'MFSwift' filesep 'MFSwift_2312'];
9599
end
96100
if(isempty(library_path))
97101
warning('off','backtrace')
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web('Simscape_Vehicle_Templates_Exercises.html')

0 commit comments

Comments
 (0)