Slamtec / rplidar_ros

BSD 2-Clause "Simplified" License
505 stars 534 forks source link

When I was compiling the rplidar_ros, the following error occurred #111

Closed ddwy closed 1 year ago

ddwy commented 1 year ago

OS:Ubuntu 2022.04 ROS:humble

When I was compiling the rplidar_ros, the following error occurred

--- stderr: rplidar_ros2                             
In file included from /home/ubuntu/turbot4_ws/src/rplidar_ros/./sdk/include/rplidar.h:39,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/sdk/src/sdkcommon.h:48,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/sdk/src/rplidar_driver.cpp:35:
/home/ubuntu/turbot4_ws/src/rplidar_ros/./sdk/include/rplidar_protocol.h:59:14: warning: ISO C++ forbids zero-size array ‘data’ [-Wpedantic]
   59 |     _u8 data[0];
      |              ^
In file included from /home/ubuntu/turbot4_ws/src/rplidar_ros/./sdk/include/rplidar.h:40,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/sdk/src/sdkcommon.h:48,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/sdk/src/rplidar_driver.cpp:35:
/home/ubuntu/turbot4_ws/src/rplidar_ros/./sdk/include/rplidar_cmd.h:260:18: warning: ISO C++ forbids zero-size array ‘payload’ [-Wpedantic]
  260 |     _u8  payload[0];
      |                  ^
/home/ubuntu/turbot4_ws/src/rplidar_ros/sdk/src/rplidar_driver.cpp: In member function ‘virtual void rp::standalone::rplidar::RPlidarDriverImplCommon::_ultraCapsuleToNormal(const rplidar_response_ultra_capsule_measurement_nodes_t&, rplidar_response_measurement_node_hq_t*, size_t&)’:
/home/ubuntu/turbot4_ws/src/rplidar_ros/sdk/src/rplidar_driver.cpp:1208:32: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
 1208 |             if ((dist_predict1 == 0xFFFFFE00) || (dist_predict1 == 0x1FF)) {
      |                  ~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/ubuntu/turbot4_ws/src/rplidar_ros/sdk/src/rplidar_driver.cpp:1216:32: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
 1216 |             if ((dist_predict2 == 0xFFFFFE00) || (dist_predict2 == 0x1FF)) {
      |                  ~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/ubuntu/turbot4_ws/src/rplidar_ros/sdk/src/rplidar_driver.cpp: In member function ‘virtual u_result rp::standalone::rplidar::RPlidarDriverImplCommon::grabScanData(rplidar_response_measurement_node_t*, size_t&, _u32)’:
/home/ubuntu/turbot4_ws/src/rplidar_ros/sdk/src/rplidar_driver.cpp:1802:26: error: narrowing conversion of ‘rp::hal::Event::EVENT_TIMEOUT’ from ‘int’ to ‘long unsigned int’ [-Wnarrowing]
 1802 |     case rp::hal::Event::EVENT_TIMEOUT:
      |                          ^~~~~~~~~~~~~
/home/ubuntu/turbot4_ws/src/rplidar_ros/sdk/src/rplidar_driver.cpp: In member function ‘virtual u_result rp::standalone::rplidar::RPlidarDriverImplCommon::grabScanDataHq(rplidar_response_measurement_node_hq_t*, size_t&, _u32)’:
/home/ubuntu/turbot4_ws/src/rplidar_ros/sdk/src/rplidar_driver.cpp:1831:26: error: narrowing conversion of ‘rp::hal::Event::EVENT_TIMEOUT’ from ‘int’ to ‘long unsigned int’ [-Wnarrowing]
 1831 |     case rp::hal::Event::EVENT_TIMEOUT:
      |                          ^~~~~~~~~~~~~
/home/ubuntu/turbot4_ws/src/rplidar_ros/sdk/src/rplidar_driver.cpp: In instantiation of ‘u_result rp::standalone::rplidar::ascendScanData_(TNode*, size_t) [with TNode = _rplidar_response_measurement_node_t; u_result = unsigned int; size_t = long unsigned int]’:
/home/ubuntu/turbot4_ws/src/rplidar_ros/sdk/src/rplidar_driver.cpp:2001:64:   required from here
/home/ubuntu/turbot4_ws/src/rplidar_ros/sdk/src/rplidar_driver.cpp:1967:27: warning: comparison of unsigned expression in ‘>= 0’ is always true [-Wtype-limits]
 1967 |     for (i = count - 1; i >= 0; i--) {
      |                         ~~^~~~
/home/ubuntu/turbot4_ws/src/rplidar_ros/sdk/src/rplidar_driver.cpp: In instantiation of ‘u_result rp::standalone::rplidar::ascendScanData_(TNode*, size_t) [with TNode = rplidar_response_measurement_node_hq_t; u_result = unsigned int; size_t = long unsigned int]’:
/home/ubuntu/turbot4_ws/src/rplidar_ros/sdk/src/rplidar_driver.cpp:2006:67:   required from here
/home/ubuntu/turbot4_ws/src/rplidar_ros/sdk/src/rplidar_driver.cpp:1967:27: warning: comparison of unsigned expression in ‘>= 0’ is always true [-Wtype-limits]
gmake[2]: *** [CMakeFiles/rplidar_scan_publisher.dir/build.make:146: CMakeFiles/rplidar_scan_publisher.dir/sdk/src/rplidar_driver.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
In file included from /home/ubuntu/turbot4_ws/src/rplidar_ros/./sdk/include/rplidar.h:39,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:38:
/home/ubuntu/turbot4_ws/src/rplidar_ros/./sdk/include/rplidar_protocol.h:59:14: warning: ISO C++ forbids zero-size array ‘data’ [-Wpedantic]
   59 |     _u8 data[0];
      |              ^
In file included from /home/ubuntu/turbot4_ws/src/rplidar_ros/./sdk/include/rplidar.h:40,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:38:
/home/ubuntu/turbot4_ws/src/rplidar_ros/./sdk/include/rplidar_cmd.h:260:18: warning: ISO C++ forbids zero-size array ‘payload’ [-Wpedantic]
  260 |     _u8  payload[0];
      |                  ^
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp: In member function ‘void RPLidarScanPublisher::init_param()’:
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:67:32: error: no matching function for call to ‘RPLidarScanPublisher::declare_parameter(const char [13])’
   67 |         this->declare_parameter("channel_type");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:35:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:421:3: note: candidate: ‘template<class ParameterT> auto rclcpp::Node::declare_parameter(const string&, const ParameterT&, const ParameterDescriptor&, bool)’
  421 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:421:3: note:   template argument deduction/substitution failed:
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:67:32: note:   candidate expects 4 arguments, 1 provided
   67 |         this->declare_parameter("channel_type");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:35:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:434:3: note: candidate: ‘template<class ParameterT> auto rclcpp::Node::declare_parameter(const string&, const ParameterDescriptor&, bool)’
  434 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:434:3: note:   template argument deduction/substitution failed:
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:67:32: note:   couldn’t deduce template parameter ‘ParameterT’
   67 |         this->declare_parameter("channel_type");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:35:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:366:3: note: candidate: ‘const rclcpp::ParameterValue& rclcpp::Node::declare_parameter(const string&, const rclcpp::ParameterValue&, const ParameterDescriptor&, bool)’
  366 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:366:3: note:   candidate expects 4 arguments, 1 provided
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:391:3: note: candidate: ‘const rclcpp::ParameterValue& rclcpp::Node::declare_parameter(const string&, rclcpp::ParameterType, const ParameterDescriptor&, bool)’
  391 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:391:3: note:   candidate expects 4 arguments, 1 provided
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:68:32: error: no matching function for call to ‘RPLidarScanPublisher::declare_parameter(const char [7])’
   68 |         this->declare_parameter("tcp_ip");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:35:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:421:3: note: candidate: ‘template<class ParameterT> auto rclcpp::Node::declare_parameter(const string&, const ParameterT&, const ParameterDescriptor&, bool)’
  421 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:421:3: note:   template argument deduction/substitution failed:
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:68:32: note:   candidate expects 4 arguments, 1 provided
   68 |         this->declare_parameter("tcp_ip");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:35:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:434:3: note: candidate: ‘template<class ParameterT> auto rclcpp::Node::declare_parameter(const string&, const ParameterDescriptor&, bool)’
  434 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:434:3: note:   template argument deduction/substitution failed:
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:68:32: note:   couldn’t deduce template parameter ‘ParameterT’
   68 |         this->declare_parameter("tcp_ip");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:35:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:366:3: note: candidate: ‘const rclcpp::ParameterValue& rclcpp::Node::declare_parameter(const string&, const rclcpp::ParameterValue&, const ParameterDescriptor&, bool)’
  366 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:366:3: note:   candidate expects 4 arguments, 1 provided
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:391:3: note: candidate: ‘const rclcpp::ParameterValue& rclcpp::Node::declare_parameter(const string&, rclcpp::ParameterType, const ParameterDescriptor&, bool)’
  391 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:391:3: note:   candidate expects 4 arguments, 1 provided
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:69:32: error: no matching function for call to ‘RPLidarScanPublisher::declare_parameter(const char [9])’
   69 |         this->declare_parameter("tcp_port");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:35:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:421:3: note: candidate: ‘template<class ParameterT> auto rclcpp::Node::declare_parameter(const string&, const ParameterT&, const ParameterDescriptor&, bool)’
  421 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:421:3: note:   template argument deduction/substitution failed:
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:69:32: note:   candidate expects 4 arguments, 1 provided
   69 |         this->declare_parameter("tcp_port");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:35:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:434:3: note: candidate: ‘template<class ParameterT> auto rclcpp::Node::declare_parameter(const string&, const ParameterDescriptor&, bool)’
  434 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:434:3: note:   template argument deduction/substitution failed:
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:69:32: note:   couldn’t deduce template parameter ‘ParameterT’
   69 |         this->declare_parameter("tcp_port");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:35:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:366:3: note: candidate: ‘const rclcpp::ParameterValue& rclcpp::Node::declare_parameter(const string&, const rclcpp::ParameterValue&, const ParameterDescriptor&, bool)’
  366 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:366:3: note:   candidate expects 4 arguments, 1 provided
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:391:3: note: candidate: ‘const rclcpp::ParameterValue& rclcpp::Node::declare_parameter(const string&, rclcpp::ParameterType, const ParameterDescriptor&, bool)’
  391 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:391:3: note:   candidate expects 4 arguments, 1 provided
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:70:32: error: no matching function for call to ‘RPLidarScanPublisher::declare_parameter(const char [12])’
   70 |         this->declare_parameter("serial_port");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:35:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:421:3: note: candidate: ‘template<class ParameterT> auto rclcpp::Node::declare_parameter(const string&, const ParameterT&, const ParameterDescriptor&, bool)’
  421 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:421:3: note:   template argument deduction/substitution failed:
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:70:32: note:   candidate expects 4 arguments, 1 provided
   70 |         this->declare_parameter("serial_port");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:35:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:434:3: note: candidate: ‘template<class ParameterT> auto rclcpp::Node::declare_parameter(const string&, const ParameterDescriptor&, bool)’
  434 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:434:3: note:   template argument deduction/substitution failed:
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:70:32: note:   couldn’t deduce template parameter ‘ParameterT’
   70 |         this->declare_parameter("serial_port");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:35:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:366:3: note: candidate: ‘const rclcpp::ParameterValue& rclcpp::Node::declare_parameter(const string&, const rclcpp::ParameterValue&, const ParameterDescriptor&, bool)’
  366 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:366:3: note:   candidate expects 4 arguments, 1 provided
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:391:3: note: candidate: ‘const rclcpp::ParameterValue& rclcpp::Node::declare_parameter(const string&, rclcpp::ParameterType, const ParameterDescriptor&, bool)’
  391 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:391:3: note:   candidate expects 4 arguments, 1 provided
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:71:32: error: no matching function for call to ‘RPLidarScanPublisher::declare_parameter(const char [16])’
   71 |         this->declare_parameter("serial_baudrate");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:35:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:421:3: note: candidate: ‘template<class ParameterT> auto rclcpp::Node::declare_parameter(const string&, const ParameterT&, const ParameterDescriptor&, bool)’
  421 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:421:3: note:   template argument deduction/substitution failed:
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:71:32: note:   candidate expects 4 arguments, 1 provided
   71 |         this->declare_parameter("serial_baudrate");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:35:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:434:3: note: candidate: ‘template<class ParameterT> auto rclcpp::Node::declare_parameter(const string&, const ParameterDescriptor&, bool)’
  434 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:434:3: note:   template argument deduction/substitution failed:
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:71:32: note:   couldn’t deduce template parameter ‘ParameterT’
   71 |         this->declare_parameter("serial_baudrate");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:35:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:366:3: note: candidate: ‘const rclcpp::ParameterValue& rclcpp::Node::declare_parameter(const string&, const rclcpp::ParameterValue&, const ParameterDescriptor&, bool)’
  366 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:366:3: note:   candidate expects 4 arguments, 1 provided
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:391:3: note: candidate: ‘const rclcpp::ParameterValue& rclcpp::Node::declare_parameter(const string&, rclcpp::ParameterType, const ParameterDescriptor&, bool)’
  391 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:391:3: note:   candidate expects 4 arguments, 1 provided
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:72:32: error: no matching function for call to ‘RPLidarScanPublisher::declare_parameter(const char [9])’
   72 |         this->declare_parameter("frame_id");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:35:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:421:3: note: candidate: ‘template<class ParameterT> auto rclcpp::Node::declare_parameter(const string&, const ParameterT&, const ParameterDescriptor&, bool)’
  421 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:421:3: note:   template argument deduction/substitution failed:
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:72:32: note:   candidate expects 4 arguments, 1 provided
   72 |         this->declare_parameter("frame_id");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:35:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:434:3: note: candidate: ‘template<class ParameterT> auto rclcpp::Node::declare_parameter(const string&, const ParameterDescriptor&, bool)’
  434 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:434:3: note:   template argument deduction/substitution failed:
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:72:32: note:   couldn’t deduce template parameter ‘ParameterT’
   72 |         this->declare_parameter("frame_id");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:35:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:366:3: note: candidate: ‘const rclcpp::ParameterValue& rclcpp::Node::declare_parameter(const string&, const rclcpp::ParameterValue&, const ParameterDescriptor&, bool)’
  366 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:366:3: note:   candidate expects 4 arguments, 1 provided
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:391:3: note: candidate: ‘const rclcpp::ParameterValue& rclcpp::Node::declare_parameter(const string&, rclcpp::ParameterType, const ParameterDescriptor&, bool)’
  391 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:391:3: note:   candidate expects 4 arguments, 1 provided
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:73:32: error: no matching function for call to ‘RPLidarScanPublisher::declare_parameter(const char [9])’
   73 |         this->declare_parameter("inverted");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:35:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:421:3: note: candidate: ‘template<class ParameterT> auto rclcpp::Node::declare_parameter(const string&, const ParameterT&, const ParameterDescriptor&, bool)’
  421 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:421:3: note:   template argument deduction/substitution failed:
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:73:32: note:   candidate expects 4 arguments, 1 provided
   73 |         this->declare_parameter("inverted");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:35:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:434:3: note: candidate: ‘template<class ParameterT> auto rclcpp::Node::declare_parameter(const string&, const ParameterDescriptor&, bool)’
  434 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:434:3: note:   template argument deduction/substitution failed:
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:73:32: note:   couldn’t deduce template parameter ‘ParameterT’
   73 |         this->declare_parameter("inverted");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:35:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:366:3: note: candidate: ‘const rclcpp::ParameterValue& rclcpp::Node::declare_parameter(const string&, const rclcpp::ParameterValue&, const ParameterDescriptor&, bool)’
  366 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:366:3: note:   candidate expects 4 arguments, 1 provided
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:391:3: note: candidate: ‘const rclcpp::ParameterValue& rclcpp::Node::declare_parameter(const string&, rclcpp::ParameterType, const ParameterDescriptor&, bool)’
  391 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:391:3: note:   candidate expects 4 arguments, 1 provided
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:74:32: error: no matching function for call to ‘RPLidarScanPublisher::declare_parameter(const char [17])’
   74 |         this->declare_parameter("angle_compensate");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:35:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:421:3: note: candidate: ‘template<class ParameterT> auto rclcpp::Node::declare_parameter(const string&, const ParameterT&, const ParameterDescriptor&, bool)’
  421 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:421:3: note:   template argument deduction/substitution failed:
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:74:32: note:   candidate expects 4 arguments, 1 provided
   74 |         this->declare_parameter("angle_compensate");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:35:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:434:3: note: candidate: ‘template<class ParameterT> auto rclcpp::Node::declare_parameter(const string&, const ParameterDescriptor&, bool)’
  434 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:434:3: note:   template argument deduction/substitution failed:
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:74:32: note:   couldn’t deduce template parameter ‘ParameterT’
   74 |         this->declare_parameter("angle_compensate");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:35:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:366:3: note: candidate: ‘const rclcpp::ParameterValue& rclcpp::Node::declare_parameter(const string&, const rclcpp::ParameterValue&, const ParameterDescriptor&, bool)’
  366 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:366:3: note:   candidate expects 4 arguments, 1 provided
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:391:3: note: candidate: ‘const rclcpp::ParameterValue& rclcpp::Node::declare_parameter(const string&, rclcpp::ParameterType, const ParameterDescriptor&, bool)’
  391 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:391:3: note:   candidate expects 4 arguments, 1 provided
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:75:32: error: no matching function for call to ‘RPLidarScanPublisher::declare_parameter(const char [10])’
   75 |         this->declare_parameter("scan_mode");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:35:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:421:3: note: candidate: ‘template<class ParameterT> auto rclcpp::Node::declare_parameter(const string&, const ParameterT&, const ParameterDescriptor&, bool)’
  421 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:421:3: note:   template argument deduction/substitution failed:
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:75:32: note:   candidate expects 4 arguments, 1 provided
   75 |         this->declare_parameter("scan_mode");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:35:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:434:3: note: candidate: ‘template<class ParameterT> auto rclcpp::Node::declare_parameter(const string&, const ParameterDescriptor&, bool)’
  434 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:434:3: note:   template argument deduction/substitution failed:
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:75:32: note:   couldn’t deduce template parameter ‘ParameterT’
   75 |         this->declare_parameter("scan_mode");
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:35:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:366:3: note: candidate: ‘const rclcpp::ParameterValue& rclcpp::Node::declare_parameter(const string&, const rclcpp::ParameterValue&, const ParameterDescriptor&, bool)’
  366 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:366:3: note:   candidate expects 4 arguments, 1 provided
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:391:3: note: candidate: ‘const rclcpp::ParameterValue& rclcpp::Node::declare_parameter(const string&, rclcpp::ParameterType, const ParameterDescriptor&, bool)’
  391 |   declare_parameter(
      |   ^~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:391:3: note:   candidate expects 4 arguments, 1 provided
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:23,
                 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/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:35:
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp: In member function ‘int RPLidarScanPublisher::work_loop()’:
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:336:44: warning: format ‘%d’ expects argument of type ‘int’, but argument 8 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]
  336 |             RCLCPP_INFO(this->get_logger(),"current scan mode: %s, max_distance: %.1f m, Point number: %.1fK , angle_compensate: %d",current_scan_mode.scan_mode,
      |                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  337 |                     current_scan_mode.max_distance, (1000/current_scan_mode.us_per_sample), angle_compensate_multiple);
      |                                                                                             ~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                                                             |
      |                                                                                             size_t {aka long unsigned int}
/home/ubuntu/turbot4_ws/src/rplidar_ros/src/rplidar_scan_publisher.cpp:336:131: note: format string is defined here
  336 |             RCLCPP_INFO(this->get_logger(),"current scan mode: %s, max_distance: %.1f m, Point number: %.1fK , angle_compensate: %d",current_scan_mode.scan_mode,
      |                                                                                                                                  ~^
      |                                                                                                                                   |
      |                                                                                                                                   int
      |                                                                                                                                  %ld
gmake[2]: *** [CMakeFiles/rplidar_scan_publisher.dir/build.make:76: CMakeFiles/rplidar_scan_publisher.dir/src/rplidar_scan_publisher.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/rplidar_scan_publisher.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< rplidar_ros2 [3.94s, exited with code 2]
deyouslamtec commented 1 year ago

try the latest version