Hello all,
I’d like to share a project I’ve been tinkering away at for a few months, ZigROS. ZigROS uses the zig toolchain to build rcl and rclcpp along with all their dependencies directly.
ZigROS is focused on creating static builds for simplified deployments. The Zig tooling makes this very straight forward. The zig toolchain supports static and dynamic linking with both arbitrary glibc versions and musl out of the box, as well as cross compilation.
ZigROS is capable of building the rclcpp stack in under 2 minutes on modern hardware, and producing statically linked binaries under 5MB that will run standalone on any linux systems.
The zig toolchain puts emphasis on being self contained, and ZigROS follows that ethos. The only dependency is the zig compiler, all other build and runtime dependencies (including python) are brought in and built.
Check out this example repo to see it in action.
Currently the project handles rcl, rclcpp, and all the needed message generation for interfaces. Only the base rclcpp is supported so far (no actions or lifecycle support just yet) but I do plan on continuing to improve feature support.
Given that the main goal of this project is ease of static builds, not all ROS projects will be compatible. For starters building anything with a runtime dependency on python or shared libraries won’t work. It also requires providing a build.zig file to build the project, though the API there is very straight forward.
I invite anyone curious about zig, or anyone interested in experimenting with static builds to give it a try. Setup is as straight forward as installing zig 0.13 and building the example repo.
For deployments to edge hardware like a raspberry pi or similar embedded linux system, the static linking and ease of cross compilation offered here could be a valuable alternative to the main build system.
Let me know if there are any questions or if you’re interested in collaborating.
Thanks!