Skip to content

Commit

Permalink
v2p16. Compatible with MF-Swift v2312, MATLAB Online compatible.
Browse files Browse the repository at this point in the history
  • Loading branch information
smiller01985 committed Apr 8, 2024
1 parent 9bfe08f commit d4ee6c1
Show file tree
Hide file tree
Showing 22 changed files with 77 additions and 9 deletions.
@@ -1,2 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info Type="Basic" GroupUUID="3938fbca-90f5-48cc-8294-fd0c0ecd2fdc" Visible="1" Icon="" File="Libraries/sm_car_doc/sm_car_doc_overview.html" Name="Templates" />
<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" />
@@ -1,2 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info Type="Basic" GroupUUID="3938fbca-90f5-48cc-8294-fd0c0ecd2fdc" Visible="1" Icon="" File="Scripts_Data/Simscape_Vehicle_Library_Demo_Script.html" Name="Demo Script" />
<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" />
@@ -1,2 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info Type="Basic" GroupUUID="3938fbca-90f5-48cc-8294-fd0c0ecd2fdc" Visible="1" Icon="" File="Workflows/Exercises/Overview/Simscape_Vehicle_Templates_Exercises.html" Name="Exercises" />
<Info Type="Basic" GroupUUID="3938fbca-90f5-48cc-8294-fd0c0ecd2fdc" Visible="1" Icon="" File="Workflows/Exercises/Overview/Simscape_Vehicle_Templates_Exercises_web.m" Name="Exercises" />
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="28727d18-c61e-4ad0-97da-d16cf001687d" />
</Category>
</Info>
@@ -0,0 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info />
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="28727d18-c61e-4ad0-97da-d16cf001687d" />
</Category>
</Info>
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="28727d18-c61e-4ad0-97da-d16cf001687d" />
</Category>
</Info>
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="28727d18-c61e-4ad0-97da-d16cf001687d" />
</Category>
</Info>
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="28727d18-c61e-4ad0-97da-d16cf001687d" />
</Category>
</Info>
Binary file not shown.
@@ -1,6 +1,6 @@
function scene_data = sm_car_scenedata_double_lane_change
%% Floor and Grid parameters
% Copyright 2018-2020 The MathWorks, Inc.
% Copyright 2018-2022 The MathWorks, Inc.

scene_data.Name = 'Double_Lane_Change';
scene_data.Dashes.pitch = 7.5; % m
Expand All @@ -19,7 +19,13 @@
scene_data.Road.clr = [1 1 1]*0.5; % [R G B]
scene_data.Road.opc = 1; % (0-1)
scene_data.Road.x = 218.4; % m
scene_data.Road.y = -1.2; % m

% Adjustments due to Unreal scene change in R2022b
if(verLessThan('matlab','9.13'))
scene_data.Road.y = -1.2; % m
else
scene_data.Road.y = -1.2-2.5; % m
end
scene_data.Road.z = 0; % m
scene_data.Road.roll = 0*pi/180; % rad
scene_data.Road.pitch = 0*pi/180; % rad
Expand Down
@@ -1,10 +1,16 @@
function sm_car_trajectory_double_lane_change
% Function to construct double-lane change maneuver
% Copyright 2018-2021 The MathWorks, Inc.
% Copyright 2018-2022 The MathWorks, Inc.

cd(fileparts(which(mfilename)))
% Parameters for trajectory
maneuver_lateral_offset = -3.35; % m

% Adjustments due to Unreal scene change in R2022b
if(verLessThan('matlab','9.13'))
maneuver_lateral_offset = -3.35; % m
else
maneuver_lateral_offset = -3.35-2.5; % m
end
cone_set_lat_separation = 4.2; % m

% Longitudinal gate locations (m)
Expand Down
Binary file modified Libraries/Event/sm_car_database_Maneuver.xlsx
Binary file not shown.
12 changes: 10 additions & 2 deletions Libraries/Event/sm_car_gen_init_database.m
Expand Up @@ -2,7 +2,7 @@
% Define vehicle-level initial conditions for maneuvers
% Vehicle position, orientation, initial speed, initial wheel speed
%
% Copyright 2019-2020 The MathWorks, Inc.
% Copyright 2019-2022 The MathWorks, Inc.

%% Vehicle-level data
% Vehicle Name #Axles Wheel Radius (m) Init Z-Offset (m)
Expand Down Expand Up @@ -184,10 +184,18 @@
%% Scene Double Lane Change, Slow Start
InitSet.Double_Lane_Change.Type = 'Double_Lane_Change';
InitSet.Double_Lane_Change.Instance = '';

% Adjustments due to Unreal scene change in R2022b
if(verLessThan('matlab','9.13'))
sChassisY = -3.35;
else
sChassisY = -3.35-2.5;
end

InitSet.Double_Lane_Change.Data = {...
'aChassis','rad', 0, 0, 0;
'vChassis','m/s', 2.5, 0, 0;
'sChassis','m', 5, -3.35, 0};
'sChassis','m', 5, sChassisY, 0};

%% Scene Double Lane Change, Slow Start
InitSet.Double_Lane_Change_ISO3888.Type = 'Double_Lane_Change_ISO3888';
Expand Down
Binary file not shown.
1 change: 1 addition & 0 deletions Libraries/sm_car_doc/sm_car_doc_overview_web.m
@@ -0,0 +1 @@
web('sm_car_doc_overview.html')
9 changes: 9 additions & 0 deletions README.md
Expand Up @@ -30,6 +30,15 @@ adjust the libraries so that variant can be selected.
3. Modify parameter values in the "Vehicle" data structure in the MATLAB workspace.

### **Release History**
**v2.16 -- April 2024**
1. Compatible with MF-Swift v2312
2. Adjusted double-lane change to match Unreal scene (R2022b and higher)
3. Made project shortcuts compatible with MATLAB Online
4. Fixed capitalization error in sm_car_database_Maneuver.xlsx (...Hockenheim_F_ --> Hockenheim_f_)

**v2.15 -- March 2024**
1. Compatible with R2024a. Updated scripts to run with Fast Restart

**v2.15 -- September 2023**
1. Mass and inertia of driver and passengers are adjustable
2. Added test harness to check driver and passenger mass
Expand Down
1 change: 1 addition & 0 deletions Scripts_Data/Simscape_Vehicle_Library_Demo_Script_web.m
@@ -0,0 +1 @@
web('Simscape_Vehicle_Library_Demo_Script.html')
4 changes: 4 additions & 0 deletions Scripts_Data/sm_car_startupMFSwift.m
Expand Up @@ -66,6 +66,8 @@
library_path = [curr_proj.RootFolder filesep 'Libraries' filesep 'Vehicle' filesep 'Tire' filesep 'MFSwift' filesep 'MFSwift_2212'];
elseif(mfswift_ver==2306)
library_path = [curr_proj.RootFolder filesep 'Libraries' filesep 'Vehicle' filesep 'Tire' filesep 'MFSwift' filesep 'MFSwift_2306'];
elseif(mfswift_ver==2312)
library_path = [curr_proj.RootFolder filesep 'Libraries' filesep 'Vehicle' filesep 'Tire' filesep 'MFSwift' filesep 'MFSwift_2312'];
end
addpath(library_path);
% Add opencrg tools to path
Expand All @@ -92,6 +94,8 @@
library_path = [curr_proj.RootFolder filesep 'Libraries' filesep 'Vehicle' filesep 'Tire' filesep 'MFSwift' filesep 'MFSwift_2212'];
elseif(mfswift_ver==2306)
library_path = [curr_proj.RootFolder filesep 'Libraries' filesep 'Vehicle' filesep 'Tire' filesep 'MFSwift' filesep 'MFSwift_2306'];
elseif(mfswift_ver==2312)
library_path = [curr_proj.RootFolder filesep 'Libraries' filesep 'Vehicle' filesep 'Tire' filesep 'MFSwift' filesep 'MFSwift_2312'];
end
if(isempty(library_path))
warning('off','backtrace')
Expand Down
@@ -0,0 +1 @@
web('Simscape_Vehicle_Templates_Exercises.html')

0 comments on commit d4ee6c1

Please sign in to comment.