ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

What ROS packages strictly require OpenGL?

asked 2017-04-25 02:20:15 -0500

sam26 gravatar image

updated 2017-05-02 02:53:17 -0500

I am a Ubuntu 16.04, ARM user trying to fetch ROS-desktop onto my system. However, before installing ROS as mentioned in the instructions, there is a change I am expected to make. Whatever openGL implementation that ROS requires, I need to ensure that it is using my proprietary implementation and nor MESA libraries.

When I looked up for reverse dependencies on mesa libraries, I found only rviz component of ROS is using them. So, I manually wanted to modify the dependencies in the control file of the rviz debian package after downloading, to exclude mesa dependency. However, after making the changes and repacking the rviz debian file, I installed ros-desktop using

sudo dpkg -i ros-kinetic-desktop_......arm64.deb
sudo apt-get -f install

Doing a sudo apt-cache depends ros-kinetic-rviz now again displays a dependency on mesa although I have removed it from the control file. I would like to know the reason for this anomaly. Is it that any other ROS package uses mesa and is downloading them and automatically adding it to the rviz dependency list?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-05-02 03:34:41 -0500

gvdhoorn gravatar image

updated 2017-05-02 03:36:56 -0500

tl;dr: I don't think this is a ROS issue and I also don't think that changing the dependency declarations for each and every ROS package that might use OpenGL is the way to approach this.

This seems more like a platform / Linux distro packaging and configuration issue.

Package your lib properly, make that package properly register itself as a(n) (alternative) OpenGL library (either with Mesa or some other piece of infrastructure, I don't know), and maybe also make the package pretend it provides whatever dependency other pkgs might depend on (using the Debian provides key fi).

For inspiration: look at how the NVidia or AMD drivers register their OpenGL implementations. NVidia doesn't go around asking how they should change everyone else's packages to use their OpenGL libs, do they?


Linux binaries really don't care which particular package a library they are using came from. All they 'care' about (and that is in quotes because obviously these are lifeless collections of electrons with no sentience whatsoever) is that specific pieces of code can be found at specific addresses whenever they are needed. Whether that code is stored in libsomething.so.1.2.3.4.5 from libsomething-1.2_amd64.deb or in libmy_own_version_I_just_compiled.so built from sources does not matter.

In your specific situation: as long as your alternative OpenGL implementation is found before any others (or: is the only one registered in the system) it will be used. This is all completely orthogonal to whatever dependencies (debian) packages have specified.

To get your library used instead of another one I believe you have to do two things:

  1. put your library on the dyn lib loader search path so it gets loaded whenever a process needs libGL.so.1 (or whatever)
  2. make sure that the package manager understands that your package also provides whatever it is that is the 'normal' OpenGL providing packages contain (Debian control files allow you to specify a provides field for this).

This way, whenever an OpenGL implementation (read: dynamic library) needs to be loaded, yours is selected.

I'm not sure whether #2 is actually needed, but it could be necessary, depending on how OpenGL libs are registered with the system (and possibly to placate tools like rosdep and apt).

To implement this, I would try to find out how to register OpenGL implementations on Linux systems (probably only Ubuntu, as that is what most of your questions have been about). Once you solve that bit, I expect the rest (and not just ROS) to start using that automatically.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2017-04-25 02:20:15 -0500

Seen: 960 times

Last updated: May 02 '17