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

py mbp: Expose autodiff and symbolic scalar types #11240

Closed
11 tasks done
EricCousineau-TRI opened this issue Apr 12, 2019 · 12 comments
Closed
11 tasks done

py mbp: Expose autodiff and symbolic scalar types #11240

EricCousineau-TRI opened this issue Apr 12, 2019 · 12 comments

Comments

@EricCousineau-TRI
Copy link
Contributor

EricCousineau-TRI commented Apr 12, 2019

Relevant Slack discussion:
https://drakedevelopers.slack.com/archives/C2CK4CWE7/p1555082817001300?thread_ts=1555024805.009600&cid=C2CK4CWE7

Thanks Russ and Michael!
Russ: do you mean something like this?

q = prog.NewContinuousVariables(plant.num_positions())
context = plant_sym.CreateDefaultContext()
plant_sym.SetPositions(context, q)```
If yes, here I get: `'System_[Expression]' object has no attribute 'SetPositions'`.

Check list:

\cc @TobiaMarcucci @RussTedrake @hongkai-dai

@EricCousineau-TRI
Copy link
Contributor Author

Added checklist. I'm going to tackle the first few items to figure out the general procedure and do some much-needed cleanup.
After binding .common.eigen_geometry, may request help from @m-chaturvedi.

\cc @jamiesnape

WIP Branch: master...EricCousineau-TRI:issue/11240-wip

@EricCousineau-TRI
Copy link
Contributor Author

Primary diff with scalar type change for eigen geometry: fc331ee

https://drake.mit.edu/python_bindings.html#differences-with-c-api

@mpetersen94
Copy link
Contributor

Is there an eta for autodiff support of RigidTransform/RotationMatrix in python? I'm happy to help with the process if that would accelerate the timeline at all.

@m-chaturvedi
Copy link
Contributor

m-chaturvedi commented May 31, 2019

I'm working on it. I need to write the relevant tests for it. I need to know from Eric which all methods need to be exposed other than RigidTransform and RotationMatrix. I'll try to finish it asap, so in a couple of days.
EDIT: Here, the PR: #11563

@EricCousineau-TRI
Copy link
Contributor Author

Er, added my thumbs-up without answering!
To clarify, it would be best to bind all methods that are scalar-type depended, unless there are issues.
If there gets to be too much boiler-plate for instantiating unittest test cases, then it should be simple enough to simplify that, helping with aliases and all that.

@EricCousineau-TRI
Copy link
Contributor Author

@mpetersen94 -- @m-chaturvedi just landed that PR. At present, the only thing not fully supported is RigidTransform_[T].translation() - but that should be resolved via #11575.

@gizatt
Copy link
Contributor

gizatt commented Jun 5, 2019

(Posting at request of Hongkai / Eric) As I understand it this is blocking Python binding of StaticEquilibriumConstraint -- for timeline purposes, I'd love to have access to those bindings in a week or so, but I can adjust if that looks like it won't happen. Thanks!

@EricCousineau-TRI
Copy link
Contributor Author

Per f2f, we will target next Friday, June 14th. Thanks!

@EricCousineau-TRI
Copy link
Contributor Author

Per Slack convos, @m-chaturvedi is almost there; wrangling some issues with scalar type conversion with MBP+SG and matrix aliasing per #8116

@EricCousineau-TRI
Copy link
Contributor Author

Done! Thanks @m-chaturvedi!

@EricCousineau-TRI
Copy link
Contributor Author

(Even though #11575 is not yet resolved, can still fix that separately without needing this to be open.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants