-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
add libcamera to humble and rolling #35029
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this PR is adding a source entry for libcamera
, but that doesn't appear to be a ROS package. Did you intend to create a rosdep key instead? (maybe libcamera-dev
?)
Here's an example PR adding a rosdep key: #34920
There's some more info about adding rosdep keys here: https://github.com/ros/rosdistro/blob/master/CONTRIBUTING.md#rosdep-rules-contributions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is in ubuntu too. As such it should be targeted as a rosdep and not as a ROS package.
I'm going to close this. Please reopen it as a PR for a rosdep rule. |
This is indeed intended to be added as a colcon package to the ROS repo. The libcamera version distributed with Ubuntu is outdated. The relation is the same as for https://packages.ubuntu.com/jammy/apriltag and Is there a reason why a more recent version of libcamera cannot be distributed in the ROS repo? Can you please open this PR again and consider it for merging? |
Our policy is not to add packages to ROS which can conflict with packages available on the underlying platform, preferring instead to use the platform version. There will always be updates to packages that are compelling and "worth updating" for particular applications. But the objective of the official ROS repositories is to manage the entire ROS distribution together, and ensure as much mutual compatibility as possible. To achieve that we rely heavily on the work done by the much larger communities in Debian, Ubuntu, and our other target platforms to package and integrate software. In order to successfully build on top of those systems we also inherit some of their policies. In this case, avoiding packaging multiple versions of the same package. Since you raise apriltag as a counter-example, I'll start by saying that each of these cases has enough nuance to be considered individually and where possible I'll try to rely more on rationale than precedence, which is to say that rejecting or accepting libcamera on its own would not be a sufficient argument to accept or reject future packages in this same scenario. However the explained rationale for the decision is much more likely to be applicable to other packages in similar situations. The primary difference between apriltag and libcamera is that apriltag is already available in ROS and so there will be some effort/cost required in order to switch that to a system dependency. I think that the correct course of action is actually to drop the standalone apriltag package from Rolling, preferring instead the version available upstream, then when the next ROS distributions are branched from Rolling, they will use the system dependency naturally and the system version of apriltag is the one to keep up-to-date within the limits of stable distribution release cycles. There is nuance to this as Rolling's other platforms: Debian Bullseye and RHEL 8 may not be as well poised to supply a usable version of apriltag from their expected sources. However that gap could be bridged by transitioning the apriltag package in ROS to a vendor-style package which will only build and install apriltag if it cannot be found on the system. One situation where I could see a strong case for including a version of libcamera in ROS in spite of its availability on target platforms is if the version available from the system is unusably broken thus making it unlikely that any ROS package would ever interact with or cross-link with the system library. The requirements for demonstrating this would be exceedingly strict and on Ubuntu at least, would probably overlap with the Stable Release Update procedures which should be tried first before trying to push an updated version to the ROS repositories. I can't guarantee that you'll like this justification but I do hope it's at least understood and acceptable. I'll also point out that what I've written constitutes my own understanding and that it may not match precisely with the reasons given by other members of the ROS team. |
Looking at the apriltag repo we should start the transition to using the rosdep key instead of packaging it ourselves. Thanks for flagging that it's not available. I've ticketed to change that and not have us shadow the upstream version of that: #35273 |
I was not aware that such a policy exists. There always have been alternative versions of system packages in the ROS repos, e.g. for OpenCV, so I did not expect this to be suddenly a problem. Especially since the ROS workspace is a separate environment that has to be sourced first.
All those target platforms may have different versions of a library, or do not ship the library in question at all. How can we cover all those cases and make sure that a ROS package depends on the correct version?
I can only speak for libcamera. This is a relatively new library with an unstable API. The version in Ubuntu is already outdated. Having to rely on an outdated library with limited support for cameras for the whole duration of the Ubuntu 22.04 lifetime (5 years) is not promising. Most packages do not even receive that long support. For most packages, support ends after 2~3 years.
What would the expected outcome of this? Do you expect ROS users to track down the package maintainers for every supported Linux distribution and motivate them to update the package and push a new version to a stable release?
I can understand that you do not want to have the very same version in the system and the ROS repos. But for most situations, I don't see the advantage of relying on outdated packages for 5 years. ROS has published packages in the ROS repo, that also exist as system packages, for years. If you follow through with this policy, ROS 1 should not have been published in the ROS repos for Ubuntu 18.04 and 20.04 at all, since ROS 1 already exists as system packages ( |
Problems maintaining the in-ROS version of OpenCV and conflicts with the system version are part of what informed this policy.
It's mentioned in https://github.com/ros/rosdistro/blob/master/CONTRIBUTING.md#releasing-third-party-system-packages-into-a-ros-distribution but it's a relatively recent addition (2021) before that it was still part of our review process but addressed when observed on a case-by-case basis.
There is always going to be a trade-off, even with the most mature of packages, between stability and new fixes and features. For the ROS team, which is small and trying to cover a wide breadth of software, we rely on the work done by the communities around our base platforms (Debian, Ubuntu, RHEL + EPEL, etc) to provide as much of the system as possible so that the surface area that is unique to ROS is as tightly focused on ROS packages themselves. To that end, when packages are available for our base platforms, we want to avoid doing the work to integrate other versions of those packages again.
Our repositories exist to provide stable and up-to-date ROS packages, where "ROS packages" in this case refers to packages which are maintained by the ROS community and build on top of or specifically for the ROS core. For that reason the push toward and preference for upstream does not apply to these ROS packages.
The fact that there is no rosdep key at this time is, in my opinion, a decent indicator that few to no people are using this package in ROS at this time. And thus a case could be made for vendoring a "usable" version of this package in ROS distributions on Ubuntu 22.04 but with the expectation that when a comparable version is available upstream the upstream version will be used and that as time goes on the vendor package in ROS would go away entirely rather than continuously moving the goalposts so that the system version is never "adequate". @tfoote are there any that criteria would unblock a libcamera vendor package on 22.04 for you? I see the appeal in holding hard to policies and would respect it, especially as one of the people responsible for doing the system integration work but I'm also trying to be a pragmatist and make sure that we enable the community to ship useful software. |
In general the main thing that I want to do is not just cause future work for myself or whoever else has to deal with the fallout. It's always easier to just make it work now and discount the upstream package. But in reality the upstream package has a much broader community and user base. And if we just discount and override the package now, at some point in the future the upstream version will catch up and generate a non-trivial user base and at that point we'll be conflicting. And then we'll be the bad actor overriding it and breaking users who install ours on top. And then the question of how many people do we have to break before we have to fix it? In general we should not be doing anything that might break other use cases.
Unfortunately I don't find this argument very compelling. Everything in Ubuntu is typically outdated before it's released. It's a relatively long process to QA things and this means that the development tip is always out front. If you want to use an OS from 2022 that's has a stable API you should use 22.04. You can't expect to have both a stable LTS and the latest and greatest of the specific library of your choice. We hear this all the time that users want everything stable, except for the one library of their choice which they want the newest version. But when you step back and listen to everyone, they all want different libraries upgraded, and to meet all their requests, the platform is no longer stable. In terms of the support cycle, the debian/Ubuntu maintainers have committed to maintaining it for 5 years. If you have something that won't be supported for more than 2-3 years, it shouldn't be in a ROS release either. So in general what I think I would suggest is that if this is something that's important to you or a subset of users with you is that you make the effort to package it yourself for your use cases. For yourself and your users they can explicitly opt into overriding the system version. And whether you do this via a PPA or some other mechanism that's not a problem. But we shouldn't force the entire community to make that tradeoff. Optimally you'd be able to make that effort and push it upstream and then people won't have to make that trade-off and we with all the other users will get it by default without a conflict. |
First of all, thank you for taking the time to give those elaborative answers :-)
Thanks for sharing this, I did not know of this before. The section states that overlaying system packages is allowed if three conditions (install side by side, not cause compile errors, not cause linking errors) are met. For me, this means that
I kind of feel part of the (ROS) community :-) I am not expecting the ROS community to replicate a lot of system packages but I think providing newer versions of packages is justified in some cases. The motivation to go through all this trouble of creating
I think this just shifts the maintenance costs around. If different distributions provide different incompatible versions of libraries then a developer using these packages has to support every single version separately instead of providing one (newer) version for all the platforms.
I agree that a package released to the ROS repo must not interfere with system packages. But there are many ways to avoid this with versioning. Many distributions even provide multiple versions of libraries that can be installed in parallel themselves (see libsdl and libjpeg in Ubuntu) for many years now without issues. Having multiple versions of the same library is technically possible but of course, requires taking care of the versioning of libraries and include paths.
I do not understand what you mean here. Ubuntu has different support durations for different packages (see https://askubuntu.com/a/870909/704779). It is not 5 years for all packages. Some will only be supported for 3 years. There is no excuse for using outdated packages with functional or security issues.
I don't understand how this is going to work. If I package a dependency myself, e.g. as a ppa for |
Indeed if the proposed package fully isolated the library such that it wouldn't interfere with packages which were using the system version I would not object, but that wasn't what was proposed here.
The library is primarily in support of one package. You could host both an upgraded version of
That quote for different support cycles is from long ago. On my LTS distro 20.04 everything from Ubuntu is supported for the life of the distribution. That's the part of being in the distribution, Canonical stands by that.
|
I proposed to release the system version (Ubuntu 22.04)The system version uses upstream commit e7aa92a, dated 2020-05-02. That was already 2 years old when Ubuntu 22.04 was released 6 months ago. It installs a pkg-config file You can further verify that the headers are installed in the system include folder:
bloom versionA bloomed libcamera version ( Those paths and filenames clearly differ. The bloom and system packages can be installed and used side-by-side. Do you foresee other ways in which the bloom package |
That resolves the filesystem layout. But you need to both resolve compile time collisions and runtime collisions. At compile time, do you export any of the paths to those headers? If so do you do so in a way such that downstream packages would not accidentally find your headers instead of theirs depending on the potential include path order? For binary isolation have you isolated the binary symbols inside of the libraries such that if someone depends on your packages as well as any other one that happens to link against the system version of libcamera do you know that they won't collide the symbols. This usually requires renamspacing all the symbols in the library. |
I am not sure what exporting the header paths means here, but the *.pc files point to different locations for the headers (
and
Right. If you link both libraries at the same time, this will be problematic for symbols with different implementations. But where would this happen with libcamera? I don't foresee a use case where a program in the ROS workspace would indirectly link the system libcamera via a dependency and the libcamera version from the ROS repo. In fact, the system's Can you think of a case where symbol conflicts will happen with the system's Do you have an example where symbol conflicts in a driver library caused issues for ROS before? |
yes the headers are in different locations. But if you depend on both versions they will both be added to include path of the downstream package. If they have the same file name/path within the Include directory then the one which appears on first in the include search path will override the second one.
This is not a valid path of logic to know that our users will not hit this case. Just because you don't see anyone depending on it right now in released packages doesn't mean that it's not already a problem in packages that you don't know about. Similarly it doesn't mean that it will not be a problem for the rest of the lifetime of the distribution. And you've only scanned Ubuntu packages, not ROS packages. All packages start as leaf packages in the dependency tree when first released. But if they're useful packages they won't stay that way.
if this is a rosdep key any package could use the system version. Following that someone else might want to write a dependent package that wants to provide universal camera application (say a little gui to view any camera) So they create a GUI and add dependencies for all the camera drivers they define. And boom it crashes on them with binary inconsistencies.
This was a giant pain with OpenCV and PCL many years ago. We similarly tried to make justifications about why the impact would be minimal and then we had to dig out of a big mess because those cases that were assumed not to happen did and we had to do a lot of work to migrate it such that we found a way to not require packages to be silently fractured into ones that were compatible with the system version or the ROS packaged version. And it is why we added the rule that we don't end up with silent errors that fragments our communities packages due to incompatibility with other dependencies. All packages are expected to not conflict with any preexisting packages nor system packages, at installation time, compile time, or runtime. |
Summary: With the current set of packages in the Ubuntu and ROS repo, it is not possible to cause symbol conflicts with If
These two problems are compile-time issues that then be resolved by compiling only against the newer Even a program as simple as: #include <libcamera/libcamera.h>
int main(int argc, char **argv) {
libcamera::CameraManager camera_manager;
} will segfault in the global constructors even before reaching main. Given that there is no path to symbol conflicts using the current set of Debian packages in Ubuntu and ROS and that the system version is utterly broken, I am asking for an exemption of this rule for
I can see this happen when someone imports both packages ( As a counter-example, the
I scanned all of the registered package repos (Ubuntu + ROS). You can verify this by Symbol conflicts only become a problem if another ROS package depends on the system's
I fully understand the issues with "utility" libraries, such as OpenCV and PCL. These are used by many libraries, and those libraries are again used by other packages, causing all kinds of conflicts. But I don't think this is the case with "driver" libraries, as those are mostly used directly by programs.
Given that the system version is essentially unusable, I doubt that there will fragmentation between the two versions. Why would someone depend on a broken library when they could use the newer working version? |
@nuclearsandwich @tfoote @sloretz Given that is it practically impossible that someone will use Ubuntu's libcamera package on 22.04 due to the instant crash of any process that will use Ubuntu's libcamera (see above), can I get an exemption from the "no multiple versions, prefer system version" policy for the According to #35029 (comment), the broken Ubuntu package should be a case for:
|
Yes this would be a reason that we could consider overriding it on 22.04. Is there an upstream bug about this? Is it expected to be fixed upstream? What is the status of this bug in other distributions? If we say it's broken enough in 22.04 to consider overriding it that doesn't just give carteblanch for making a release. If we make a release of the ROS package now, what will be the migration plan for all users as we will default to using the system version for future platforms? |
I created an upstream bug report at https://bugs.launchpad.net/ubuntu/+source/libcamera/+bug/1999300.
I don't know. This is entirely up to Ubuntu. Given that the package is in "universe" and Ubuntu does not even guarantee regular security updates for those packages (https://help.ubuntu.com/community/Repositories) and my experience with the Eigen3 package in 16.04, I do not have high hopes that this gets fixed in the next 12 months.
I cannot give a detailed answer here. I am doing all this privately and I do not have an extensive test setup. A quick test on Arch Linux shows me that this works for version 0.2. For other distributions, I simply guess that newer versions do not have this issue. It would be helpful if others with different distributions could try to run the demo program too.
For releases beyond Ubuntu 22.04 where the system's libcamera works as expected, I suggest that we replace the bloom release with a rosdep key of the same name. This way the |
@tfoote @nuclearsandwich Is the migration plan for libcamera satisfactory? The idea would be to bloom-release libcamera to Ubuntu 22.04 to provide a working libcamera version because the system version is unusable. For future releases of Ubuntu, which provide working versions of libcamera, we would use a rosdep key referencing the system package. |
Ubuntu chose to ignore the libcamera issue for 22.04. It is unrealistic that Ubuntu will take the issue seriously and fix it. Releasing libcamera via bloom to the ROS repos is the only way to provide the libcamera dependency to other packages. @tfoote @nuclearsandwich Could you please reconsider this PR or let me know what other reasons speak against a working version of libcamera for 22.04? |
Ok, so we've confirmed that it won't be fixed. The migration plan, at a high level goal of what we want to achieve in the migration, for people on 22.04 to use the bloomed version and everyone else to use the system version. And in the long run people use rosdep keys. But a plan needs to be concrete for this case. If we release into humble and rolling now. That will cover 22.04, is libcamera verified as working on newer versions of Ubuntu? What about Debian and Fedora/RHEL? Does it need to be patched on those? We likely should be setting this up as a vendor package not a straight package so that it can detect the system version of libcamera and use that one if it's available. It's not great practice to try to make the rosdep key and package name have the same name as then you will end up with potential collisions and the maintainers can't know what their package will build against and be tested against. And rosdep keys aren't tied to specific distros. They span and potentially break others. We are doing less platform version spanning now but we don't want to rely on that. And the migration plan needs stories for developers and explicit instructions for what they should do if they're supporting each release. In particular, we need to be able to tell developers on humble and rolling what dependencies to add. And we need to be able to tell them when they should switch to the rosdep key directly. And if developers want a branch to span multiple distros what is possible/best practice. And when will they have to take action on the deprecation of the vendor package for an upstream package. |
From the distributions supported by ROS bloom releases, Ubuntu 22.04 has the broken libcamera version and RHEL 8 does not have a libcamera package at all. Debian 11 also does not have a libcamera package (the search for For future versions, e.g. from Ubuntu 23.04 (lunar) on, the described issue is not present any more. My expectation is that eventually, all major distributions will have a libcamera package without bugs.
My understanding from such a vendor package, e.g. libyaml_vendor, is that it will have a different package name than the original package and select at compile time if the upstream source version should be compiled or if the system version should be used. I think using a different package name than what would be used for the rosdep key has a negative impact on the transitioning strategy. As it is now (proposed here), we would have a bloom package with the name My second point against this is that we already know which distributions have a working version of libcamera. We do not need a compile time selection as we can already decide which distributions get the bloomed version and which one get the rosdep key.
As far as I can tell, you can enable/disable distributions and versions for a rosdep key, e.g. as done for Lines 2592 to 2607 in 4ffd760
My proposal is to do the same for a future
With the motivation of using the same package name and rosdep key, there is no need to switch the key or select which one to use. You simply keep the key in your But as stated above, generally I expect distributions to ship working libcamera versions and that bloom releases are only the fallback option. |
Please add the following dependency to the rosdep database. This is only the
source
for now in order to prepare for a new release repo (https://docs.ros.org/en/foxy/How-To-Guides/Releasing/Release-Team-Repository.html#create-a-new-release-repository).Package name:
libcamera
Package Upstream Source:
https://git.libcamera.org/libcamera/libcamera.git
Purpose of using this:
libcamera is a library for using different kind of cameras.
Please Add This Package to be indexed in the rosdistro.
humble, rolling