My usecase for doing this, is running ROS2 on a CPU which is located in a robot (pretty common I guess for ROS :D).
The cpu is able to build ROS2, but the filesystem is located on eMMC, so it’s not superfast, and does not have infinite write cycles. Also, the CPU is good, but not as fast as my desktop PC. Final point, is that the system does not have mouse/keyboard/display attached. This can off course be solved with VS-code-remote. All-in-all reasons for wanting a proper cross compilation.
What I want, is to develop on my PC, cross compile my application and deploy it on my robot. Several solutions came to mind:
- Using deb/rpm/opkg: using the package manager of the target makes sense, since you then can deploy a package, and install it, including it’s dependencies. Downside of this approach is that only a single version can be installed. So no easy side by side testing.
- As you mentioned, docker is another option, but I’m not sure how heavy weight the runtime is. I guess it is pretty light weight, but still it is a bit unclear to me where the application container should be downloaded to.
- Another option I considered was android APK / iOS app. This is a bundle format which can be started from the home screen. Pretty convenient when testing / deploying. So I wanted a single file solution.
All options above led me to AppImage, which hits a sweet spot:
- Single file: easy to share, e-mail, archive, deploy
- Directly executable, single command to launch the app
- Side by side testing of versions: Start one version, kill it, start another one from a single folder without full re-install or re-compile
- No daemon / package management: The app is actually an executable with a squashfs appended. It is mounted via libfuse, so this is a runtime dependency.
- Another advantage might be the option to make your app truly portable. You could in theory bundle the entire ros2 installation with your app. This app will be large, but it will run on many systems. This off course was one of the first reasons for AppImage to emerge. Whether or not this is a good idea in case of ros probably depends.