-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #213 from mldiego/master
CORA updates, ARCH-COMP 2024
- Loading branch information
Showing
121 changed files
with
8,567 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# ARCH-COMP 2024 | ||
ARCH-COMP AINNCS Category 2024 Model Files | ||
|
||
Event info: https://cps-vo.org/group/ARCH/FriendlyCompetition | ||
|
||
|
||
## Benchmarks | ||
|
||
We plan to reuse benchmarks from 2023 but feel free to propose new benchmarks or modifications to existing ones: https://github.com/verivital/ARCH-COMP2024/issues/1 | ||
|
||
|
||
|
||
### [2023 Benchmarks](https://github.com/verivital/ARCH-COMP2023) | ||
|
||
- Adaptive Cruise Controller (ACC) | ||
|
||
- Airplane | ||
|
||
- Attitude Control | ||
|
||
- Double Pendulum | ||
|
||
- Single Pendulum | ||
|
||
- QUAD | ||
|
||
- TORA with heterogeneous and sigmoid controller | ||
|
||
- TORA with ReLU controller (benchmark 9) | ||
|
||
- Unicycle (benchmark 10) | ||
|
||
- VCAS | ||
|
||
- 2D Spacecraft Docking | ||
|
||
|
||
### Competition History | ||
|
||
Prior year reports: | ||
- 2023: https://easychair.org/publications/paper/Vfq4b | ||
- 2022: https://easychair.org/publications/paper/C1J8 | ||
- 2021: https://easychair.org/publications/paper/Jq4h | ||
- 2020: https://easychair.org/publications/paper/Jvwg | ||
- 2019: https://easychair.org/publications/paper/BFKs | ||
|
||
Repeatability archives: https://gitlab.com/goranf/ARCH-COMP/ |
21 changes: 21 additions & 0 deletions
21
code/nnv/examples/Submission/ARCH-COMP2024/benchmarks/ACC/Specifications.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Parameters: | ||
|
||
a_lead = -2 | ||
T_gap = 1.4 | ||
D_default = 10 | ||
|
||
Initial states: | ||
x_lead = x(1) = [90, 110] | ||
v_lead = x(2) = [32, 32.2] | ||
γ_lead = x(3) = 0 | ||
x_ego = x(4) = [10, 11] | ||
v_ego = x(5) = [30, 30.2] | ||
γ_ego = x(6) = 0 | ||
|
||
t = 5 seconds | ||
control period = 0.1 s | ||
|
||
Safety Property: | ||
|
||
x_lead - x_ego >= D_safe, where D_safe = D_default + T_gap * v_ego; | ||
|
Binary file added
BIN
+15.2 KB
code/nnv/examples/Submission/ARCH-COMP2024/benchmarks/ACC/controller_5_20.mat
Binary file not shown.
Binary file added
BIN
+9.14 KB
code/nnv/examples/Submission/ARCH-COMP2024/benchmarks/ACC/controller_5_20.onnx
Binary file not shown.
21 changes: 21 additions & 0 deletions
21
code/nnv/examples/Submission/ARCH-COMP2024/benchmarks/ACC/dynamicsACC.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
function [dx]=dynamicsACC(x,a_ego) | ||
|
||
mu=0.0001; % friction parameter | ||
|
||
% x1 = lead_car position | ||
% x2 = lead_car velocity | ||
% x3 = lead_car internal state | ||
|
||
% x4 = ego_car position | ||
% x5 = ego_car velocity | ||
% x6 = ego_car internal state | ||
|
||
% lead car dynamics | ||
a_lead = -2; | ||
dx(1,1) = x(2); | ||
dx(2,1) = x(3); | ||
dx(3,1) = -2 * x(3) + 2 * a_lead - mu*x(2)^2; | ||
% ego car dyanmics | ||
dx(4,1) = x(5); | ||
dx(5,1) = x(6); | ||
dx(6,1) = -2 * x(6) + 2 * a_ego - mu*x(5)^2; |
77 changes: 77 additions & 0 deletions
77
code/nnv/examples/Submission/ARCH-COMP2024/benchmarks/ACC/reach.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
function rT = reach() | ||
|
||
%% Reachability analysis of ACC | ||
|
||
% Load components | ||
net = load_NN_from_mat('controller_5_20.mat'); | ||
reachStep = 0.02; | ||
controlPeriod = 0.1; | ||
output_mat = [0 0 0 0 1 0;1 0 0 -1 0 0; 0 1 0 0 -1 0]; % feedback: relative distance, relative velocity and ego-car velocity | ||
plant = NonLinearODE(6,1,@dynamicsACC, reachStep, controlPeriod, output_mat); | ||
nncs = NonlinearNNCS(net,plant); | ||
|
||
%% Reachability analysis | ||
|
||
tF = 5; % seconds | ||
time = 0:controlPeriod:5; | ||
steps = length(time); | ||
input_ref = [30;1.4]; | ||
|
||
% Initial set | ||
lb = [90; 32; 0; 10; 30; 0]; | ||
ub = [110; 32.2; 0; 11; 30.2; 0]; | ||
init_set = Star(lb,ub); | ||
|
||
% Input set | ||
lb = 0; | ||
ub = 0; | ||
input_set = Star(lb,ub); | ||
|
||
% Reachabilty analysis | ||
reachPRM.ref_input = input_ref; | ||
reachPRM.numSteps = 50; | ||
reachPRM.init_set = init_set; | ||
reachPRM.numCores = 1; | ||
reachPRM.reachMethod = 'approx-star'; | ||
[R,rT] = nncs.reach(reachPRM); | ||
% disp("Time to compute ACC reach sets: " +string(rT)); | ||
|
||
% Save results | ||
if is_codeocean | ||
save('/results/logs/acc.mat', 'R','rT','-v7.3'); | ||
else | ||
save('acc.mat', 'R','rT','-v7.3'); | ||
end | ||
|
||
%% Visualize results | ||
|
||
% Transform reach set into actual distance vs safe distance | ||
t_gap = 1.4; | ||
D_default = 10; | ||
outAll = []; | ||
safe_dis = []; | ||
% Transfrom intermediate reachsets from cora to NNV | ||
nncs.plant.get_interval_sets(); | ||
% Get intermediate reach sets | ||
allsets = nncs.plant.intermediate_reachSet; | ||
for i=1:length(allsets) | ||
outAll = [outAll allsets(i).affineMap(output_mat,[])]; | ||
safe_dis = [safe_dis allsets(i).affineMap([0 0 0 0 t_gap 0], D_default)]; | ||
end | ||
times = reachStep:reachStep:tF; | ||
|
||
% Plot results | ||
f = figure; | ||
Star.plotRanges_2D(outAll,2,times,'b'); | ||
hold on; | ||
Star.plotRanges_2D(safe_dis,1,times,'r'); | ||
xlabel('Time (s)'); | ||
ylabel('Distance (m)'); | ||
% Save figure | ||
if is_codeocean | ||
exportgraphics(f,'/results/logs/acc.pdf', 'ContentType', 'vector'); | ||
else | ||
exportgraphics(f,'acc.pdf','ContentType', 'vector'); | ||
end | ||
|
||
end |
Binary file added
BIN
+191 KB
code/nnv/examples/Submission/ARCH-COMP2024/benchmarks/Airplane/controller_airplane.h5
Binary file not shown.
Binary file added
BIN
+107 KB
code/nnv/examples/Submission/ARCH-COMP2024/benchmarks/Airplane/controller_airplane.mat
Binary file not shown.
Oops, something went wrong.