Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 28 additions & 14 deletions webots_ros2_control/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,21 @@ target_include_directories(
${PROJECT_NAME}
PRIVATE
include
${webots_ros2_driver_INCLUDE_DIRS}
)
ament_target_dependencies(
${PROJECT_NAME}
hardware_interface
controller_manager
pluginlib
rclcpp
webots_ros2_driver
target_link_libraries(${PROJECT_NAME}
PUBLIC
hardware_interface::hardware_interface
controller_manager::controller_manager
pluginlib::pluginlib
rclcpp::rclcpp
webots_ros2_driver::webots_ros2_driver_imu
webots_ros2_driver::webots_ros2_driver_rgbd
)
target_link_directories(${PROJECT_NAME}
PUBLIC
${CMAKE_INSTALL_PREFIX}/lib/controller
${CMAKE_INSTALL_PREFIX}/../webots_ros2_driver/lib/controller
Comment on lines +66 to +67
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure about this patch

)

# Prevent pluginlib from using boost
Expand All @@ -74,14 +81,21 @@ target_include_directories(
${PROJECT_NAME}_system
PRIVATE
include
${webots_ros2_driver_INCLUDE_DIRS}
)
ament_target_dependencies(
${PROJECT_NAME}_system
hardware_interface
pluginlib
rclcpp
rclcpp_lifecycle
webots_ros2_driver
target_link_libraries(${PROJECT_NAME}_system
PUBLIC
hardware_interface::hardware_interface
pluginlib::pluginlib
rclcpp::rclcpp
rclcpp_lifecycle::rclcpp_lifecycle
webots_ros2_driver::webots_ros2_driver_imu
webots_ros2_driver::webots_ros2_driver_rgbd
)
target_link_directories(${PROJECT_NAME}_system
PUBLIC
${CMAKE_INSTALL_PREFIX}/lib/controller
${CMAKE_INSTALL_PREFIX}/../webots_ros2_driver/lib/controller
)

# Prevent pluginlib from using boost
Expand Down
2 changes: 1 addition & 1 deletion webots_ros2_control/src/Ros2Control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace webots_ros2_control {

WebotsResourceManager(const WebotsResourceManager &) = delete;

bool load_and_initialize_components(const std::string &urdf, unsigned int update_rate) override {
bool load_and_initialize_components(const std::string &urdf, unsigned int /* update_rate */) override {
components_are_loaded_and_initialized_ = true;

std::vector<hardware_interface::HardwareInfo> controlHardware;
Expand Down
65 changes: 32 additions & 33 deletions webots_ros2_driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,27 +108,24 @@ add_executable(driver
src/utils/Math.cpp
src/utils/Utils.cpp
)
ament_target_dependencies(driver
rosgraph_msgs
rclcpp
pluginlib
sensor_msgs
std_msgs
tf2_geometry_msgs
tf2_ros
vision_msgs
webots_ros2_msgs
tinyxml2_vendor
TinyXML2
)
add_dependencies(driver
compile-lib-vehicle
)
target_link_libraries(driver
${rosgraph_msgs_TARGETS}
rclcpp::rclcpp
pluginlib::pluginlib
${sensor_msgs_TARGETS}
${std_msgs_TARGETS}
tf2_geometry_msgs::tf2_geometry_msgs
tf2_ros::tf2_ros
${vision_msgs_TARGETS}
${webots_ros2_msgs_TARGETS}
tinyxml2::tinyxml2
${WEBOTS_LIB}
${Python_LIBRARIES}
yaml-cpp
)
add_dependencies(driver
compile-lib-vehicle
)
install(
DIRECTORY include/
DESTINATION include
Expand All @@ -146,20 +143,19 @@ add_library(
src/plugins/Ros2SensorPlugin.cpp
src/utils/Utils.cpp
)
ament_target_dependencies(${PROJECT_NAME}_imu
rclcpp
sensor_msgs
webots_ros2_msgs
pluginlib
tf2_ros
target_link_libraries(${PROJECT_NAME}_imu
rclcpp::rclcpp
${sensor_msgs_TARGETS}
${webots_ros2_msgs_TARGETS}
pluginlib::pluginlib
tf2_ros::tf2_ros
${WEBOTS_LIB}
)
add_dependencies(${PROJECT_NAME}_imu
compile-lib-vehicle
)
target_link_libraries(${PROJECT_NAME}_imu
${WEBOTS_LIB}
)
install(TARGETS ${PROJECT_NAME}_imu
EXPORT export_${PROJECT_NAME}
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
Expand All @@ -174,19 +170,18 @@ add_library(
src/plugins/Ros2SensorPlugin.cpp
src/utils/Utils.cpp
)
ament_target_dependencies(${PROJECT_NAME}_rgbd
rclcpp
sensor_msgs
pluginlib
tf2_ros
target_link_libraries(${PROJECT_NAME}_rgbd
rclcpp::rclcpp
${sensor_msgs_TARGETS}
pluginlib::pluginlib
tf2_ros::tf2_ros
${WEBOTS_LIB}
)
add_dependencies(${PROJECT_NAME}_rgbd
compile-lib-vehicle
)
target_link_libraries(${PROJECT_NAME}_rgbd
${WEBOTS_LIB}
)
install(TARGETS ${PROJECT_NAME}_rgbd
EXPORT export_${PROJECT_NAME}
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
Expand Down Expand Up @@ -272,4 +267,8 @@ ament_export_libraries(
${PROJECT_NAME}_rgbd
${WEBOTS_LIB_PATH}
)

# Export modern CMake targets
ament_export_targets(export_${PROJECT_NAME})

ament_package()
Loading