Advertisement
Guest User

Untitled

a guest
Jun 4th, 2025
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. cmake_minimum_required(VERSION 3.5)
  2. project(custom_sensor_plugin)
  3.  
  4. find_package(ament_cmake REQUIRED)
  5. find_package(rclcpp REQUIRED)
  6. find_package(rclcpp_lifecycle REQUIRED)
  7. find_package(hardware_interface REQUIRED)
  8. find_package(pluginlib REQUIRED)
  9. find_package(gz_ros2_control REQUIRED)
  10. find_package(ignition-gazebo6 REQUIRED)
  11. find_package(ignition-plugin1 REQUIRED COMPONENTS register)
  12.  
  13. include_directories(include)
  14.  
  15. add_library(custom_sensor
  16. src/custom_sensor.cpp
  17. )
  18.  
  19. ament_target_dependencies(custom_sensor
  20. rclcpp
  21. rclcpp_lifecycle
  22. hardware_interface
  23. pluginlib
  24. gz_ros2_control
  25. ignition-gazebo6
  26. )
  27.  
  28. target_link_libraries(custom_sensor
  29. PRIVATE
  30. gz_ros2_control::gz_ros2_control
  31. ignition-gazebo6::ignition-gazebo6
  32. ignition-plugin${ignition-plugin1_VERSION_MAJOR}::ignition-plugin${ignition-plugin1_VERSION_MAJOR}
  33. )
  34.  
  35. pluginlib_export_plugin_description_file(gz_ros2_control custom_sensor_plugin.xml)
  36.  
  37. install(
  38. TARGETS custom_sensor
  39. ARCHIVE DESTINATION lib
  40. LIBRARY DESTINATION lib
  41. RUNTIME DESTINATION bin
  42. )
  43. install(
  44. DIRECTORY include/
  45. DESTINATION include
  46. )
  47. install(
  48. FILES package.xml custom_sensor_plugin.xml
  49. DESTINATION share/${PROJECT_NAME}
  50. )
  51.  
  52. ament_export_include_directories(include)
  53. ament_export_libraries(custom_sensor)
  54. ament_package()
  55.  
  56.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement