Skip to content

Commit

Permalink
[solvers] Use interface_deps throughout (RobotLocomotion#17157)
Browse files Browse the repository at this point in the history
This allows us to remove all of the third-party solvers from our header
linter's list of known defects.

Add some useful new macros so that rules are easier to write.
  • Loading branch information
jwnimmer-tri authored May 12, 2022
1 parent bf5947f commit 7442259
Show file tree
Hide file tree
Showing 21 changed files with 600 additions and 459 deletions.
2 changes: 2 additions & 0 deletions examples/acrobot/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ drake_cc_binary(
":spong_controller",
":spong_controller_params",
"//geometry:drake_visualizer",
"//solvers:snopt_solver",
"//systems/analysis:simulator",
"@gflags",
],
Expand All @@ -282,6 +283,7 @@ drake_cc_binary(
":acrobot_plant",
"//common:is_approx_equal_abstol",
"//geometry:drake_visualizer",
"//solvers:snopt_solver",
"//solvers:solve",
"//systems/analysis:simulator",
"//systems/controllers:finite_horizon_linear_quadratic_regulator",
Expand Down
11 changes: 11 additions & 0 deletions geometry/optimization/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ drake_cc_library(
],
deps = [
"//geometry:scene_graph",
"//solvers:choose_best_solver",
"//solvers:gurobi_solver",
"//solvers:ipopt_solver",
"//solvers:mathematical_program",
"//solvers:mosek_solver",
"//solvers:scs_solver",
"//solvers:solve",
"@qhull",
],
Expand All @@ -70,6 +75,7 @@ drake_cc_library(
":convex_set",
"//geometry:scene_graph",
"//multibody/plant",
"//solvers:choose_best_solver",
"//solvers:ibex_solver",
"//solvers:ipopt_solver",
"//solvers:snopt_solver",
Expand Down Expand Up @@ -102,6 +108,7 @@ drake_cc_googletest(
deps = [
":convex_set",
"//common/test_utilities:eigen_matrix_compare",
"//solvers:clp_solver",
],
)

Expand All @@ -111,6 +118,10 @@ drake_cc_googletest(
":graph_of_convex_sets",
"//common/test_utilities:eigen_matrix_compare",
"//common/test_utilities:expect_throws_message",
"//solvers:clp_solver",
"//solvers:gurobi_solver",
"//solvers:ipopt_solver",
"//solvers:mosek_solver",
],
)

Expand Down
1 change: 1 addition & 0 deletions multibody/contact_solvers/sap/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ drake_cc_googletest(
"//math:gradient",
"//solvers:constraint",
"//solvers:mathematical_program",
"//solvers:scs_solver",
"//solvers:solve",
],
)
Expand Down
3 changes: 3 additions & 0 deletions multibody/inverse_kinematics/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ drake_cc_library(
deps = [
"//multibody/plant",
"//solvers:mathematical_program",
"//solvers:mathematical_program_result",
"//solvers:mixed_integer_rotation_constraint",
"//solvers:rotation_constraint",
],
Expand Down Expand Up @@ -261,6 +262,7 @@ drake_cc_library(
"//multibody/parsing",
"//multibody/plant",
"//multibody/tree",
"//solvers:solve",
"@gtest//:without_main",
],
)
Expand Down Expand Up @@ -326,6 +328,7 @@ drake_cc_googletest(
],
deps = [
":global_inverse_kinematics_test_util",
"//solvers:gurobi_solver",
],
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include "drake/multibody/inverse_kinematics/test/global_inverse_kinematics_test_util.h"
#include "drake/solvers/gurobi_solver.h"
#include "drake/solvers/solve.h"

namespace drake {
namespace multibody {
Expand Down
1 change: 1 addition & 0 deletions multibody/optimization/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ drake_cc_googletest(
":optimization_with_contact_utilities",
":static_equilibrium_problem",
"//common/test_utilities:eigen_matrix_compare",
"//solvers:snopt_solver",
"//solvers:solve",
],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "drake/math/compute_numerical_gradient.h"
#include "drake/multibody/optimization/test/optimization_with_contact_utilities.h"
#include "drake/solvers/mathematical_program.h"
#include "drake/solvers/snopt_solver.h"
#include "drake/solvers/solve.h"

namespace drake {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "drake/math/compute_numerical_gradient.h"
#include "drake/multibody/optimization/test/optimization_with_contact_utilities.h"
#include "drake/solvers/mathematical_program.h"
#include "drake/solvers/snopt_solver.h"
#include "drake/solvers/solve.h"

namespace drake {
Expand Down
Loading

0 comments on commit 7442259

Please sign in to comment.