Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makes multibody/constraint private within examples/rod2d #21445

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
28 changes: 25 additions & 3 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,14 +89,24 @@ 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",
],
)
Expand Down
287 changes: 146 additions & 141 deletions multibody/constraint/constraint_doxygen.h → examples/rod2d/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "drake/multibody/constraint/constraint_solver.h"
#include "drake/examples/rod2d/constraint_solver.h"

namespace drake {
namespace multibody {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "drake/common/fmt_eigen.h"
#include "drake/common/text_logging.h"
#include "drake/multibody/constraint/constraint_problem_data.h"
#include "drake/examples/rod2d/constraint_problem_data.h"
#include "drake/solvers/moby_lcp_solver.h"

namespace drake {
Expand Down
4 changes: 2 additions & 2 deletions examples/rod2d/rod2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#include <utility>
#include <vector>

#include "drake/examples/rod2d/constraint_problem_data.h"
#include "drake/examples/rod2d/constraint_solver.h"
#include "drake/examples/rod2d/rod2d_state_vector.h"
#include "drake/multibody/constraint/constraint_problem_data.h"
#include "drake/multibody/constraint/constraint_solver.h"
#include "drake/solvers/moby_lcp_solver.h"
#include "drake/systems/framework/leaf_system.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "drake/multibody/constraint/constraint_solver.h"
#include "drake/examples/rod2d/constraint_solver.h"

#include <cmath>
#include <memory>
Expand Down
4 changes: 2 additions & 2 deletions examples/rod2d/test/rod2d_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

#include "drake/common/test_utilities/eigen_matrix_compare.h"
#include "drake/common/test_utilities/expect_no_throw.h"
#include "drake/multibody/constraint/constraint_problem_data.h"
#include "drake/multibody/constraint/constraint_solver.h"
#include "drake/examples/rod2d/constraint_problem_data.h"
#include "drake/examples/rod2d/constraint_solver.h"
#include "drake/systems/analysis/simulator.h"

using drake::multibody::constraint::ConstraintAccelProblemData;
Expand Down
55 changes: 0 additions & 55 deletions multibody/constraint/BUILD.bazel

This file was deleted.

1 change: 0 additions & 1 deletion tools/install/libdrake/build_components.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ LIBDRAKE_COMPONENTS = [
"//multibody/benchmarks/kuka_iiwa_robot",
"//multibody/benchmarks/mass_damper_spring",
"//multibody/benchmarks/pendulum",
"//multibody/constraint",
"//multibody/contact_solvers",
"//multibody/contact_solvers/sap",
"//multibody/fem",
Expand Down