6-robot / wpr_simulation2

39 stars 10 forks source link

编译出错 #9

Closed menkeyi001 closed 3 weeks ago

menkeyi001 commented 3 weeks ago

robot@robot-KVM:~/ros2_ws$ colcon build --symlink-install
Starting >>> wpr_simulation2
[Processing: wpr_simulation2]                             
--- stderr: wpr_simulation2                                
In file included from /opt/ros/humble/include/rclcpp/rclcpp/logging.hpp:24,
                 from /opt/ros/humble/include/rclcpp/rclcpp/client.hpp:40,
                 from /opt/ros/humble/include/rclcpp/rclcpp/callback_group.hpp:24,
                 from /opt/ros/humble/include/rclcpp/rclcpp/any_executable.hpp:20,
                 from /opt/ros/humble/include/rclcpp/rclcpp/memory_strategy.hpp:25,
                 from /opt/ros/humble/include/rclcpp/rclcpp/memory_strategies.hpp:18,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executor_options.hpp:20,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executor.hpp:37,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors/multi_threaded_executor.hpp:25,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:21,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/robot/ros2_ws/src/wpr_simulation2/src/objects_publisher.cpp:1:
/home/robot/ros2_ws/src/wpr_simulation2/src/objects_publisher.cpp: In member function ‘void ObjectsPublisher::pointcloudCallback(sensor_msgs::msg::PointCloud2_<std::allocator<void> >::SharedPtr)’:
/home/robot/ros2_ws/src/wpr_simulation2/src/objects_publisher.cpp:154:37: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘std::vector<pcl::PointIndices>::size_type’ {aka ‘long unsigned int’} [-Wformat=]
  154 |     RCLCPP_INFO(this->get_logger(), "Number of clusters: %d", cluster_indices.size());
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~~~~~~~
      |                                                                                   |
      |                                                                                   std::vector<pcl::PointIndices>::size_type {aka long unsigned int}
/home/robot/ros2_ws/src/wpr_simulation2/src/objects_publisher.cpp:154:59: note: format string is defined here
  154 |     RCLCPP_INFO(this->get_logger(), "Number of clusters: %d", cluster_indices.size());
      |                                                          ~^
      |                                                           |
      |                                                           int
      |                                                          %ld
---
Finished <<< wpr_simulation2 [55.5s]

Summary: 1 package finished [56.8s]
  1 package had stderr output: wpr_simulation2 ```