ROS2 LiveCast #91 Question

Today, I watched the ROS1-ROS2 difference live cast #91 on YouTube. Thank you for very a informative session.
In the ros2 rclcpp example, can ros2_custom_msgs have source in ‘src’ folder that make use of custom messages in the same package? Unlike talker and listener, which are different packages.


Hello @commerce1010,

Yes, that’s possible. You just need to specify the package as a dependency when generating the executable. Something like this:

ament_target_dependencies(my_node rclcpp ros2_custom_msgs)