Skip to content

Commit

Permalink
Add a BUILD file for drake/examples/Pendulum. This is the first subst…
Browse files Browse the repository at this point in the history
…antive consumer of IPOPT in the Bazel build.
  • Loading branch information
david-german-tri committed Jan 25, 2017
1 parent cdce20f commit e7d9387
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 8 deletions.
68 changes: 68 additions & 0 deletions drake/examples/Pendulum/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# -*- python -*-
# This file contains rules for Bazel; see drake/doc/bazel.rst.

load("//tools:cpplint.bzl", "cpplint")
load("//tools:drake.bzl", "cc_googletest")

cc_library(
name = "pendulum_state_vector",
srcs = ["gen/pendulum_state_vector.cc"],
hdrs = ["gen/pendulum_state_vector.h"],
linkstatic = 1,
deps = [
"//drake/systems/framework:vector",
],
)

cc_library(
name = "pendulum_plant",
srcs = ["pendulum_plant.cc"],
hdrs = ["pendulum_plant.h"],
deps = [
":pendulum_state_vector",
"//drake/systems/framework",
],
)

cc_library(
name = "pendulum_swing_up",
srcs = ["pendulum_swing_up.cc"],
hdrs = ["pendulum_swing_up.h"],
deps = [
":pendulum_plant",
"//drake/systems/trajectory_optimization:direct_collocation",
],
)

# === test/ ===

cc_googletest(
name = "pendulum_urdf_dynamics_test",
data = ["Pendulum.urdf"],
deps = [
":pendulum_plant",
"//drake/common:eigen_matrix_compare",
"//drake/multibody:rigid_body_tree",
"//drake/multibody/parsers",
"//drake/multibody/rigid_body_plant",
],
)

cc_googletest(
name = "pendulum_dynamic_constraint_test",
deps = [
":pendulum_plant",
"//drake/common:eigen_matrix_compare",
"//drake/systems/trajectory_optimization:direct_collocation",
],
)

cc_googletest(
name = "pendulum_trajectory_optimization_test",
deps = [
":pendulum_swing_up",
"//drake/common:eigen_matrix_compare",
],
)

cpplint()
24 changes: 16 additions & 8 deletions drake/solvers/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ cc_library(
# - equality_constrained_qp_solver
# - linear_system_solver
# - moby_lcp_solver
# - IPOPT
# - Gurobi (on Ubuntu)
# - IPOPT (on Ubuntu only)
# - Gurobi (on Ubuntu only)

# Unsupported solvers:
# - dReal
Expand Down Expand Up @@ -174,15 +174,23 @@ cc_library(

cc_library(
name = "ipopt_solver",
srcs = ["ipopt_solver.cc"],
srcs = select({
"//tools:apple": ["no_ipopt.cc"],
"//tools:linux": ["ipopt_solver.cc"],
}),
hdrs = ["ipopt_solver.h"],
linkstatic = 1,
visibility = ["//visibility:private"],
deps = [
"@ipopt//:ipopt",
":mathematical_program_api",
"//drake/math:autodiff",
],
deps = select({
"//tools:linux": [
"@ipopt//:ipopt",
":mathematical_program_api",
"//drake/math:autodiff",
],
"//tools:apple": [
":mathematical_program_api",
],
}),
)

# === test/ ===
Expand Down

0 comments on commit e7d9387

Please sign in to comment.