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/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 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