This is a ROS2 client library written in Dlang that does not depend on ROS2 build infrastructure (colcon
).
- rcl_bind : D binding package of rcl
- msg_gen : Message generator that reads IDL files
- rcld : ROS2 client library API for D
libclang-dev
(tested withlibclang-10-dev
)clang
(tested withclang-10
)
-
Execute this command at your project root.
- This will generate D message packages from visible ROS2 message packages.
dub run ros2_d:msg_gen -- .dub/packages
-
Add ros2_d to your project
dub add ros2_d:rcld
-
Add message packages you want to use
- Open dub.json and add (e.g.)
"std_msgs": ">=0.0.1"
todependencies
section
- Open dub.json and add (e.g.)
-
Build
dub build
Before you execute that procedure, please be sure that necessary environment varialbles for ROS2. This means, you need to execute the following command before setting up.
source /opt/ros/$ROS_DISTRO/setup.bash
And if you have your own message type, please do the following command too.
source <your-ament-workspace>/install/setup.bash
When some of ROS2 message type definitions are changed, please do the following command again.
dub run ros2_d:msg_gen -- .dub/packages -r
Here is a example pacakge.
- OS
- Linux (tested with Ubuntu 20.04)
- ROS2 distribution
- Foxy
- Galactic
- Rolling
- Dlang
- dmd (tested with dmd-2.098.0)
- CPU
- x86_64