-
Notifications
You must be signed in to change notification settings - Fork 27
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
MultibodyPlant vs Pinocchio Performance #181
Comments
I'm making some progress on this -- found some inadvertent inner-loop heap allocations in MBP. Not sure yet how much those affect performance but they can't be good. Will fix shortly. |
FYI @mposa there appear to be some bugs in the test cases for autodiff of inverse & forward dynamics. Try setting the iteration counts to 1 in the test and run a Debug configuration (so that all the Eigen asserts are enabled). Looks like inconsistent use if |
Yes, you're right. I caught that when I added the comparison between gradient matrices, but did not bother fixing the for loops. The bug probably makes AutoDiff actually look better than it really is. |
A few benchmarks related to the center of mass evaluations: All units below are [seconds per 100,000 calls]. Without resetting drake context every loop:r_com time (Pinocchio):0.0406533 When resetting drake context in every loop:r_com time (Pinocchio):0.0988584 |
Thanks @yminchen! I see that the Pinocchio times changed in the second set also -- is there an equivalent of resetting the Context in Pinocchio? Also, can you say what you did specifically to "reset" the Context in Drake? |
@sherm1 Thanks for the question! I should've mentioned this in the previous post. The benchmark was done not directly on Pinocchio but PinocchioPlant (we derived this class from Drake's MultibodyPlant by overriding center of mass related methods). This is why there is a difference between with and without resetting context for Pinocchio. The extra runtime is from calling |
This is an issue to track Drake::MBP vs alternatives (currently Pinocchio). This example is on a Cassie URDF. Some comments on the plant:
Test code is https://github.com/DAIRLab/dairlib/blob/pinocchio/examples/Cassie/test/benchmark_dynamics.cc
To replicate:
pinocchio
branch of dairlibexamples/Cassie:benchmark_dynamics
. For non-Penn users, recommendStatus, July 18, 2020
As run on Michael's laptop
Summary (Drake, Pinocchio)
For numerical derivatives, approximating by double x 42 (counting fixed-base coordinates
nq=nv=16
andnu=10
)The text was updated successfully, but these errors were encountered: