ROS2 services not using ament_cmake
I am not using ament_cmake and I am having trouble incorporating the .srv files to the CMakeLists.txt. When I do find_package(rosidl_default_generator_cpp REQUIRED)
It is throwing me a CMake Error:
[cmake] Could not find a package configuration file provided by
[cmake] "rosidl_default_generator_cpp" with any of the following names:
[cmake]
[cmake] rosidl_default_generator_cppConfig.cmake
[cmake] rosidl_default_generator_cpp-config.cmake
Likewise, it is saying that the following command is not a cmake command :
rosidl_generate_interfaces(sensor_ros2wrapper
${srv_files}
)
Any help would be greatly appreciated!
Have you declared the dependency on
rosidl_default_generator_cpp
in yourpackage.xml
file?I am not using colon as my build tool in my application. I am using cmake for everything and have been manually linking the ros2 libraries. I have no
package.xml
Then you need to make sure
rosidl_default_generator_cpp
is findable by CMake, e.g. by setting the appropriateCMAKE_PREFIX_PATH
.How would I do that? Do I just point it to /opt/ros/dashing (I am using dashing as my distro)
Setting the
CMAKE_PREFIX_PATH
resolved the previous issue, but I am getting another issue now.