bipedal-locomotion-framework: Error when using the python bindings on the master branch of blf
I recently tried to use the most updated version of blf (master branch), encountering issues in the exploitation of the python bindings.
More specifically, if:
- a new RL docker container is created
- the missing dependencies for blf (i.e. spdlog, manif and ospq-eigen) are installed (spdlog via apt, devel branch for manif and master branch for ospq-eigen)
- the master branch of blf is compiled and installed
Then a simple import bipedal_locomotion_framework
within ipython returns:
terminate called after throwing an instance of 'pybind11::error_already_set'
what(): SystemError: <built-in method __contains__ of dict object at 0x7fd340ab23c0> returned a result with an error set
Aborted (core dumped)
By using instead previous blf commits such as:
- the commit in ProjectsTagsStable.cmake (which doesn’t require to install any further dependency in the docker container)
- the commit implementing the IK (which requires to install spdlog and osqp-eigen to compile all the modules of blf)
the exploitation of the python bindings does not create any issue.
I will try to understand exactly from which commit (and/or associated dependency installation) on such an error appears, so that It can be easier to solve.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 15 (14 by maintainers)
Remember to update the import statement so that when the backward-compatible import that @GiulioRomualdi kindly implemented will be removed, you don’t have to update your code.
If the problem is solved, go ahead and close the issue.
After a few modifications inspired by the python tests and by the commit on restructuring the python bindings in submodules, I was able to successfully run my scripts in the updated environment.
To summarize, the errors described in this issue are solved by installing
manifpy
viapip install git+https://github.com/artivis/manif@devel
. If you agree, we can close this issue.Yes, everything was kind of blocked by https://github.com/TartanLlama/optional/pull/45, but at least that one unblocked now.
Yes, that error is solved. I will now try to update my scripts looking at the successfull tests for each module of the bindings. I will keep you updated here in case further issues appear.
Before I
exec
ed in the wrong container without noticing (too many open in the same time xD). I followed pretty much the same steps and I reproduced the original error. It’s very likely related to an oldpybind11
version shipped in Ubuntu Focal. In the previous comment I used the version gathered bypip
that is the most updated (however you have to point CMake to the right folder).Installing manif as commented above solves the import error.
TL;DR
, I don’t think we need to do much from the blf side. The cryptic error occurs only with outdated pybind11 versions (sadly, also that shipped in Focal). I’m not sure if we can find a better workaround @GiulioRomualdi.The expected behavior is that, after you
import bipedal_locomotion_framework
, a Python exception get raised instead of a C++ exception. I would expect anImportError
.I’d leave this issue open, we have to figure out what’s missing in our side to bind the C++ exception to the Python exception during the early stage of import.
A good candidate for checking when this problem started to occur is https://github.com/dic-iit/bipedal-locomotion-framework/pull/238, on a similar setup I’m still using the commit tagged by the superbuild that does not yet include the changes of that PR.
Maybe related to the usage of
py::module::import
? See https://github.com/pybind/pybind11/issues/686. Can you check if you have themanifpy
module in your system?