mix rclex.gen (Rclex (Experimental) v0.12.0)

Copy Markdown View Source

Generate codes of ROS 2 types

Before generating, specifying types for topics, services and actions in config.exs is needed.

config :rclex,
ros2_message_types: [
  "std_msgs/msg/String"
],
ros2_service_types: [
  "std_srvs/srv/SetBool"
],
ros2_action_types: [
  "tf2_msgs/action/LookupTransform"
]

Info

Be careful, ros2 types are case sensitive.

How to show message types

mix rclex.gen --show-types

How to generate

mix rclex.gen

This task assumes that the environment variable ROS_DISTRO is set and refers to the msg types from /opt/ros/[ROS_DISTRO]/share. In addition AMENT_PREFIX_PATH is considered to find types.

We can also specify explicitly as follows

mix rclex.gen --from /opt/ros/humble/share --from /home/ros/workspace/install

or via configuration

config :rclex, ros2_directories: ["/home/ros/workspace/install/example_msgs"]

How to clean

mix rclex.gen --clean

Summary

Functions

rclex_dir_path!()

recompile!()