Simple-Robotics / aligator

A versatile and efficient framework for constrained trajectory optimization
https://simple-robotics.github.io/aligator/
BSD 2-Clause "Simplified" License
85 stars 11 forks source link

Bug in finite difference function in tests/python/utils.py #127

Closed edantec closed 2 months ago

edantec commented 5 months ago

Bug description

The finite difference function in tests/python/utils.py does not integrate correctly the Jacobian transport on Lie manifold. The test of finite differences for MultibodyFreeFwdDynamics is also lacking in Python.

Expected behavior

Working unittest for MultibodyFreeFwdDynamics using the finite difference function in tests/python/utils.py.

Reproduction steps

Steps to reproduce the behavior:

  1. Open unittest tests/python/test_continuous_dynamics.py
  2. In function test_multibody_free(), add finite difference test for MultibodyFreeFwdDynamics, e.g.:

    Jx0 = data.Jx.copy()
    Ju0 = data.Ju.copy()
    Jxdiff, Judiff = finite_diff(ode, space, x0, u0, epsilon)
    
    assert np.linalg.norm(Jxdiff - Jx0) <= epsilon
    assert np.linalg.norm(Judiff - Ju0) <= epsilon
  3. Run unittest
  4. See error
ManifoldFR commented 2 months ago

Is this still a problem ? Or did #128 fix it