We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This is a workaround for cv_bridge_boost's ImportError with ROS2 on Windows (humble). I hope this helps anyone encountering the same error.
OpenCV_DIR
BOOST_ROOT
Nodes using CvBridge work as expected.
Nodes using CvBridge will exit with the following error.
ImportError: DLL load failed while importing cv_bridge_boost: The specified module could not be found.
It need to add DLL paths explicitly. Add the following snippet before importing CvBridge.
import platform if platform.system() == 'Windows': import os from pathlib import Path from ament_index_python.packages import get_package_prefix dll_dir: Callable[[Path], Path] = lambda p: next(p.rglob('*.dll')).parent for d in [ Path(os.environ.get('BOOST_ROOT')), Path(os.environ.get('OPENCV_DIR')), Path(get_package_prefix('cv_bridge')), ]: os.add_dll_directory(dll_dir(d)) from cv_bridge import CvBridge, CvBridgeError
The text was updated successfully, but these errors were encountered:
Related issues: #247, ms-iot/ROSOnWindows#371
Sorry, something went wrong.
No branches or pull requests
This is a workaround for cv_bridge_boost's ImportError with ROS2 on Windows (humble).
I hope this helps anyone encountering the same error.
Environment
OpenCV_DIR
.BOOST_ROOT
.Steps to reproduce issue
Expected behavior
Nodes using CvBridge work as expected.
Actual behavior
Nodes using CvBridge will exit with the following error.
Workaround
It need to add DLL paths explicitly.
Add the following snippet before importing CvBridge.
The text was updated successfully, but these errors were encountered: