Snapdragon Camera Libraries
Hello, this might be out of ModalAI's realm of support, but we are migrating the voxl-camera drivers from ROS to ROS2. We run ROS at the yocto base layer. For ROS2 we needed to upgrade our GCC compiler to 7.5.
After adapting the code to fit ROS2, I ran into the issue of linking errors to the camera library. I receive errors like this:
libSnapdragonCameraManager.so: error: undefined reference to 'camera::CameraParams::getSupportedPreviewFormats[abi:cxx11]() const' libSnapdragonCameraManager.so: error: undefined reference to 'camera::CameraParams::set(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' libSnapdragonCameraManager.so: error: undefined reference to 'camera::CameraParams::setPreviewFormat(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
Since the SnapCameraDragon library passed initial build, it is correctly finding the camera.h and camera_parameter.h include files. However, I believe the root of this error is as follows: since the snapdragon camera manager library is compiled with a newer version of gcc, it cannot correctly link to the libcamera* libraries.
I would greatly appreciate a point in the right direction to obtain the source to compile with a new version. Also if it is part of the snapdragon SDK or hexagon SDK it would be great on steps for how to recompile those libraries with a new compiler in docker.
Any kind of help, big or small, would be greatly appreciated. Thank you so much!
A couple of thoughts
- Are you compiling for armv7, the camera libs are all 32-bit
- The camera library is called libCamera.so, where did the other name come from?
Yes, I am compiling on board for armv7. It seems to be that there is an incomptability for the libCamera.so library to be used in GCC 7.5. SnapdragonCameraManger uses defines the "camera" library as a dependency in CMakeLists.txt. I believe the solution is to compile a new libCamera.so, but I do not know where to find the source code or an updated version of the library.
I don't think libCamera can be built without access to Qualcomm's proprietary code.
The quickest path would likely be to use voxl-camera-server and create a voxl_mpa_to_ros2 based off of this project voxl_mpa_to_ros
@Chad-Sweet Okay thank you for the help. Do you think this link is the source code used https://android.googlesource.com/platform/hardware/interfaces/+/master/camera
It looks very similar. Also do you know what Qualcomm SDK the camera library would be apart of?
The source is here for the non-TOF supported version.
I do not think that is a good path, and we have no ability to support that. It is likely to cause a cascade of dependencies that need to be updated with the compiler.
voxl-camera-server access the camera at a lower level than libCamera and shares frame data in a pipe, like v4l. It's pretty straight-forward to add a ros2 publisher using that. we have plenty of ARMv8 clients for that, and you can use whichever compiler you like.
Okay thank you very much for the help!!