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

Clean up mass_matrix! and constraint_jacobian! #532

Merged
merged 2 commits into from
Feb 2, 2019

Conversation

tkoolen
Copy link
Collaborator

@tkoolen tkoolen commented Feb 1, 2019

  • Add *(::Transpose(A), ::B) overloads involving WrenchMatrix, MomentumMatrix, and GeometricJacobian
  • Use these new overloads in mass_matrix! and constraint_jacobian!
  • add supports function and use it to further clean up mass_matrix!
  • Iterate directly over joint velocity indices in mass_matrix! and look up their corresponding JointIDs, instead of first iterating over JointIDs and then over their velocity_ranges.

The last point above results in a bit of a speedup for mass_matrix!:

Before:

  minimum time:     5.930 μs (0.00% GC)
  median time:      6.028 μs (0.00% GC)
  mean time:        6.211 μs (0.00% GC)
  maximum time:     9.859 μs (0.00% GC)

After:

  minimum time:     5.435 μs (0.00% GC)
  median time:      5.546 μs (0.00% GC)
  mean time:        5.741 μs (0.00% GC)
  maximum time:     9.264 μs (0.00% GC)

* Add `*(::Transpose(A), ::B)` overloads involving `WrenchMatrix`, `MomentumMatrix`, and `GeometricJacobian`
* Use these new overloads in `mass_matrix!` and `constraint_jacobian!`
* add `supports` function and use it to further clean up `mass_matrix!`
* Iterate directly over joint velocity indices in `mass_matrix!` and look up their corresponding `JointID`s, instead of first iterating over `JointIDs` and then over their `velocity_range`s.

The last point above results in a bit of a speedup for `mass_matrix!`:

Before:

```
  minimum time:     5.930 μs (0.00% GC)
  median time:      6.028 μs (0.00% GC)
  mean time:        6.211 μs (0.00% GC)
  maximum time:     9.859 μs (0.00% GC)
```

After:

```
  minimum time:     5.435 μs (0.00% GC)
  median time:      5.546 μs (0.00% GC)
  mean time:        5.741 μs (0.00% GC)
  maximum time:     9.264 μs (0.00% GC)
```
@tkoolen tkoolen merged commit 32a2ccb into master Feb 2, 2019
@tkoolen tkoolen deleted the tk/clean-up-mass-matrix branch February 2, 2019 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant