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-typesHow to generate
mix rclex.genThis 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/installor via configuration
config :rclex, ros2_directories: ["/home/ros/workspace/install/example_msgs"]How to clean
mix rclex.gen --clean