Generate codes of ROS 2 msg type
Before generating, specifying msg types in config.exs is needed.
config :rclex, ros2_message_types: ["std_msgs/msg/String"]If ros2_message_types is empty, built-in types required by Rclex
internals (for example parameter and lifecycle support) are still
generated.
The task also generates the code for the request and response message types required by the services defined in
config :rclex, ros2_service_types: ["std_srvs/srv/SetBool"]and the message types required for internal topics and services of actions defined in
config :rclex, ros2_action_types: ["tf2_msgs/action/LookupTransform"]Info
Be careful, ros2 msg type is case sensitive.
How to show message types
mix rclex.gen.msgs --show-typesHow to generate
mix rclex.gen.msgsThis 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 msg types.
We can also specify explicitly as follows
mix rclex.gen.msgs --from /opt/ros/humble/share --from /home/ros/workspace/installor via configuration
config :rclex, ros2_directories: ["/home/ros/workspace/install/example_msgs"]How to clean
mix rclex.gen.msgs --clean