前文我们提到 talker.py 文件的时候遇到的错误,我们现在来解决这个错误
mkdir -p catkin_workspace/src
cd catkin_workspace
catkin config -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYTHON_INCLUDE_DIR=/usr/include/python3.6m -DPYTHON_LIBRARY=/usr/lib/aarch64-linux-gnu/python3.6m.so
# Instruct catkin to install built packages into install place. It is $CATKIN_WORKSPACE/install folder
catkin config --install
git clone https://github.com/ros-perception/vision_opencv.git src/vision_opencv
apt-cache show ros-kinetic-cv-bridge | grep Version
cd src/vision_opencv/
git checkout 1.13.0
cd ../../
catkin build
或者 catkin build cv_bridge
先进行 source 操作,把cv_bridge 写入环境配置
# 这里 --extend 参数的作用是让这次的路径配置不影响之前配置好的路径,否则这一次source会覆盖掉之前配置的路径。
source install/setup.bash --extend