ROS2 services not using ament_cmake
I am not using amentcmake and I am having trouble incorporating the .srv files to the CMakeLists.txt. When I do `findpackage(rosidldefaultgenerator_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!
Asked by mikepark93 on 2019-12-13 15:20:14 UTC
Comments
Have you declared the dependency on
rosidl_default_generator_cpp
in yourpackage.xml
file?Asked by Dirk Thomas on 2019-12-13 15:41:39 UTC
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
Asked by mikepark93 on 2019-12-13 15:47:04 UTC
Then you need to make sure
rosidl_default_generator_cpp
is findable by CMake, e.g. by setting the appropriateCMAKE_PREFIX_PATH
.Asked by Dirk Thomas on 2019-12-13 15:50:15 UTC
How would I do that? Do I just point it to /opt/ros/dashing (I am using dashing as my distro)
Asked by mikepark93 on 2019-12-16 09:18:32 UTC
Setting the
CMAKE_PREFIX_PATH
resolved the previous issue, but I am getting another issue now.Asked by mikepark93 on 2019-12-16 17:12:41 UTC