A ROS 2 client library in the Zig programming language.
- TODO
This project was created as a personal way to learn Zig. I was intrigued by the features Zig has to offer (e.g. simple, zero-dependency drop-in replacement for C/C++, cross-compilation out-of-the-box). As an exercise, I challenged myself to integrate the language with ROS 2 and this is the result.
No, probably not.
Zig is a very young language (still pre-1.0 release) and not stable. The same applies for rclzig.
-
Clone this repository
git clone https://github.com/jacobperron/rclzig.git
-
Source your ROS 2 installation, e.g. ROS Galactic:
source /opt/ros/galactic/setup.bash
-
Build:
cd rclzig zig build
-
Optionally, run tests:
zig build test
Run the talker:
zig build talker
In a second shell, run the listener:
zig build listener
TODO
See CONTRIBUTING.md.
Here are some nice resource for learning Zig:
- ziglearn.org is a good starting place.
- Zig's "In-depth overview" supplements ziglearn.org very well.
- Zig API reference
- These "zig build explained" blog posts provide good info about the build system. Part 2 demonstrates how to build C/C++ code from zig.
- Jumping straight into the source code for Zig can also be enlightening.