Generating Messages Included by safe_drive
For client applications, safe_drive
provides a way to transpile from ROS2's .idl files to Rust crates by using safe_drive_msg.
safe_drive
itself includes ROS2's some basic messages to handle parameter
servers.
The basic messages can be generated by ros2msg_to_rs, and located in src/msg.
safe_drive
contains common_interfaces,
unique_identifier_msgs,
and rcl_interfaces.
These messages can be transpiled as follows.
{safe_drive}
of the following means a directory path to safe_drive
.
$ git clone https://github.com/ros2/common_interfaces.git -b humble
$ ros2msg_to_rs --disable-common-interfaces -s crate -i common_interfaces -o {safe_drive}/src/msg/humble/common_interfaces
$ mkdir ros2msg && cd ros2msg
$ git clone https://github.com/ros2/unique_identifier_msgs.git -b humble
$ ros2msg_to_rs --disable-common-interfaces -s crate -i . -o {safe_drive}/src/msg/humble/ros2msg
$ git clone https://github.com/ros2/rcl_interfaces.git -b humble
$ rm -rf rcl_interfaces/test_msgs rcl_interfaces/builtin_interfaces
$ ros2msg_to_rs --disable-common-interfaces -s crate -i rcl_interfaces -o {safe_drive}/src/msg/humble/interfaces
-s crate
means crate
is the name of top module.
-i
and -o
means input and output directories.
Because safe_drive
defines builtin_interfaces
internally, it must be removed before transpilation.
To support newer version of ROS2, these files should be updated.