Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation for Ubuntu 18.04.4 LTS #93

Open
pryre opened this issue Feb 23, 2020 · 5 comments
Open

Compilation for Ubuntu 18.04.4 LTS #93

pryre opened this issue Feb 23, 2020 · 5 comments

Comments

@pryre
Copy link

pryre commented Feb 23, 2020

Not sure on the priority, but I have managed to get a running copy of raspicam_node on the new Ubuntu 18.04.4 LTS release using ROS melodic. Everything seems to be working as expected (except I haven't actually opened an image_view as I have to run headless for the time being).

The primary problem was a linking issue, similar to this. Compiling in catkin_ws gave a binary with the following linking (and some strange compiler warnings):

$ ldd raspicam_node | grep mmal
	libmmal.so => /opt/vc/lib/libmmal.so (0xb6b82000)
	libmmal_core.so => /opt/vc/lib/libmmal_core.so (0xb6b66000)
	libmmal_util.so => /opt/vc/lib/libmmal_util.so (0xb6b48000)

Adding the following line to CMakeLists.txt fixed this issue (and removed the warnings):

SET( CMAKE_EXE_LINKER_FLAGS "-Wl,--no-as-needed" )

Resulting binary was is linked as:

$ ldd raspicam_node | grep mmal
	libmmal.so => /opt/vc/lib/libmmal.so (0xb53ed000)
	libmmal_core.so => /opt/vc/lib/libmmal_core.so (0xb53d1000)
	libmmal_util.so => /opt/vc/lib/libmmal_util.so (0xb53b3000)
	libmmal_vc_client.so => /opt/vc/lib/libmmal_vc_client.so (0xb5397000)

The actual issue that is referenced above is a bit complicated for me to dive into at the moment, but this fix seems to work temporarily at least. Hopefully it helps anyone passing by.


Additional info: I would recommend reading this page for getting the native Pi packages set up. I also had to add the following to /boot/firmware/config.txt to get the Pi detected (adding it to usercfg.txt did no seem to work for both RPi2 and RPi4):

start_x=1
gpu_mem=128

The result was as detected shows:

$ vcgencmd get_camera
    supported=1 detected=1
@rohbotics
Copy link
Member

@pryre Thanks for opening this issue.

Seems like the link time optimizer is doing something incorrectly. Can you make a PR with the change that made it work?

Thanks!

@guillermoherreraf
Copy link

guillermoherreraf commented Mar 5, 2020

Hey @pryre! I've got ROS Melodic running on my RPI 4 (under Raspbian Buster). I managed to have a copy of the raspicam_node running, however when I run the tutorial.launch and afterwards I run rosrun rqt_image_view rqt_image_view there is nothing on the display... any idea what it might be?

Here is the erros message I get:

libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile

(python2:2364): GLib-GObject-WARNING **: 10:50:52.039: cannot register existing type 'GtkWidget'

(python2:2364): GLib-GObject-WARNING **: 10:50:52.039: cannot add class private field to invalid type '<invalid>'

(python2:2364): GLib-GObject-WARNING **: 10:50:52.039: cannot add private field to invalid (non-instantiatable) type '<invalid>'

(python2:2364): GLib-GObject-CRITICAL **: 10:50:52.039: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

(python2:2364): GLib-GObject-WARNING **: 10:50:52.039: cannot register existing type 'GtkBuildable'

(python2:2364): GLib-GObject-CRITICAL **: 10:50:52.040: g_type_interface_add_prerequisite: assertion 'G_TYPE_IS_INTERFACE (interface_type)' failed

(python2:2364): GLib-CRITICAL **: 10:50:52.040: g_once_init_leave: assertion 'result != 0' failed

(python2:2364): GLib-GObject-CRITICAL **: 10:50:52.040: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

(python2:2364): Gtk-CRITICAL **: 10:50:52.040: gtk_widget_size_request: assertion 'GTK_IS_WIDGET (widget)' failed

(python2:2364): GLib-GObject-WARNING **: 10:50:52.040: cannot register existing type 'GtkWidget'

(python2:2364): GLib-GObject-WARNING **: 10:50:52.040: cannot add class private field to invalid type '<invalid>'

(python2:2364): GLib-GObject-WARNING **: 10:50:52.040: cannot add private field to invalid (non-instantiatable) type '<invalid>'

(python2:2364): GLib-GObject-CRITICAL **: 10:50:52.040: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed
Corrupt JPEG data: 32793 extraneous bytes before marker 0xd9

@bltDefender
Copy link

@pryre @guillermoherreraf how did you manage to get it running under 18.04.4? I cannot build cause libraspberrypi0 is missing. Any hint welcome, I'm stuck.

@ChrisTayl2018
Copy link

ChrisTayl2018 commented Apr 28, 2020

I am having problems building this from src on Ubuntu Server 16.04 as well as it is unable to locate libraspberrypi-dev or libraspberrypi0. Also looking for any suggestions?

robo1@robuntudev:~/catkin_ws$ rosdep install --from-paths src --ignore-src --rosdistro=kinetic -y
executing command [sudo -H apt-get install -y libraspberrypi-dev]
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libraspberrypi-dev
ERROR: the following rosdeps failed to install
apt: command [sudo -H apt-get install -y libraspberrypi-dev] failed

@guillermoherreraf
Copy link

@bltDefender I changed to the usb_cam node. I could not manage to make the raspicam_node work with my system configuration. http://wiki.ros.org/usb_cam

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants