I am trying to create a template for packages that contain custom interfaces. I created this one, where I created some custom messages and services. In one of the messages and one of the services, I use example_interfaces/Int64MultiArray just to show that it is possible to use other messages in your custom interfaces. But the build fails with this error:
fatal error: example_interfaces/msg/detail/int64_multi_array__struct.hpp: No such file or directory
20 | #include "example_interfaces/msg/detail/int64_multi_array__struct.hpp"
I tried with different messages from the example_interfaces package as well as the geometry_msgs package and had the same result.
Could someone please look at the package and tell me what I am doing wrong? Thanks!
thank you for your quick reply, but unfortunately, I believe your suggestions are irrelevant.
I do not use geometry_msgs anywhere in the package so there is no need to include it in CMakeList.txt. In my post, I just clarified that before posting on the forum, I tested this with different messages and packages and observed the same issue; not that the package is using geometry_msgs at the moment.
This has nothing to do with the error message or with the issue. Your suggestion would only change my example_interfaces/Int64MultiArray field into an unbounded array of example_interfaces/Int64MultiArrays. The problem would persist.
I thought you wanted to use geometry_msgs, therefore I thought you should include that in your CMakeLists. I could still see geometry_msgs in your package.xml.
About that [] in the multi array, I realized this later, forgot to edit this in my post.
I hope I did not mislead you too much.
Try this step: In your CMakeLists.txt add this line
rosidl_generate_interfaces(${PROJECT_NAME}
${msg_files}
${srv_files}
DEPENDENCIES example_interfaces <--- add this line here
)