I am using ros2 without colcon or ament in my project. It works with existing message types but now I want to use custom ros msgs in this project. I have no idea how to do that. For ros1 I can see an example at https://github.com/gerkey/ros1_external_use/tree/ros2/ros1_msgs and https://wiki.ros.org/ROS/Tutorials/CreatingMsgAndSrv%28plain%20cmake%29 (similar), but I couldn't find anything analugousanalogous for ros2. If anyone can help me on how to do that or point me to some resources that might help me will be of great help. Thanks in advance.
Note: I only want to build for cpp, and choosing to do it with raw cmake has been easier for me to understand and learn.
I have tried calling rosidl_generate_interfaces(...)
inside the CMakeLists.txt
. It gives an error that package.xml
is missing the <member_of_group>
statement. Since I am not using colcon/ament, I don't have a package.xml
in my project. I could use the other libraries like rclcpp
, sensor_msgs
, etc., by treating them as usual cmake
packages. But I don't know how to do this for rosidl_generator.