Let roboticists stress about boxes not packages
I learned about the complexity of package management during my previous job at Smart Robotics. At Smart Robotics, we extensively used ROS, the Robot Operating System. ROS is a collection of thousands of interdependent robotics-related packages.
At Smart Robotics, before we moved to conda, we had an in-house tool that concatenated multiple tools (apt
, docker
, pip
, cargo
) and provided a way of locking those installations into a single "reproducible" file.
However, the tool failed to deliver on a reproducibility aspect.
pip
packages often depend on apt installations that aren't locked together. Moving from one Ubuntu version to another is always a huge struggle. Users often prototype on their own machines, downloading lots of libraries into their global workspace, which can break existing projects.
Part of my job was to help new colleagues set up their clean laptops with an initial installation. This would "only" take 1.5 hours, with the knowledge how to fix small issues along the way. New colleagues could spend a full morning getting their first simulation running.
Improving the status quo
My team and I got assigned a project to improve this developer experience because of the huge amount of maintenance and support that came with it. My colleague Bas Zalmstra, who is also part of prefix.dev, came up with the idea of using conda as a single tool for the complete installation.
With a healthy amount of scepticism, I hopped on the conda train, and we quickly had our first working prototype.
This was all very much thanks to Wolf Vollprecht, currently the CEO of prefix.dev, as he helped us through all the conda kinks and showed us the power of tools that he authored: micromamba
, boa
, quetz
and the RoboStack project.
Fast, reproducible and independent ROS installations
Although we got an initial version working really quickly, we still weren't satisfied with the developer experience of the combination of these tools. So we started the journey of improving this experience.
For this project had a few requirements:
- Simple: a single entry point for the user.
- Fast: get the 1.5 hours down to 10 minutes.
- Reproducible: allow for locking all dependencies for an application so our projects actually become reproducible (e.g., also over ubuntu versions).
After building the wrapper around the before-mentioned tools from Wolf, I would say we succeeded on all of these points. Any Developer in the company could do a reproducible software installation of a robot within 10 minutes.
My life as a software maintainer became more calm, we could focus on what was really important for our robots: Motion Planning, Application Design, Computer Vision etc. Creating this project has shown me the power of the conda ecosystem and the exceptional usefulness of it in Robotics
This whole experience motivated me to join prefix.dev and make a tool that can be shared with the world to improve the developer experience of complex projects.
Pixi
Currently, at prefix.dev we are developing the pixi
tool.
pixi
is not a robotics-specific tool, but we've taken the lessons learned from my experience at Smart Robotics and modern package managers: reproducible dependencies thanks to lockfiles, scoped to a single project, and works exceptionally well for robotics thanks to RoboStack.
Simple, fast and reproducible environments to develop, test and deploy with. Those are the features we want for our users. These features give a higher level of collaboration opportunities that were not possible before.
The RoboStack initiative
RoboStack has a clever build system to rebuild numerous ROS packages to work in harmony with the conda ecosystem, allowing a paradigm shift in the ROS development environment. No more development in Docker containers, limited ROS version by the OS distro, breaking one workspace with the development of another workspace.
In practical terms, the combination of RoboStack with pixi
means two big improvements for ROS developers:
- Platform Independence: You're no longer bound to a specific Ubuntu distribution to install ROS packages, opening new avenues for users across most platforms. It even works on macOS and Windows!
- Environment Isolation: RoboStack allows for the installation of multiple ROS versions (ROS1 AND ROS2) in separate environments without causing interference, ensuring stability for complex applications.
Moreover, the RoboStack project constantly evolves, always open to incorporating more packages. This continuous expansion drives the ROS ecosystem towards easier use and better future proving of the projects.
In summary, the RoboStack initiative, alongside pixi
, is going to give a more streamlined and accessible path into robotics programming.
Note
When I talk about packages, I'm talking about a binary software package. This is a variant of packages that are pre-built that you install and can use as a library or executable directly.
Try pixi with ROS now
Even though pixi is under rapid development, it is already very helpful for roboticists!
Check out our frontpage to learn how to install pixi
with just one command.
We've got three examples with different complexities to show you what's possible:
- A bare-minimum turtlesim example. This Installs ROS2 and gets turtlesim up and running. A quick way to dive in.
- A minimal Nav2 example. Sets up ROS2, Nav2, and Gazebo for simulating a real robot. Great for those getting into more advanced stuff.
- A real ROS2 workspace. This is a complete ROS2 workspace as a Pixi project, featuring two custom packages for turtlesim, one in C++ and one in Python.
Project | Cached install time | Without cache |
---|---|---|
ros-humble turtlesim (~730MB) | 0m2,4s | 0m37,4s |
ros-humble navigation2+gazebo (~1.1GB) | 0m6,0s | 1m0,7s |
Each example shows how pixi simplifies setup and management, making life easier for anyone using ROS.
There is no need for a global ROS installation; versions are pinned from the highest level ROS package, up to the C++ compiler.
This provides a level of reproducibility that is hard to create with apt
and friends.
The slowest part in the example is the downloading of conda packages.
But because pixi has a smart caching system, only the first installation will be "slow" depending on your internet speed.
Because the caching works across project boundaries.
After the initial download, it should be a matter of seconds to set up a new project.
Just run git clone
, try pixi run start
and you're good to go!
Why conda is the solution for robotics
For robotics, in particular, there are three main benefits over the other options.
- Everything in one manager.
Most applications are written in one language and can use its dedicated package manager (e.g
cargo
,pip
,npm
). For robotics this is almost never the case. During my time at Smart Robotics we've used C++, Python and Rust interchangeably. Conda allows you to install ROS, python, opencv, compilers, deeplearning (models), drivers, development tools, ... you name it! - Binary package manager. When compared to source package managers / Git repositories, managing your work with a binary package manager makes it really fast for every developer to install your work. As you will avoid the compilation of project dependencies.
- The RoboStack initiative. Robotics, machine learning and AI often use the same dependencies. Conda was prepared for this use case, it has a large community building and packaging ROS packages into the conda ecosystem.
Getting the pixi project into your hands for you to try all this out is the most important step. The GitHub readme and our documentation should provide you with the instructions you need to get started.
We have a Discord server where we hang out for chats with pixi, mamba and conda enthusiasts! We would love to know what you think about pixi and how we can make it work for you!