Publishing MIPI camera images with ROS2 on a RPI4

Using the 64-bit beta of Raspberry Pi OS I can compile ROS2 dashing source (ROS2 requires 64-bit). And it seems to run. But when I try to compile the MIPI_Camera examples, they complain about an incompatible version of libarducam_mipicamera.so. The installed libarducam_mipicamera.so is a 32-bit ARM library. Is there anywhere to get the 64-bit ARM version of this library?

My goal is to create a ROS2 node running on the RPI4 that will published ROS2 messages containing images from the Arducam MIPI camera. It should be an easy node to create once I get the correct version of libarducam_mipicamera.so. Has anyone already done this?

Thanks!

Hello,

Sound great. Would you like to share the sysytem and ROS2 you are using? I will try to help you recompile MIPI_Camera.

I got the Raspberry Pi OS here: https://www.raspberrypi.org/forums/viewtopic.php?f=117&t=275370

It would be great if you could recompile MIPI_Camera for this system.

Thanks,

peter

I used this OS image on a PI4: https://www.raspberrypi.org/forums/viewtopic.php?f=117&t=275370

If would be wonderful if you could recompile MIPI_Camera for this system.

Thanks,

peter

OK,

Thanks for sharing the link. I will test it when I have time.

 

 

Hello,

I have recompiled the lib on the ros aarch64 system. Due to it does not exist wiringpi 64bit, so I optimize our Makefile and please download our new code to retry.

https://github.com/ArduCAM/MIPI_Camera

The library is under https://github.com/ArduCAM/MIPI_Camera/tree/master/RPI/lib/aarch64 path

 

Thank you very much for recompiling under the aarch64 system. I downloaded the new library and was able to compile and link the sample MIPI_Camera programs. However when I run any of them I get the following messages:

Open camera

Hardware platform c03111

Segmentation fault

 

I have a UC-599 hooked to the CSI port of a RPI4.

Thanks,

Hi,

Don’t worry I will help you test it today.

 

Hi There,

Any updates on the support for aarch64?

I have had partial success, I filed two issues on github yesterday for a segfault and a hang , just writing here to make it more visible.

Thanks,

Alon

Hello alon,

Very sorry for my late reply. I am so busy recently. Recently, I am optimizing our MIPI_Camera driver. Due to the wiringPi library has stop their maintain. and the CM4 has released. I am optimizing our library to support it using new GPIO driver. I will test it today and reply you as soon as possible

Hello,

I have updated our libarducam_mipicamera.so for aarch64 bit. Please download the new library and try again.

Feel free to let me know if you need more help.

Hi bin/keymaster,

Thanks for the update!

I would be happy for any update, hope you find something.

Alon

p.s. what is your plan for v4l2 support on aarch64?

Hello,

You are welcome.

I am also considering compiling a v4l2 driver for a aarch 64-bit system.

 

 

Hi,

The updated binary under aarch64 is actually ELF 32 bit, seems accidentally to be identical to the 32bit version. Can you please fix it? Thanks in advance,

Alon

file output:

libarducam_mipicamera.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=1a47b6955291375e9b1b30d0e67f42daa6d98675, not stripped

https://github.com/ArduCAM/MIPI_Camera/blob/master/RPI/lib/aarch64/libarducam_mipicamera.so

(https://github.com/ArduCAM/MIPI_Camera/commit/0f2ad8c1c5bdd2df7553d425c413d2dae276dc0e)

ping

 

Hello,

Sorry for reply you so late, I am very busy recently. I will check it again tonight. Please try it again later.

 

Hello,

Sorry for my late reply.

I have solved the issue and I know the issue. At first I enable the arm-64bit=1 to starts the processors up in 64-bit mode. But the lib is still 32 bit. Now I use a arch64 system to compile it.

I find it does not have mmal and we can’t get many so files about mmal. So we need to create mmal firstly. Then compile our new libarducam_mipicamera.so.

Please try our new lib and following the user guide. https://github.com/ArduCAM/MIPI_Camera/tree/master/RPI/lib/aarch64

Feel free to let me know if you need more help.

 

Hey Bin,

Thanks for taking the time to make a new lib! I will try it. Regarding the manual which instructs to build raspberry pi userland libmmal from source, I currently am using the libraries via debian:

 

`

dpkg -S /usr/lib/aarch64-linux-gnu/mmal

libraspberrypi0: /usr/lib/aarch64-linux-gnu/libmmal.so
libraspberrypi0: /usr/lib/aarch64-linux-gnu/libmmal_components.so
libraspberrypi0: /usr/lib/aarch64-linux-gnu/libmmal_core.so

`

Which comes from here:

`

robot@larry:~$ apt info libraspberrypi0
Package: libraspberrypi0
Version: 0~20200520+git2fe4ca3-0ubuntu2
Status: install ok installed
Priority: optional
Section: libs
Source: raspberrypi-userland
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Serge Schneider <[email protected]>
Installed-Size: 1063 kB
Depends: libc6 (>= 2.28)
Homepage: https://github.com/raspberrypi/userland
Download-Size: unknown
APT-Manual-Installed: yes
APT-Sources: /var/lib/dpkg/status
Description: EGL/GLES/OpenVG/etc. libraries for the Raspberry Pi’s VideoCore IV
This package contains implementations of EGL, OpenGL ES, OpenVG, OpenWF
Composition, and others for the Raspberry Pi’s VideoCore IV multimedia
processor.

`

Do you think it is ok or do you suggest I rebuild from source?

Alon

Hello,

I am not sure if it is OK. As normal. the mmal lib is 32 bit and it does not support 64bit. The Pi’s official provide a way to recompile the lib. You can try your current library. If does not work. You can recompile the lib following the user guide I attached for you.

 

Hi,

I have followed the instructions at the link below but I’m unable to get my MIPI camera working on Raspberry Pi OS 64-bit. When I try to run ‘./arducamstill -t 0’ I’m given a segmentation fault and the Pi locks up completely.

https://github.com/ArduCAM/MIPI_Camera/tree/master/RPI/lib/aarch64

Was anyone else able to get this working?