From b157e08050141031e37e6e866c7c8c3779be2af7 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 3 Aug 2025 09:08:38 +0900 Subject: [PATCH 1/4] Fix include paths in tasks.json and update CMake configuration in SIL_operator.py; increase prediction horizon in two_wheel_vehicle_model_SIL.py --- .vscode/tasks.json | 8 ++++---- test_sil/SIL_operator.py | 12 ++++++++---- .../two_wheel_vehicle_model_SIL.py | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 87ab0e3..bc2eb3b 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -18,8 +18,8 @@ "-I${workspaceFolder}/external_libraries/python_control_to_cpp/python_control", "-I${workspaceFolder}/external_libraries/python_numpy_to_cpp/python_numpy", "-I${workspaceFolder}/external_libraries/python_numpy_to_cpp/base_matrix", - "-I${workspaceFolder}//external_libraries/python_math_to_cpp/base_math", - "-I${workspaceFolder}//external_libraries/python_math_to_cpp/python_math", + "-I${workspaceFolder}/external_libraries/python_math_to_cpp/base_math", + "-I${workspaceFolder}/external_libraries/python_math_to_cpp/python_math", "-I${workspaceFolder}/external_libraries/base_utility_cpp/base_utility", "${file}", "-o", @@ -46,8 +46,8 @@ "-I${workspaceFolder}/external_libraries/python_control_to_cpp/python_control", "-I${workspaceFolder}/external_libraries/python_numpy_to_cpp/python_numpy", "-I${workspaceFolder}/external_libraries/python_numpy_to_cpp/base_matrix", - "-I${workspaceFolder}//external_libraries/python_math_to_cpp/base_math", - "-I${workspaceFolder}//external_libraries/python_math_to_cpp/python_math", + "-I${workspaceFolder}/external_libraries/python_math_to_cpp/base_math", + "-I${workspaceFolder}/external_libraries/python_math_to_cpp/python_math", "-I${workspaceFolder}/external_libraries/base_utility_cpp/base_utility", "${file}", "-o", diff --git a/test_sil/SIL_operator.py b/test_sil/SIL_operator.py index ea169cf..1b3ad5e 100644 --- a/test_sil/SIL_operator.py +++ b/test_sil/SIL_operator.py @@ -24,8 +24,9 @@ def generate_cmake_lists_txt(self): code_text += f"project({SIL_lib_file_name})\n\n" code_text += "set(CMAKE_CXX_STANDARD 11)\n" - code_text += "set(CMAKE_CXX_STANDARD_REQUIRED ON)\n\n" - code_text += "set(CMAKE_CXX_FLAGS_DEBUG \"-O0\")\n" + code_text += "set(CMAKE_CXX_STANDARD_REQUIRED ON)\n" + code_text += "set(CMAKE_CXX_FLAGS_RELEASE \"-O2\")\n" + code_text += "set(CMAKE_CXX_FLAGS_RELEASE \"${CMAKE_CXX_FLAGS_RELEASE} -flto=auto\")\n\n" code_text += "find_package(pybind11 REQUIRED)\n\n" @@ -93,8 +94,11 @@ def build_pybind11_code(self): subprocess.run(f"rm -rf {build_folder}", shell=True) subprocess.run(f"mkdir -p {build_folder}", shell=True) subprocess.run( - f"cmake -S {self.SIL_folder} -B {build_folder}", shell=True) - subprocess.run(f"make -C {build_folder}", shell=True) + f"cmake -S {self.SIL_folder} -B {build_folder} -DCMAKE_BUILD_TYPE=Release", + shell=True + ) + subprocess.run( + f"cmake --build {build_folder} --config Release", shell=True) subprocess.run( f"mv {build_folder}/{generated_file_name}.*so {self.SIL_folder}", shell=True) diff --git a/test_sil/adaptive_mpc_two_wheel_vehicle/two_wheel_vehicle_model_SIL.py b/test_sil/adaptive_mpc_two_wheel_vehicle/two_wheel_vehicle_model_SIL.py index ca599b5..023f2ba 100644 --- a/test_sil/adaptive_mpc_two_wheel_vehicle/two_wheel_vehicle_model_SIL.py +++ b/test_sil/adaptive_mpc_two_wheel_vehicle/two_wheel_vehicle_model_SIL.py @@ -169,7 +169,7 @@ def main(): X_initial = np.array([[0.0], [0.0], [0.0], [0.0], [0.0], [10.0]]) - Np = 4 + Np = 16 Nc = 1 Number_of_Delay = 0 From ce969887821df63f7359c1af571bdc4fcb2e900c Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 3 Aug 2025 09:17:50 +0900 Subject: [PATCH 2/4] Update subproject commit for python_control_to_cpp --- external_libraries/python_control_to_cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external_libraries/python_control_to_cpp b/external_libraries/python_control_to_cpp index f3b4573..4afbe84 160000 --- a/external_libraries/python_control_to_cpp +++ b/external_libraries/python_control_to_cpp @@ -1 +1 @@ -Subproject commit f3b45730095eae7335991b19ff1c08a41ef2fbf7 +Subproject commit 4afbe84020e30ee58713a386e30310a3a033e77e From e9eeffe40f3c795a208051cda2dbf6dffd7246e8 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 3 Aug 2025 09:18:14 +0900 Subject: [PATCH 3/4] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/run_SIL_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_SIL_test.yml b/.github/workflows/run_SIL_test.yml index d2220ec..df04291 100644 --- a/.github/workflows/run_SIL_test.yml +++ b/.github/workflows/run_SIL_test.yml @@ -2,7 +2,7 @@ name: Run SIL test on: push: - branches: [ develop ] + branches: [ develop, feature/* ] jobs: From 0d37cdaf98aff6b65c34a27d96314478781e6284 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 3 Aug 2025 09:25:22 +0900 Subject: [PATCH 4/4] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E5=AE=8C?= =?UTF-8?q?=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/run_SIL_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_SIL_test.yml b/.github/workflows/run_SIL_test.yml index df04291..d2220ec 100644 --- a/.github/workflows/run_SIL_test.yml +++ b/.github/workflows/run_SIL_test.yml @@ -2,7 +2,7 @@ name: Run SIL test on: push: - branches: [ develop, feature/* ] + branches: [ develop ] jobs: