pybind11: Robot& parameter conversion fails in Python 3.10 but works in 3.8 #5899
Unanswered
lin19970227
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a C++ Robot class that is non-copyable and non-assignable. I've exposed it to Python using pybind11 as a Robot module. I also have another C++ class MassageBtManager with a constructor MassageBtManager::MassageBtManager(Robot& robot), which I've separately exposed as a massage_bt_pybind module.
When I initialize a Robot object in Python and try to pass it to initialize a MassageBtManager in Python 3.10, I get a conversion error, but it works fine in Python 3.8. How should I modify my MassageBtManager binding to make this work properly across different Python versions?

Module A: Define the Robot class and instantiate it in Python.
Module B: Define the MassageBtManager class and receive a reference to the Robot object.
If I use
py::init<flexiv::rdk::Robot&>(), Python 3.10 prompts thatflexivrdk.flexivrdk.Robotcannot be converted toflexiv::rdk::Robot.Beta Was this translation helpful? Give feedback.
All reactions