cv_bridge converts between ROS 2 image messages and OpenCV image representation for perception applications. As follows:
This ros2 branch initially derives from porting on the basis of ros kinetic branch
Firstly, it assumes that the ROS 2 core
has already been installed, please refer to ROS 2 installation to get started.
OpenCV3+ is a must to install, please refer to the official installation guide from OpenCV Tutorials Since ROS 2 uses Python 3, please make sure that python3-numpy is installed, or install like this:
sudo apt install python3-numpy
The cv_bridge python backend still has a dependency on python boost (equal or higher than 1.58.0
), and install them as follows in Ubuntu:
sudo apt install libboost-python-dev
cd <YOUR_ROS2_WORKSPACE>/src
git clone https://github.com/ros-perception/vision_opencv.git -b ros2
cd ..
colcon build --symlink-install
Python tests have a dependency on OpenCV Python support. To install it:
sudo apt install python3-opencv
Next to prepare runtime environment and run tests:
source <YOUR_ROS2_WORKSPACE>/install/local_setup.bash
colcon test
boost endian
: remove boost endian APIs with standard C++ 11 or higher instead- Not tested with Windows or macOS environments so there may be issues building or running