diff --git a/.bazeliskrc b/.bazeliskrc index d80defda..c91f8ab4 100644 --- a/.bazeliskrc +++ b/.bazeliskrc @@ -1,2 +1,2 @@ # Keep this version up to date with the version used by drake -USE_BAZEL_VERSION=8.2.1 +USE_BAZEL_VERSION=8.4.0 diff --git a/MODULE.bazel b/MODULE.bazel index de7c9e38..4c800b73 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -6,12 +6,18 @@ module( # If you don't want to support building on macOS, you may remove the next line. # Note that it must appear prior to loading "rules_cc", per the documentation: # https://github.com/bazelbuild/apple_support?tab=readme-ov-file#bazel-7-setup -bazel_dep(name = "apple_support", version = "1.17.1", repo_name = "build_bazel_apple_support") +bazel_dep(name = "apple_support", version = "2.3.0") # Add the Bazel rules we need. -bazel_dep(name = "rules_cc", version = "0.1.1") -bazel_dep(name = "rules_python", version = "1.0.0") -bazel_dep(name = "bazel_skylib", version = "1.7.1") +bazel_dep(name = "rules_java", version = "9.6.1") +bazel_dep(name = "rules_cc", version = "0.2.17") +bazel_dep(name = "rules_python", version = "1.9.0") +bazel_dep(name = "bazel_skylib", version = "1.9.0") +bazel_dep(name = "rules_foreign_cc", version = "0.15.1") +bazel_dep(name = "platforms", version = "1.0.0") +bazel_dep(name = "lcm", version = "1.5.2") +bazel_dep(name = "gflags", version = "2.2.2.bcr.1") +bazel_dep(name = "googletest", version = "1.17.0.bcr.2") drake_dep_repositories = use_extension( "@drake//tools/workspace:default.bzl", @@ -20,11 +26,8 @@ drake_dep_repositories = use_extension( use_repo( drake_dep_repositories, - "lcm", "eigen", "fmt", - "gflags", - "gtest", "pybind11", "gurobi", ) @@ -45,8 +48,8 @@ override_repo( bazel_dep(name = "drake") # You can also use DRAKE_COMMIT to choose a Drake release; e.g.: -DRAKE_COMMIT = "v1.42.0" -DRAKE_CHECKSUM = "d860c15f50397c8a946fcc79e0a58a91ebc56f2189ef9edfcac929aa04157f8b" +DRAKE_COMMIT = "v1.51.1" +DRAKE_CHECKSUM = "40cb4d0e3d378ba67c21aca8cc1396399774b333b12d0030f5fbe4ddff1dc786" # Before changing the COMMIT, temporarily uncomment the next line so that Bazel # displays the suggested new value for the CHECKSUM. diff --git a/core/BUILD.bazel b/core/BUILD.bazel index ebca23fe..f15bca99 100644 --- a/core/BUILD.bazel +++ b/core/BUILD.bazel @@ -109,7 +109,7 @@ cc_test( ":c3", ":c3_cartpole_problem", ":traj_eval", - "@gtest//:main", + "@googletest//:gtest_main", ], env_inherit = [ "GUROBI_HOME", diff --git a/core/c3.cc b/core/c3.cc index 8d837081..daa1b555 100644 --- a/core/c3.cc +++ b/core/c3.cc @@ -279,9 +279,9 @@ void C3::Solve(const VectorXd& x0) { // Set the initial force constraint if (h_is_zero_ == 1) { // No dependence on u, so just simulate passive system - drake::solvers::MobyLCPSolver LCPSolver; + drake::solvers::MobyLcpSolver LcpSolver; VectorXd lambda0; - LCPSolver.SolveLcpLemke(lcs_.F()[0], lcs_.E()[0] * x0 + lcs_.c()[0], + LcpSolver.SolveLcpLemke(lcs_.F()[0], lcs_.E()[0] * x0 + lcs_.c()[0], &lambda0); // Force constraints to be updated before every solve if no dependence on // u @@ -470,7 +470,7 @@ vector C3::SolveProjection(const vector& U, if (options_.num_threads > 0) { omp_set_dynamic(0); // Explicitly disable dynamic teams omp_set_num_threads(options_.num_threads); // Set number of threads - omp_set_nested(0); + omp_set_max_active_levels(1); omp_set_schedule(omp_sched_static, 0); } diff --git a/core/c3_qp.h b/core/c3_qp.h index 61865e96..6d014fa4 100644 --- a/core/c3_qp.h +++ b/core/c3_qp.h @@ -36,7 +36,9 @@ class C3QP final : public C3 { solver_options->SetOption(drake::solvers::OsqpSolver::id(), "max_iter", 500); solver_options->SetOption(drake::solvers::OsqpSolver::id(), "verbose", 0); - solver_options->SetOption(drake::solvers::OsqpSolver::id(), "polish", 1); + solver_options->SetOption(drake::solvers::OsqpSolver::id(), "warm_starting", + 1); + solver_options->SetOption(drake::solvers::OsqpSolver::id(), "polishing", 1); solver_options->SetOption(drake::solvers::OsqpSolver::id(), "polish_refine_iter", 1); solver_options->SetOption(drake::solvers::OsqpSolver::id(), "rho", 1e-4); @@ -45,4 +47,4 @@ class C3QP final : public C3 { } }; -} // namespace c3 \ No newline at end of file +} // namespace c3 diff --git a/core/configs/solver_options_default.yaml b/core/configs/solver_options_default.yaml index a8e333c3..6387a8cd 100644 --- a/core/configs/solver_options_default.yaml +++ b/core/configs/solver_options_default.yaml @@ -3,11 +3,11 @@ log_file_name: "" int_options: max_iter: 1000 verbose: 0 - warm_start: 1 - polish: 1 + warm_starting: 1 + polishing: 1 + polish_refine_iter: 3 scaled_termination: 1 check_termination: 25 - polish_refine_iter: 3 scaling: 10 adaptive_rho: 1 adaptive_rho_interval: 0 @@ -25,4 +25,4 @@ double_options: adaptive_rho_fraction: 0.4 time_limit: 1.0 -string_options: {} \ No newline at end of file +string_options: {} diff --git a/core/lcs.cc b/core/lcs.cc index fcdc673c..3aa54d11 100644 --- a/core/lcs.cc +++ b/core/lcs.cc @@ -61,13 +61,13 @@ const VectorXd LCS::Simulate(const VectorXd& x_init, const VectorXd& u, const LCSSimulateConfig& config) const { VectorXd x_final; VectorXd force; - drake::solvers::MobyLCPSolver LCPSolver; + drake::solvers::MobyLcpSolver LcpSolver; if (config.regularized) { - LCPSolver.SolveLcpLemkeRegularized( + LcpSolver.SolveLcpLemkeRegularized( F_[0], E_[0] * x_init + c_[0] + H_[0] * u, &force, config.min_exp, config.step_exp, config.max_exp, config.piv_tol, config.zero_tol); } else { - LCPSolver.SolveLcpLemke(F_[0], E_[0] * x_init + c_[0] + H_[0] * u, &force, + LcpSolver.SolveLcpLemke(F_[0], E_[0] * x_init + c_[0] + H_[0] * u, &force, config.piv_tol, config.zero_tol); } x_final = A_[0] * x_init + B_[0] * u + D_[0] * force + d_[0]; diff --git a/core/test/core_test.cc b/core/test/core_test.cc index de6f4350..68bff97f 100644 --- a/core/test/core_test.cc +++ b/core/test/core_test.cc @@ -777,4 +777,4 @@ TYPED_TEST(C3CartpoleTypedTest, ComputeCost) { int main(int argc, char** argv) { testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/multibody/BUILD.bazel b/multibody/BUILD.bazel index f446985c..0e0dac08 100644 --- a/multibody/BUILD.bazel +++ b/multibody/BUILD.bazel @@ -54,7 +54,7 @@ cc_test( ], deps = [ ":lcs_factory", - "@gtest//:main", + "@googletest//:gtest_main", ], size = "small", ) diff --git a/systems/BUILD.bazel b/systems/BUILD.bazel index 54fe4058..43e30922 100644 --- a/systems/BUILD.bazel +++ b/systems/BUILD.bazel @@ -124,7 +124,7 @@ cc_test( deps = [ ":systems", "//core:c3_cartpole_problem", - "@gtest//:main", + "@googletest//:gtest_main", ], env_inherit = [ "GUROBI_HOME", @@ -141,7 +141,7 @@ cc_test( deps = [ ":systems", ":framework", - "@gtest//:main", + "@googletest//:gtest_main", ], size = "small", ) @@ -159,7 +159,7 @@ cc_test( deps = [ "//core:c3", ":systems", - "@gtest//:main", + "@googletest//:gtest_main", ], size = "small", )