Ask Your Question
0

Problems building melodic compressed_depth_image_transport on 18.04.

asked 2020-06-13 15:41:31 -0500

Following these instructions to do a source build of melodic desktop full (I want to build it with thread sanitizer because of something I'm debugging): http://wiki.ros.org/melodic/Installat...

I'm getting this error, I know it has to do something with OpenCV versions but I can't figure out how to fix it.

==> Processing catkin package: 'compressed_depth_image_transport'
==> Building with env: '/home/tyler/workspace/ws_ros_melodic/install_isolated/env.sh'
Makefile exists, skipping explicit cmake invocation...
==> make cmake_check_build_system in '/home/tyler/workspace/ws_ros_melodic/build_isolated/compressed_depth_image_transport'
==> make -j8 -l8 in '/home/tyler/workspace/ws_ros_melodic/build_isolated/compressed_depth_image_transport'
[ 16%] Built target compressed_depth_image_transport_gencfg
[ 33%] Building CXX object CMakeFiles/compressed_depth_image_transport.dir/src/codec.cpp.o
/home/tyler/workspace/ws_ros_melodic/src/image_transport_plugins/compressed_depth_image_transport/src/codec.cpp: In function ‘sensor_msgs::Image_<std::allocator<void> >::Ptr compressed_depth_image_transport::decodeCompressedDepthImage(const CompressedImage&)’:
/home/tyler/workspace/ws_ros_melodic/src/image_transport_plugins/compressed_depth_image_transport/src/codec.cpp:138:49: error: ‘CV_LOAD_IMAGE_UNCHANGED’ was not declared in this scope
         cv_ptr->image = cv::imdecode(imageData, CV_LOAD_IMAGE_UNCHANGED);
                                                 ^~~~~~~~~~~~~~~~~~~~~~~
CMakeFiles/compressed_depth_image_transport.dir/build.make:134: recipe for target 'CMakeFiles/compressed_depth_image_transport.dir/src/codec.cpp.o' failed
make[2]: *** [CMakeFiles/compressed_depth_image_transport.dir/src/codec.cpp.o] Error 1
CMakeFiles/Makefile2:1096: recipe for target 'CMakeFiles/compressed_depth_image_transport.dir/all' failed
make[1]: *** [CMakeFiles/compressed_depth_image_transport.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
<== Failed to process package 'compressed_depth_image_transport': 
  Command '['/home/tyler/workspace/ws_ros_melodic/install_isolated/env.sh', 'make', '-j8', '-l8']' returned non-zero exit status 2
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2020-06-14 06:08:49 -0500

gvdhoorn gravatar image

updated 2020-06-14 06:09:24 -0500

Do you have OpenCV 3.4 or 4.x installed?

According to ros-perception/image_transport_plugins#54 and a bunch of other Google results, those flags were renamed quite a few times between 2018 and now.

Melodic targets OpenCV 3.2 on Ubuntu 18.04 (see Melodic Morenia (May 2018 - May 2023) in REP-3). And with that: not the upstream version, but:

" * " means that this is not the upstream version (available on the official Operating System repositories) but a package distributed by OSRF or the community (package built and distributed on custom repositories).

You'll have to make sure you have that version or if you have others, CMake finds the required version first.

edit flag offensive delete link more

Comments

That was it, thank you. I have 4 installed because we are using it for a project that has another external dependency that depends on 4. I got by this by putting CATKIN_IGNORE filles in the two packages that wouldn't build in ros as searching my code I don't think we use them.

tyler-picknik gravatar image tyler-picknik  ( 2020-06-14 09:05:37 -0500 )edit

Seeing some of your other questions (here and on the MoveIt issue tracker(s)), I would perhaps suggest to look into using containers more.

gvdhoorn gravatar image gvdhoorn  ( 2020-06-14 09:22:40 -0500 )edit

I do use containers when I have to, but perhaps I should use them more.

tyler-picknik gravatar image tyler-picknik  ( 2020-06-14 11:10:31 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-06-13 15:41:31 -0500

Seen: 350 times

Last updated: Jun 13 '20