chrono: Pychrono tutorials do not succeed

The first two Pychrono tutorials fail upon execution.

demo_python_2.py fails with:

time= 0.45000000000000023  bodyB y= 0.9982750315016988
Traceback (most recent call last):

  File "<ipython-input-1-31da8eea56df>", line 1, in <module>
    runfile('/home/felix/dev/pychrono-tutorials/demo_python_2.py', wdir='/home/felix/dev/pychrono-tutorials')

  File "/home/felix/anaconda3/lib/python3.7/site-packages/spyder_kernels/customize/spydercustomize.py", line 704, in runfile
    execfile(filename, namespace)

  File "/home/felix/anaconda3/lib/python3.7/site-packages/spyder_kernels/customize/spydercustomize.py", line 108, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "/home/felix/dev/pychrono-tutorials/demo_python_2.py", line 90, in <module>
    my_system.GetContactContainer().ReportAllContacts(my_rep)

  File "/home/felix/anaconda3/lib/python3.7/site-packages/pychrono/core.py", line 16530, in ReportAllContacts
    return _core.ChContactContainer_ReportAllContacts(self, *args)

RuntimeError: SWIG director method error. Error detected when calling 'ReportContactCallback.OnReportContact'

The “Report Contact Callback” and “Simulation loop” sections should be commented out until the “Add contact callback” is fixed.

demo_python_1.py fails on the line ma.SetMatr(mlist) with this error:

[...]
quat. product= [ 30, 0, 0, 0 ]
Traceback (most recent call last):

  File "<ipython-input-3-80a9b323cce9>", line 1, in <module>
    runfile('/home/felix/dev/pychrono-tutorials/demo_python_1.py', wdir='/home/felix/dev/pychrono-tutorials')

  File "/home/felix/anaconda3/lib/python3.7/site-packages/spyder_kernels/customize/spydercustomize.py", line 704, in runfile
    execfile(filename, namespace)

  File "/home/felix/anaconda3/lib/python3.7/site-packages/spyder_kernels/customize/spydercustomize.py", line 108, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "/home/felix/dev/pychrono-tutorials/demo_python_1.py", line 53, in <module>
    ma.SetMatr(mlist)   # Create a Matrix from a list. Size is adjusted automatically.

AttributeError: 'ChMatrixDynamicD' object has no attribute 'SetMatr'

If someone can give a hint about how to fix that issue, I can submit a PR along with some other minor fixes.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16 (8 by maintainers)

Most upvoted comments

I generally recommend to avoid installing packages in the base environment, to avoid issues like this (and worse). In your shoes I would uninstall pychrono in the base env and do everything in a new environment.

I have met the same issue and re-install the lib(pychrono-4.0.0-py37_402) from anaconda. The issue is not fixed.