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

Port cubic_polynomial to use add_lint_tests #7153

Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 0 additions & 1 deletion drake/automotive/dev/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- python -*-
# This file contains rules for Bazel; see drake/doc/bazel.rst.

load("//tools:cpplint.bzl", "cpplint")
load(
"//tools:drake.bzl",
"drake_cc_googletest",
Expand Down
4 changes: 3 additions & 1 deletion drake/examples/cubic_polynomial/BUILD
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- python -*-
# This file contains rules for Bazel; see drake/doc/bazel.rst.

load("//tools:cpplint.bzl", "cpplint")
load("//tools:drake.bzl", "drake_cc_binary")
load("//tools:lint.bzl", "add_lint_tests")
load("//tools:mosek.bzl", "mosek_test_tags")

drake_cc_binary(
Expand All @@ -15,3 +15,5 @@ drake_cc_binary(
"//drake/systems/framework:vector_system",
],
)

add_lint_tests()
2 changes: 1 addition & 1 deletion drake/examples/cubic_polynomial/region_of_attraction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void ComputeRegionOfAttraction() {
const Polynomial lambda{prog.NewSosPolynomial({x}, 4).first};

// TODO(soonho): Remove the explicit cast to Polynomial below.
prog.AddSosConstraint((V - rho_poly) * Polynomial{x * x} - lambda * Vdot);
prog.AddSosConstraint((V - rho_poly) * Polynomial(x * x) - lambda * Vdot);
prog.AddCost(-rho);
const solvers::SolutionResult result{prog.Solve()};
DRAKE_DEMAND(result == solvers::SolutionResult::kSolutionFound);
Expand Down