Skip to content

Commit

Permalink
WIP [py rational] Fix signatures to use Python types (not C++)
Browse files Browse the repository at this point in the history
Adjust bindings to follow topological order, so that function
signatures can look up their requisite python types.
  • Loading branch information
jwnimmer-tri committed Sep 16, 2024
1 parent b5c1508 commit 9cf6905
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bindings/pydrake/multibody/rational_py.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ PYBIND11_MODULE(rational, m) {
m.doc() = "RationalForwardKinematics module";
py::module::import("pydrake.math");
py::module::import("pydrake.multibody.plant");

type_pack<symbolic::Polynomial, symbolic::RationalFunction> sym_pack;
type_visit([m](auto dummy) { DoPoseDeclaration(m, dummy); }, sym_pack);

{
using Class = drake::multibody::RationalForwardKinematics;
constexpr auto& cls_doc = doc.RationalForwardKinematics;
Expand Down Expand Up @@ -91,9 +95,6 @@ PYBIND11_MODULE(rational, m) {
},
py::arg("s_val"), py::arg("q_star_val"), cls_doc.ComputeQValue.doc);
}

type_pack<symbolic::Polynomial, symbolic::RationalFunction> sym_pack;
type_visit([m](auto dummy) { DoPoseDeclaration(m, dummy); }, sym_pack);
}
} // namespace
} // namespace pydrake
Expand Down

0 comments on commit 9cf6905

Please sign in to comment.