Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Unknown type DQ_robotics::SOMETHING #49

Open
mmmarinho opened this issue Jul 6, 2023 · 2 comments
Open

[BUG] Unknown type DQ_robotics::SOMETHING #49

mmmarinho opened this issue Jul 6, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@mmmarinho
Copy link
Member

mmmarinho commented Jul 6, 2023

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

  • Have a version of dqrobotics Python3 installed, let's call it XXX.
  • Try to make that work with another pybind11 compiled with a (slightly different) version of dqrobotics CPP (or environment), let's call it YYY.

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"
@mmmarinho mmmarinho added the bug Something isn't working label Jul 6, 2023
@mmmarinho mmmarinho self-assigned this Jul 6, 2023
@bvadorno
Copy link
Member

@mmmarinho, any new developments on this?

@mmmarinho
Copy link
Member Author

@bvadorno

The major cause for this was originally addressed in #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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants