stephane-caron / pink

Python inverse kinematics based on Pinocchio
Apache License 2.0
191 stars 12 forks source link

Improve joint limit computations #12

Closed stephane-caron closed 1 year ago

stephane-caron commented 1 year ago

Performance increase is 5x as of 3f2feae3396bbc847a843b34c9ce162f75e55596 (on Upkie model):

In [1]: from pink.limits import compute_velocity_limits_2, compute_velocity_limits             

In [2]: %timeit compute_velocity_limits(configuration, dt)                                     
68.1 µs ± 5.7 µs per loop (mean ± std. dev. of 7 runs, 10,000 loops each)

In [3]: %timeit compute_velocity_limits_2(configuration, dt)                                   
13.4 µs ± 596 ns per loop (mean ± std. dev. of 7 runs, 100,000 loops each)