-
Notifications
You must be signed in to change notification settings - Fork 98
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
Add non-const overload for Root::Model() getter #1524
Conversation
This is consistent with the getters for World which also overload on const-ness. Co-authored-by: Sean Curtis <[email protected]> Signed-off-by: Jeremy Nimmer <[email protected]>
c1e3569
to
0e227a6
Compare
python/src/sdf/pyRoot.cc
Outdated
@@ -83,7 +83,7 @@ void defineRoot(pybind11::object module) | |||
"Get a world based on an index.") | |||
.def("world_name_exists", &sdf::Root::WorldNameExists, | |||
"Get whether a world name exists.") | |||
.def("model", &sdf::Root::Model, | |||
.def("model", pybind11::overload_cast<sdf::Model *>(&sdf::Root::Model), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are build failures related to this line. In the binding for World::PhysicsByIndex, the template argument to pybind11::overload_cast
is uint64_t
, which matches the input argument to that function not its return type. Maybe try reverting this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I added the overload_cast because it has a (different) compilation error without it, but indeed I spelled it wrong. I pushed a tweak that fixes the build now (just remove the template argument).
Signed-off-by: Jeremy Nimmer <[email protected]>
4fdb5ee
to
049a36f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for these contributions!
🎉 New feature
Closes (N/A).
Summary
Adds a non-const overload for
Root::Model()
getter. This is consistent with the getters forWorld
which also overload on const-ness.Test it
There are automated unit tests. Manual testing is unnecessary.
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.