ros2 / tutorials

Apache License 2.0
31 stars 11 forks source link

"Creating custom ROS 2 msg and srv files" tutorial does not work #28

Closed DaniSch93 closed 4 years ago

DaniSch93 commented 4 years ago

System: Kubuntu 20.04 ROS2 foxy

I did everything(several times) to create my own service with following tutorial: https://index.ros.org/doc/ros2/Tutorials/Custom-ROS2-Interfaces/
The header of the service is created in the install directory and can be included, but if I want to use the custom service the compiler tells me my package (in which the service is defined) has not been declared.

samiulextreem commented 2 years ago

hi, i am facing the same issue. have you found a solution?

sloretz commented 2 years ago

Hi @samiulextreem

Please ask this sort of question on https://answers.ros.org.

It sounds like @DaniSch93 was trying to use messages from the same package they're generated. If that's what you're doing too, sensor_msgs has an example. See how the C++ typesupport target is retrieved and linked against. https://github.com/ros2/common_interfaces/blob/b7e2ad503e1648468b1dc766c43aac12cc9aee5a/sensor_msgs/CMakeLists.txt#L58