borglab / GTDynamics

Full kinodynamics constraints for arbitrary robot configurations with factor graphs.
BSD 2-Clause "Simplified" License
39 stars 10 forks source link

Python `Simulator` Error on my machine (M1?) #244

Closed gchenfc closed 3 years ago

gchenfc commented 3 years ago

Same error message as in #128, when I run python-test on my local machine I get this error:

======================================================================
ERROR: test_simulator (test_simulator.TestLink)
Test simulating two steps on a simple one-link robot.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/gerry/GIT_REPOS/GTDynamics/python/tests/test_simulator.py", line 49, in test_simulator
    results = simulator.simulate(torques_seq, dt)
RuntimeError: EliminateCholesky was called with a request to eliminate variables that are not
involved in the provided factors.

But it's passing in the CI. I'm running MacOS 11.3.1 on M1. Perhaps some python library version (e.g. numpy) or architecture dependence?

Similar to what @yetongumich was saying, doing something like

gfg = graph.linearize(values)
gfg.optimize()

Still throws this error and I don't see how this is possible (we aren't passing any Values object to the Gaussian factor graph so how are there extra keys???).

I didn't go into detail like Yetong to check in C++, but I think this may have something to do with constrained noise models. In the cable robot code, I got several errors like this and changing the constrained noise models to small-sigma fixed them.

gchenfc commented 3 years ago

See #248 for root cause: Related to

  1. In constructor JacobianFactor(GaussianFactor) RTTI does not correctly identify when arg is already a JacobianFactor
  2. Elimination needs to switch to QR when there are constrained noise models but it doesn't for some reason - probably another instance of RTTI failure.