Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,6 @@ TODO.md
**/nul

.claude/

# Ignore large assets managed via download script
tests/Applications/SUMO_CARLA_EcoDriving/MLK_Carla_Scenario/CARLAFiles/MLK_noped1002_final_debug.fbx
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
path = ProprietaryFiles
url = https://github.com/Real-Sim-XIL/ProprietaryFiles.git

[submodule "tests/Applications/SUMO_CARLA_EcoDriving/mlk_xil"]
path = tests/Applications/SUMO_CARLA_EcoDriving/mlk_xil
url = https://code.ornl.gov/realsim_realtwin-deployment/mlk_xil.git
1 change: 0 additions & 1 deletion ProprietaryFiles
Submodule ProprietaryFiles deleted from 2f6d8b
247 changes: 136 additions & 111 deletions VirCarlaEnv/VirCarlaEnv/mainVirCarla.cpp

Large diffs are not rendered by default.

49 changes: 49 additions & 0 deletions scripts/download_large_assets.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/usr/bin/env pwsh
# Download large simulation assets from OneDrive

$ASSETS = @{
"tests/Applications/SUMO_CARLA_EcoDriving/MLK_Carla_Scenario/CARLAFiles/MLK_noped1002_final_debug.fbx" = "https://outlookuga-my.sharepoint.com/:u:/g/personal/ys04893_uga_edu/EU8vuZV8DvtOlJ6HhpL7Z8MBkhCtVcloma0qxJXXMsPP7A?e=0KgETK&download=1"
}

$repoRoot = Split-Path -Parent $PSScriptRoot
Set-Location $repoRoot

foreach ($file in $ASSETS.Keys) {
$dest = Join-Path $repoRoot $file

if (Test-Path $dest) {
$sizeMB = [math]::Round((Get-Item $dest).Length / 1MB, 2)
Write-Host "File $file already exists ($sizeMB MB)" -ForegroundColor Yellow
$response = Read-Host "Redownload? (y/N)"
if ($response -notmatch '^[yY]') {
Write-Host "Skipped $file" -ForegroundColor Green
continue
}
}

Write-Host "Downloading $file..." -ForegroundColor Yellow
$destDir = Split-Path -Parent $dest
New-Item -ItemType Directory -Path $destDir -Force | Out-Null

try {
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri $ASSETS[$file] -OutFile $dest
$ProgressPreference = 'Continue'

$sizeMB = [math]::Round((Get-Item $dest).Length / 1MB, 2)
Write-Host "OK Downloaded $file ($sizeMB MB)" -ForegroundColor Green
}
catch {
Write-Host "`nERROR Failed to download $file" -ForegroundColor Red
Write-Host $_.Exception.Message -ForegroundColor Red
Write-Host "`nTroubleshooting:" -ForegroundColor Yellow
Write-Host "1. Make sure you have access to the OneDrive link" -ForegroundColor Yellow
Write-Host "2. Check your internet connection" -ForegroundColor Yellow
Write-Host "3. Try downloading manually from: $($ASSETS[$file])" -ForegroundColor Yellow
Read-Host "`nPress Enter to exit"
exit 1
}
}

Write-Host "`nAll assets ready!" -ForegroundColor Green
Read-Host "`nPress Enter to exit"
3 changes: 3 additions & 0 deletions tests/Applications/Eco_Fixed_Timming/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SIMULATION_FOLDER=C:\Users\hg25079\Documents\GitHub\FIXS\tests\Applications\Eco_Fixed_Timming\Experiments_Sumo\Shallowford_after_calibration_banleftturn_AdjustedFixedTime_V3
CONFIG_PATH=C:\Users\hg25079\Documents\GitHub\FIXS\tests\Applications\Eco_Fixed_Timming\Experiments_Sumo\Shallowford_after_calibration_banleftturn_AdjustedFixedTime_V3\config_Sumo.yaml
SUMO_NET_PATH=C:\Users\hg25079\Documents\GitHub\FIXS\tests\Applications\Eco_Fixed_Timming\Experiments_Sumo\Shallowford_after_calibration_banleftturn_AdjustedFixedTime_V3\chatt.net.xml
55 changes: 55 additions & 0 deletions tests/Applications/Eco_Fixed_Timming/SimulinkModelInit.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
% File: realsim_script.m


simModelName = 'CAVE_MachE_dSPACE_250912';%

% Clear workspace and console
disp(['Current folder: ', pwd]);
close all;
clearvars -except settingDir simModelName config_file_name; % Keep input variables
clc;
format compact;

% Different Vehicle Model, if different, need change!!!!!

addpath(genpath('.\\Vehicles_24a'))
configPath = 'C:\Users\hg25079\Documents\GitHub\FIXS\tests\Applications\SUMO_CARLA_EcoDriving\MLK_Sumo_Scenario\config_Sumo.yaml';



% Initializations
RealSimPath = 'C:\Users\hg25079\Documents\GitHub\FIXS\CommonLib';
% Add path of RealSim tools
addpath(genpath(RealSimPath));
% Initialize RealSim for Simulink, Read yaml file
disp(['configPath: ', configPath]);
%print configPath
fprintf('Configuration path: %s\n', configPath);

[VehicleMessageFieldDefInputVec, VehDataBus, TrafficLayerIP, TrafficLayerPort] = RealSimInitSimulink(configPath);

% Define RealSim parameters
RealSimPara = struct;
RealSimPara.warmupTime = 0;
RealSimPara.speedInit = 1; % Initial speed of the ego vehicle when entering SUMO network
RealSimPara.tLookahead = 0.1; % Use 0.1 for external control, recommend tLookahead >= 0.2 for SUMO driver
RealSimPara.smoothWindow = 1; % Number of moving average data points, 1 means no moving average
RealSimPara.speedSource = 3; % Use speedSource = 3 for dummy vehicle dynamics (simple transfer function)

% Start RealSim Procedure
fprintf('Starting RealSim procedure...\n');
%tic;

% Start Simulink model
% Specify the following:
% 1) Simulink model name
% 2) Stop time of the Simulink model
% Assign RealSimPara to the base workspace

assignin('base', 'RealSimPara', RealSimPara);
assignin('base', 'VehicleMessageFieldDefInputVec', VehicleMessageFieldDefInputVec);
assignin('base', 'VehDataBus', VehDataBus);
assignin('base', 'TrafficLayerIP', TrafficLayerIP);
assignin('base', 'TrafficLayerPort', TrafficLayerPort);


23 changes: 23 additions & 0 deletions tests/Applications/Eco_Fixed_Timming/SimulinkModelSaveResults.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
settingDir = 'C:\Users\hg25079\Documents\GitHub\FIXS\tests\Applications\Eco_Fixed_Timming\Experiments_Sumo\Shallowford_after_calibration_banleftturn_AdjustedFixedTime_V3\MPR\0%_10Hz_w_vehDyn_29119.31\';

VehicleOut = out;
Time = VehicleOut.desired_speed.Time;
DesiredSpeed = VehicleOut.desired_speed.Data;
DesiredSpeed = DesiredSpeed(:);
ActualSpeed = VehicleOut.actual_speed.Data;
ActualSpeed = ActualSpeed(:);
MPGe = VehicleOut.MPGe.Data;
BatteryCurrent = VehicleOut.battery_current.Data;
BatteryPower = VehicleOut.battery_power.Data;
BatterySOC = VehicleOut.battery_soc.Data;
MotorSpeed = VehicleOut.motor_speed.Data;
MotorTorque = VehicleOut.motor_torque.Data;
ActualAcc = VehicleOut.VehAcc.Data;


save('vehData', 'VehicleOut')
T = table(Time, DesiredSpeed, ActualSpeed, MPGe, BatteryCurrent, BatteryPower, BatterySOC, MotorSpeed, MotorTorque, ActualAcc,'VariableNames', {'Time', 'DesiredSpeed', 'ActualSpeed', 'MPGe', 'BatteryCurrent', 'BatteryPower','BatterySOC', 'MotorSpeed', 'MotorTorque', 'ActualAcc'});
% T = table(Time, DesiredSpeed, ActualSpeed, MPGe, BatteryCurrent, BatteryPower, BatterySOC, MotorSpeed, MotorTorque,'VariableNames', {'Time', 'DesiredSpeed', 'ActualSpeed', 'MPGe', 'BatteryCurrent', 'BatteryPower','BatterySOC', 'MotorSpeed', 'MotorTorque'});

writetable(T, [settingDir, '\ego_profile.csv']);

Binary file not shown.
Binary file not shown.
Loading