dqrobotics / python

The DQ Robotics library in Python
https://dqrobotics.github.io
GNU Lesser General Public License v3.0
24 stars 9 forks source link

[BUG] Unknown type `DQ_robotics::SOMETHING` #49

Open mmmarinho opened 1 year ago

mmmarinho commented 1 year ago

Bug description

This is an issue to help me start tracking this bug as I haven't been able to fully identify when it happens.

To Reproduce

Problem

All sorts of bugs involving Unknown type and the DQ_robotics namespace, when XXX is different from YYY.

Solution

The Python3 version of dqrobotics can be fixed by being compiled locally. This mismatch might be due to the environment used to compile with GitHub actions, that might need adjustments (I'm looking at you, GCC version).

Remember to source your venv if you're using one

python3 -m pip uninstall dqrobotics
git clone https://github.com/dqrobotics/python.git dqrobotics_python --recursive
python3 -m pip install wheel scipy quadprog
python3 -m pip install ./dqrobotics_python 

cd dqrobotics_python/tests
python DQ_test.py
python DQ_Kinematics_test.py
python cpp_issues.py
python python_issues.py
cd ..

Concrete error examples

@qlin960618

>>> from adaptive_control_example import *
Traceback (most recent call last):
[...]
    from ._core import *
ImportError: generic_type: type "Example_SerialManipulatorEDH" referenced unknown base type "DQ_robotics::DQ_SerialManipulator"
bvadorno commented 8 months ago

@mmmarinho, any new developments on this?

mmmarinho commented 8 months ago

@bvadorno

The major cause for this was originally addressed in https://github.com/dqrobotics/python/issues/44. That fix should solve most occurrences caused by our choices and I also mention how to maintain it for future versions.

However, there are near infinite situations in which this import error can happen and most of them related to complex interactions with the user environment and advanced use of the library with custom Python bindings and custom C++ code. At this stage, I don't have enough information to propose a universal fix (beyond compiling locally as described above), but I'm sure this issue will resurface for advanced users.

When it does resurface, I'd prefer to center all the related discussion in this issue instead of having it spread between smaller, seemingly disjoint issues, when in fact they have the same underlying cause.