Skip to content

Commit

Permalink
Makes multibody/constraint private within examples/rod2d (RobotLocomo…
Browse files Browse the repository at this point in the history
…tion#21445)

We move the entire multibody/constraint into the only place it gets used examples/rod2d.
Along with this, we properly deprecate the original constraint_solver for removal, leaving the original files as copies in `multibody/constraint` simply to provide a proper deprecation window.

The docs are removed from our public Doxygen modules to avoid this old confusion users have that we have an LCP solver in Drake. The docs are now a local README file in examples/rod2d/constraint.

Co-authored-by: Jeremy Nimmer <[email protected]>
  • Loading branch information
2 people authored and RussTedrake committed Dec 15, 2024
1 parent 51403da commit d03c8cd
Show file tree
Hide file tree
Showing 16 changed files with 3,646 additions and 614 deletions.
5 changes: 0 additions & 5 deletions doc/doxygen_cxx/doxygen.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,6 @@ namespace solvers {
*/
} // namespace solvers

/**
@defgroup constraint_overview Multibody Dynamics Constraints
@ingroup multibody
*/

// TODO(russt): Take a thorough pass through the algorithms group
// documentation, adding brief descriptions of each and tagging the relevant
// algorithms throughout the code.
Expand Down
30 changes: 26 additions & 4 deletions examples/rod2d/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ load(

package(default_visibility = ["//visibility:private"])

drake_cc_library(
name = "constraint_solver",
srcs = ["constraint_solver.cc"],
hdrs = [
"constraint_problem_data.h",
"constraint_solver.h",
],
deps = [
"//common:essential",
"//solvers:moby_lcp_solver",
],
)

drake_cc_library(
name = "rod2d_state_vector",
srcs = ["rod2d_state_vector.cc"],
Expand Down Expand Up @@ -45,11 +58,10 @@ drake_cc_library(
hdrs = [
"rod2d.h",
],
visibility = ["//multibody/constraint:__pkg__"],
deps = [
":constraint_solver",
":rod2d_state_vector",
"//common:essential",
"//multibody/constraint",
"//solvers:mathematical_program",
"//systems/framework:leaf_system",
],
Expand Down Expand Up @@ -77,16 +89,26 @@ drake_cc_library(

# === test/ ===

drake_cc_googletest(
name = "constraint_solver_test",
deps = [
":constraint_solver",
":rod2d",
"//solvers:moby_lcp_solver",
"//solvers:unrevised_lemke_solver",
],
)

drake_cc_googletest(
name = "rod2d_test",
deps = [
":constraint_solver",
":rod2d",
"//common:essential",
"//common/test_utilities:eigen_matrix_compare",
"//common/test_utilities:expect_no_throw",
"//multibody/constraint",
"//systems/analysis:simulator",
],
)

add_lint_tests(enable_clang_format_lint = False)
add_lint_tests()
295 changes: 147 additions & 148 deletions multibody/constraint/constraint_doxygen.h → examples/rod2d/README.md

Large diffs are not rendered by default.

514 changes: 514 additions & 0 deletions examples/rod2d/constraint_problem_data.h

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions examples/rod2d/constraint_solver.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "drake/examples/rod2d/constraint_solver.h"

namespace drake {
namespace examples {
namespace rod2d {

template class ConstraintSolver<double>;

} // namespace rod2d
} // namespace examples
} // namespace drake
2,488 changes: 2,488 additions & 0 deletions examples/rod2d/constraint_solver.h

Large diffs are not rendered by default.

File renamed without changes
Loading

0 comments on commit d03c8cd

Please sign in to comment.