How to add cv_bridge support in code generation ?
Mostrar comentarios más antiguos
I have a ros2 Gazebo environnement with a camera in it that output its data to a topic and I'm developping a simulink node to process the video. I made a simple simulink block that subscribe to the ROS2 topic, read the image and then ouput the result with a Video Viewer block. When I run it in Simulink there is no problem the Video is stream correctly. However, when I try to generate the ROS2 c++ node with the "Build model" option the colcon build fail with the following error:
CMake Error at CMakeLists.txt:22 (find_package): By not providing "Findcv_bridge.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "cv_bridge", but CMake did not find one. Could not find a package configuration file provided by "cv_bridge" with any of the following names: cv_bridgeConfig.cmake cv_bridge-config.cmake Add the installation prefix of "cv_bridge" to CMAKE_PREFIX_PATH or set "cv_bridge_DIR" to a directory containing one of the above files. If "cv_bridge" provides a separate development package or SDK, be sure it has been installed. -- Configuring incomplete, errors occurred!
First I was thinking that it was just missing the cv-bridge or the opencv package but they seems to be already installed. I'm a beginner in ROS and simulink coder so I don't really get what is the procedure to solve the dependency issue ?
Respuestas (1)
Josh Chen
el 25 de Oct. de 2023
0 votos
Hi Nicolas,
Since you mentioned that both packages seem to be already installed. I assume you are trying to build and run the model on the remote device where you run the ROS 2 Gazebo environment?
Could you please select "Remote Device" under "ROS" tab > "Deploy to" in your model and configure the device information before generating the code?

Note that both packages are installed on remote device, so local code generation (meaning if you are trying to generate code to local device) will not work.
Let me know if my assumption is not correct.
Josh
6 comentarios
Nicolas Thierry
el 25 de Oct. de 2023
Josh Chen
el 25 de Oct. de 2023
Hi,
Thanks for clarifying the setup. Could you please try opening a terminal, navigating to the build directory, source your local ROS installation, and do 'colcon build' outside of MATLAB?
If you have a ROS 2 workspace folder, you can also copy the source code from the 'src' folder to ROS 2 workspace. Otherwise, you may need to remove some cache files and folders.
HTH,
Josh
Nicolas Thierry
el 25 de Oct. de 2023
Josh Chen
el 25 de Oct. de 2023
I remember seeing similar error before.
Which gcc version are you using? ($ gcc --version)
Not sure if this is related or not, but GLIBCXX_3.4.29 and GLIBCXX_3.4.30 are not available in gcc 10. If something was compiled with gcc10, and now gcc11, you may see this error.
Is there a simplified model you can share so I can try to reproduce on my end?
Nicolas Thierry
el 25 de Oct. de 2023
Editada: Nicolas Thierry
el 25 de Oct. de 2023
Nicolas Thierry
el 25 de Oct. de 2023
Categorías
Más información sobre ROS Node Generation and Deployment en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!