Skip to content

Commit

Permalink
Remove explicit constructor on struct IrisOptions (RobotLocomotion#20845
Browse files Browse the repository at this point in the history
)

This allows for aggregate initialization, while still allowing default construction.

Also fix a missing inline keyword in optimization_pybind.
  • Loading branch information
AlexandreAmice authored Jan 30, 2024
1 parent 402fac2 commit 7fdb209
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bindings/pydrake/geometry/geometry_py_optimization.cc
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ void DefineGeometryOptimization(py::module m) {
{
const auto& cls_doc = doc.IrisOptions;
py::class_<IrisOptions> iris_options(m, "IrisOptions", cls_doc.doc);
iris_options.def(py::init<>(), cls_doc.ctor.doc)
iris_options.def(ParamInit<IrisOptions>())
.def_readwrite("require_sample_point_is_contained",
&IrisOptions::require_sample_point_is_contained,
cls_doc.require_sample_point_is_contained.doc)
Expand Down
2 changes: 1 addition & 1 deletion bindings/pydrake/geometry/optimization_pybind.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace pydrake {
object ConvexSets (which uses copyable_unique_ptr ownership). This is useful to
accept Python-natural function arguments (list of pointers) and then call the
C++ API that requires a more complicated type. */
geometry::optimization::ConvexSets CloneConvexSets(
inline geometry::optimization::ConvexSets CloneConvexSets(
const std::vector<geometry::optimization::ConvexSet*>& sets_in) {
geometry::optimization::ConvexSets sets;
sets.reserve(sets_in.size());
Expand Down
2 changes: 0 additions & 2 deletions geometry/optimization/iris.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ struct IrisOptions {
a->Visit(DRAKE_NVP(random_seed));
}

IrisOptions() = default;

/** The initial polytope is guaranteed to contain the point if that point is
collision-free. However, the IRIS alternation objectives do not include (and
can not easily include) a constraint that the original sample point is
Expand Down

0 comments on commit 7fdb209

Please sign in to comment.