forked from Intelligent-Driving-Laboratory/GOPS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_veh3dofconti_infadp.py
44 lines (40 loc) · 1.26 KB
/
run_veh3dofconti_infadp.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Copyright (c). All Rights Reserved.
# General Optimal control Problem Solver (GOPS)
# Intelligent Driving Lab (iDLab), Tsinghua University
#
# Creator: iDLab
# Lab Leader: Prof. Shengbo Eben Li
# Email: [email protected]
#
# Description: run a closed-loop system
# Update: 2022-12-05, Congsheng Zhang: create file
from gops.sys_simulator.sys_run import PolicyRunner
import numpy as np
runner = PolicyRunner(
log_policy_dir_list=["../results/INFADP/veh3dofconti",
"../results/INFADP/veh3dofconti"],
trained_policy_iteration_list=["4000","1300_opt"],
is_init_info=True,
init_info={"init_state": [0.0, 0, 0.0, 3.0, 0, 0], "ref_time": 0.0,
"ref_num": 3}, # ref_num = [0, 1, 2,..., 7]
save_render=False,
legend_list=["INFADP-4000","INFADP-best"],
use_opt=True, # Use optimal solution for comparison
opt_args={
"opt_controller_type": "MPC",
"num_pred_step": 10,
"gamma": 0.99,
"mode": "shooting",
"minimize_options": {
"max_iter": 200,
"tol": 1e-4,
"acceptable_tol": 1e-2,
"acceptable_iter": 10,
},
"use_terminal_cost": False,
},
constrained_env=False,
is_tracking=True,
dt=0.1,
)
runner.run()