The headers are generated and not written by hand. You can generate them using the rosidl_generate_interfaces
CMake macro (examnple here)
There doesn't seem to be an up-to-date tutorial explaining how to define and use custom interfaces at the moment.
I recommend you to create a package with only your custom messages / services files (you can look at https://github.com/ros2/example_interfaces for an example)
And use them in your package (using https://github.com/ros2/examples/tree/35674eb17494ab3f67cc5fbe5f127c614be2220b/rclcpp/minimal_client as an example)
Originally posted by marguedas with karma: 3606 on 2020-02-14
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by jlepers on 2020-02-14:
Thank you, I was trying something similar.
Is it possible that I need to install ROS2 by source to use rosidl_default_generators instead of ROS2 Debian packages?
Comment by marguedas on 2020-02-14:\
Is it possible that I need to install ROS2 by source to use rosidl_default_generators instead of ROS2 Debian packages?
You should be able to use it from debian packages. You'll need to make sure that that package is installed (though I believe it is installed by default).
apt-get list --installed | grep rosidl-default-generators
Comment by jlepers on 2020-02-14:
edit:
apt list --installed | grep rosidl-default-generators
output:
ros-dashing-rosidl-default-generators/now 0.7.0-1bionic.20191016.185016 amd64 [installed,upgradable to: 0.7.0-1bionic.20191210.230356]
I guess this is fine, but I still have cmake troubles with the find_package(rosidl_default_generators REQUIRED) command.
Comment by jlepers on 2020-02-14:
Should I open a new question ?
Comment by marguedas on 2020-02-14:
Yes please. Can you make sure to add your full package.xml and CMakeLists (with the comment lines, starting with # removed for readability) ? This will help diagnose the issue