Skip to content

Commit c18ac36

Browse files
committed
Merge branch 'awf-latest' into RT1-6296-remove-unused-functions-in-route-handler
2 parents 107ffe5 + ea009b8 commit c18ac36

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+84414
-56
lines changed

.github/CODEOWNERS

+21-15
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Files generated when installing smart_mpc_trajectory_follower
2+
build/
3+
*.egg-info/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
cmake_minimum_required(VERSION 3.14)
2+
project(smart_mpc_trajectory_follower)
3+
4+
find_package(autoware_cmake REQUIRED)
5+
autoware_package()
6+
7+
install(PROGRAMS
8+
smart_mpc_trajectory_follower/scripts/pympc_trajectory_follower.py
9+
DESTINATION lib/${PROJECT_NAME}
10+
)
11+
ament_auto_package(
12+
INSTALL_TO_SHARE
13+
)

control/smart_mpc_trajectory_follower/README.md

+338
Large diffs are not rendered by default.
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.0"?>
2+
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
3+
<package format="3">
4+
<name>smart_mpc_trajectory_follower</name>
5+
<version>1.0.0</version>
6+
<description>Nodes to follow a trajectory by generating control commands using smart mpc</description>
7+
8+
<!-- mpc longitudinal controller -->
9+
<maintainer email="masayuki.aino@proxima-ai-tech.com">Masayuki Aino</maintainer>
10+
11+
<license>Apache License 2.0</license>
12+
13+
<author email="masayuki.aino@proxima-ai-tech.com">Masayuki Aino</author>
14+
15+
<buildtool_depend>ament_cmake_auto</buildtool_depend>
16+
<buildtool_depend>ament_cmake_python</buildtool_depend>
17+
<buildtool_depend>autoware_cmake</buildtool_depend>
18+
19+
<depend>autoware_adapi_v1_msgs</depend>
20+
<depend>autoware_auto_control_msgs</depend>
21+
<depend>autoware_auto_planning_msgs</depend>
22+
<depend>autoware_auto_system_msgs</depend>
23+
<depend>autoware_auto_vehicle_msgs</depend>
24+
<depend>motion_utils</depend>
25+
<depend>pybind11_vendor</depend>
26+
<depend>python3-scipy</depend>
27+
<depend>rclcpp</depend>
28+
<depend>rclcpp_components</depend>
29+
<depend>tier4_autoware_utils</depend>
30+
31+
<exec_depend>ros2launch</exec_depend>
32+
33+
<test_depend>ament_cmake_ros</test_depend>
34+
<test_depend>ament_index_python</test_depend>
35+
<test_depend>ament_lint_auto</test_depend>
36+
<test_depend>autoware_lint_common</test_depend>
37+
<test_depend>autoware_testing</test_depend>
38+
<test_depend>ros_testing</test_depend>
39+
40+
<export>
41+
<build_type>ament_cmake</build_type>
42+
</export>
43+
</package>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# cspell: ignore numba
2+
import glob
3+
import json
4+
import os
5+
from pathlib import Path
6+
7+
from setuptools import find_packages
8+
from setuptools import setup
9+
10+
os.system("pip3 install numba==0.58.1 --force-reinstall")
11+
os.system("pip3 install pybind11")
12+
os.system("pip3 install GPy")
13+
os.system("pip3 install torch")
14+
package_path = {}
15+
package_path["path"] = str(Path(__file__).parent)
16+
with open("smart_mpc_trajectory_follower/package_path.json", "w") as f:
17+
json.dump(package_path, f)
18+
build_cpp_command = "g++ -Ofast -Wall -shared -std=c++11 -fPIC $(python3 -m pybind11 --includes) "
19+
build_cpp_command += "smart_mpc_trajectory_follower/scripts/proxima_calc.cpp "
20+
build_cpp_command += (
21+
"-o smart_mpc_trajectory_follower/scripts/proxima_calc$(python3-config --extension-suffix) "
22+
)
23+
build_cpp_command += "-lrt -I/usr/include/eigen3"
24+
os.system(build_cpp_command)
25+
26+
so_path = (
27+
"scripts/"
28+
+ glob.glob("smart_mpc_trajectory_follower/scripts/proxima_calc.*.so")[0].split("/")[-1]
29+
)
30+
setup(
31+
name="smart_mpc_trajectory_follower",
32+
version="1.0.0",
33+
packages=find_packages(),
34+
package_data={
35+
"smart_mpc_trajectory_follower": ["package_path.json", so_path],
36+
},
37+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
__pycache__/
2+
*.json

control/smart_mpc_trajectory_follower/smart_mpc_trajectory_follower/__init__.py

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright 2024 Proxima Technology Inc, TIER IV
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import os
16+
from pathlib import Path
17+
import shutil
18+
19+
import smart_mpc_trajectory_follower
20+
21+
if __name__ == "__main__":
22+
package_dir = str(Path(smart_mpc_trajectory_follower.__file__).parent)
23+
24+
remove_dirs = [
25+
package_dir + "/__pycache__",
26+
package_dir + "/scripts/__pycache__",
27+
package_dir + "/training_and_data_check/__pycache__",
28+
]
29+
for i in range(len(remove_dirs)):
30+
if os.path.isdir(remove_dirs[i]):
31+
shutil.rmtree(remove_dirs[i])
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
mpc_parameter:
2+
system:
3+
mode: mppi_ilqr # option: ilqr, mppi, mppi_ilqr
4+
mpc_setting:
5+
ctrl_time_step: 0.03333
6+
mpc_freq: 3
7+
N: 50
8+
steer_ctrl_queue_size: 50
9+
steer_ctrl_queue_size_core: 15
10+
acc_ctrl_queue_size: 12
11+
nx_0: 6
12+
nu_0: 2
13+
timing_Q_c: [25]
14+
cost_parameters:
15+
Q: [0.0, 10.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
16+
Q_c: [1e+2, 1e+8, 1e+6, 1e+3, 1.0, 1.0, 1.0, 1.0]
17+
Q_f: [1e+2, 1e+8, 1e+2, 1e+8, 1.0, 1.0, 1.0, 1.0]
18+
R: [10.0, 1000.0]
19+
acc_lim_weight: 100.0
20+
steer_lim_weight: 100.0
21+
acc_rate_lim_weight: 10000.0
22+
steer_rate_lim_weight: 10000.0
23+
min_steer_rate_transform_for_start: 0.01
24+
power_steer_rate_transform_for_start: 5
25+
coef_steer_rate_transform_for_start: 3.0
26+
min_loose_lateral_cost: 0.00001
27+
power_loose_lateral_cost: 10
28+
threshold_loose_lateral_cost: 0.2
29+
min_loose_yaw_cost: 0.00001
30+
power_loose_yaw_cost: 1
31+
threshold_loose_yaw_cost: 0.1
32+
ilqr:
33+
ls_step: 0.9
34+
max_iter_ls: 10
35+
max_iter_ilqr: 1
36+
ilqr_tol: 0.01
37+
mppi:
38+
lam: 1.0
39+
Sigma: [1e-15, 1e-2]
40+
max_iter_mppi: 2
41+
sample_num: 100
42+
mppi_tol: 0.5
43+
mppi_step: 20
44+
preprocessing:
45+
reference_horizon: 50
46+
cap_pred_error: [0.5, 2.0]
47+
use_sg_for_nominal_inputs: true
48+
sg_deg_for_nominal_inputs: 0
49+
sg_window_size_for_nominal_inputs: 10
50+
to_be_deprecated:
51+
tighten_horizon: 20
52+
min_tighten_steer_rate: 1.0
53+
power_tighten_steer_rate_by_lateral_error: 1
54+
threshold_tighten_steer_rate_by_lateral_error: 0.05
55+
power_tighten_steer_rate_by_yaw_error: 1
56+
threshold_tighten_steer_rate_by_yaw_error: 0.05
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# default parameter is set for sample_vehicle of AWF: https://github.com/autowarefoundation/sample_vehicle_launch/tree/main/sample_vehicle_description
2+
nominal_parameter:
3+
vehicle_info:
4+
wheel_base: 2.79
5+
acceleration:
6+
acc_time_delay: 0.1
7+
acc_time_constant: 0.1
8+
steering:
9+
steer_time_delay: 0.27
10+
steer_time_constant: 0.24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
trained_model_parameter:
2+
control_application:
3+
use_trained_model: false
4+
update_trained_model: false
5+
max_train_data_size: 10000
6+
error_decay: [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5]
7+
use_trained_model_diff: true
8+
use_sg_for_trained_model_diff: true
9+
sg_deg_for_trained_model_diff: 0
10+
sg_window_size_for_trained_model_diff: 25
11+
use_sg_for_noise: true
12+
sg_deg_for_noise: 0
13+
sg_window_size_for_noise: 15
14+
use_x_noise: false
15+
use_y_noise: false
16+
use_v_noise: false
17+
use_theta_noise: false
18+
use_acc_noise: false
19+
use_steer_noise: false
20+
smoothing:
21+
acc_sigma_for_learning: 5.0
22+
steer_sigma_for_learning: 5.0
23+
acc_des_sigma_for_learning: 5.0
24+
steer_des_sigma_for_learning: 5.0
25+
x_out_sigma_for_learning: 30.0
26+
y_out_sigma_for_learning: 30.0
27+
v_out_sigma_for_learning: 30.0
28+
theta_out_sigma_for_learning: 10.0
29+
acc_out_sigma_for_learning: 5.0
30+
steer_out_sigma_for_learning: 5.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# workspace specific settings
7+
train_drive_*.png
8+
test_feedforward_*/
9+
test_pure_pursuit_*/
10+
test_python_*/
11+
python_sim_log_*/
12+
sim_setting.json
13+
auto_test_result_*.csv
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
default, 0.00, 1.39, 2.78, 4.17, 5.56, 6.94, 8.33, 9.72, 11.11, 12.50, 13.89, 15.28, 16.67
2+
-4.0, -4.40, -4.36, -4.38, -4.12, -4.20, -3.94, -3.98, -3.80, -3.77, -3.76, -3.59, -3.50, -3.40
3+
-3.5, -4.00, -3.91, -3.85, -3.64, -3.68, -3.55, -3.42, -3.24, -3.25, -3.00, -3.04, -2.93, -2.80
4+
-3.0, -3.40, -3.37, -3.33, -3.00, -3.00, -2.90, -2.88, -2.65, -2.43, -2.44, -2.43, -2.39, -2.30
5+
-2.5, -2.80, -2.72, -2.72, -2.62, -2.41, -2.43, -2.26, -2.18, -2.11, -2.03, -1.96, -1.91, -1.85
6+
-2.0, -2.30, -2.24, -2.12, -2.02, -1.92, -1.81, -1.67, -1.58, -1.51, -1.49, -1.40, -1.35, -1.30
7+
-1.5, -1.70, -1.61, -1.47, -1.46, -1.40, -1.37, -1.29, -1.24, -1.10, -0.99, -0.83, -0.80, -0.78
8+
-1.0, -1.30, -1.28, -1.10, -1.09, -1.04, -1.02, -0.98, -0.89, -0.82, -0.61, -0.52, -0.54, -0.56
9+
-0.8, -0.96, -0.90, -0.82, -0.74, -0.70, -0.65, -0.63, -0.59, -0.55, -0.44, -0.39, -0.39, -0.35
10+
-0.6, -0.77, -0.71, -0.67, -0.65, -0.58, -0.52, -0.51, -0.50, -0.40, -0.33, -0.30, -0.31, -0.30
11+
-0.4, -0.45, -0.40, -0.45, -0.44, -0.38, -0.35, -0.31, -0.30, -0.26, -0.30, -0.29, -0.31, -0.25
12+
-0.2, -0.24, -0.24, -0.25, -0.22, -0.23, -0.25, -0.27, -0.29, -0.24, -0.22, -0.17, -0.18, -0.12
13+
0.0, 0.00, 0.00, -0.05, -0.05, -0.05, -0.05, -0.08, -0.08, -0.08, -0.08, -0.10, -0.10, -0.10
14+
0.2, 0.16, 0.12, 0.02, 0.02, 0.00, 0.00, -0.05, -0.05, -0.05, -0.05, -0.08, -0.08, -0.08
15+
0.4, 0.38, 0.30, 0.22, 0.25, 0.24, 0.23, 0.20, 0.16, 0.16, 0.14, 0.10, 0.05, 0.05
16+
0.6, 0.52, 0.52, 0.51, 0.49, 0.43, 0.40, 0.35, 0.33, 0.33, 0.33, 0.32, 0.34, 0.34
17+
0.8, 0.82, 0.81, 0.78, 0.68, 0.63, 0.56, 0.53, 0.48, 0.43, 0.41, 0.37, 0.38, 0.40
18+
1.0, 1.00, 1.08, 1.01, 0.88, 0.76, 0.69, 0.66, 0.58, 0.54, 0.49, 0.45, 0.40, 0.40
19+
1.5, 1.52, 1.50, 1.38, 1.26, 1.14, 1.03, 0.91, 0.82, 0.67, 0.61, 0.51, 0.41, 0.41
20+
2.0, 1.80, 1.80, 1.64, 1.43, 1.25, 1.11, 0.96, 0.81, 0.70, 0.59, 0.51, 0.42, 0.42

0 commit comments

Comments
 (0)