Building ROS node with OpenCV
I'm trying to build a USB camera ROS node on the VOXL, that requires OpenCV and cv_bridge. I've installed the OpenCV 4.5.1 ipk using opkg, and see the libraries in /usr/lib64. I found the OpenCV cmake files so I added this path to the CMakeLists.txt:
However, when running catkin_make, I get this error:
CMake Error at /usr/lib64/cmake/opencv4/OpenCVModules.cmake:404 (message):
The imported target "opencv_core" references the file
but this file does not exist.
It seems like for some reason, the cmake file is looking for the modules in /usr/lib instead of /usr/lib64. What's the best way to fix this?
Check out an example of how to do this here: https://gitlab.com/voxl-public/modal-pipe-architecture/voxl-mpa-exposure/-/blob/dev/CMakeLists.txt#L49
@Chad-Sweet is the voxl-mpa-exposure private? I don't seem to be able to access it.
Whoops, please check again
@Chad-Sweet Thanks, I will try it out!
I had some additional issues with build dependencies, so now I'm trying to build a docker that's a combination of the opencv-opencl one and the roskinetic one. However, I'm now running out of space on the overlays while building the opencv portion:
symlink ../../Asia/Katmandu /data/overlay/0539659d5706b44f5832c3d53925cfe2647594de8f18b5708435028ddfdd630e/tmproot772012770/usr/share/zoneinfo/posix/Asia/Kathmandu: no space left on device
However, running df -H, it doesn't appear to be out of space.
Filesystem Size Used Avail Use% Mounted on
/dev/root 3.0G 1.7G 1.3G 58% /
devtmpfs 2.0G 0 2.0G 0% /dev
tmpfs 2.0G 0 2.0G 0% /dev/shm
tmpfs 2.0G 18M 2.0G 1% /run
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
tmpfs 2.0G 4.1k 2.0G 1% /var/volatile
/dev/sda2 2.3M 82k 2.1M 4% /persist
/dev/sde11 100M 35M 66M 35% /firmware
/dev/sde12 13M 4.3M 7.7M 36% /dsp
/dev/sda3 61M 41k 59M 1% /cache
/dev/mmcblk0p1 32G 33k 32G 1% /mnt/sdcard
/dev/sda9 16G 4.9G 11G 32% /data
Do you know what might be causing this and how I can get around it? I have a 32 GB micro-sd card, is it possible to use that instead of /data?
You can actually build an ARM docker on your Linux desktop. The build process uses tons of space, so tough to say exactly what you're running in to. But, you can definitely try offline and then load it on target. (it will build MUCH faster too!)
@Chad-Sweet oh thanks! I'll try that you! I actually want to try to use Ubuntu 18.04 / ROS melodic to be more aligned with our other systems. Do you know if the modalai opencl deb would still be compatible?
For the base docker image, would it be correct to just change:
(Apologies for all the questions, it's actually my first time building a docker image from scratch.)
All of those seem likely to work, though we haven't tried them so there could be some debugging required.
is there something specific I need to enable in docker (on the amd64 machine side) to be able to build the arm64 docker images? I'm getting this error:
Building OpenCV 4.2.0
Sending build context to Docker daemon 11.16MB
Step 1/48 : FROM aarch64/ubuntu:xenial
Step 2/48 : RUN apt-get update
---> Running in 23be03a5aa45
standard_init_linux.go:211: exec user process caused "no such file or directory"
The command '/bin/sh -c apt-get update' returned a non-zero code: 1