SICKAG / sick_scan_xd

Based on the sick_scan drivers for ROS1, sick_scan_xd merges sick_scan, sick_scan2 and sick_scan_base repositories. The driver supports both Linux (native, ROS1, ROS2) and Windows (native and ROS2).
Apache License 2.0
95 stars 85 forks source link

please check this error #213

Closed SeongJun-Hwang closed 11 months ago

SeongJun-Hwang commented 11 months ago

path : catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h

When I compile with this code, then console returned Error

102 # if defined _MSC_VER
103 #define MAX(a,b) (((a) > (b)) ? (a) : (b))
104 #define MIN(a,b) (((a) < (b)) ? (a) : (b))
105 #else
106 #define MAX std::max
107 #define MIN std::min
108 #endif

then ,


/opt/ros/noetic/include/ros/time.h:225:51: note: in expansion of macro ‘MIN’
  225 |   template<> const Time TimeBase<Time, Duration>::MIN;
      |                                                   ^~~
In file included from /opt/ros/noetic/include/ros/ros.h:38,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:134,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/abstract_parser.h:39,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/abstract_parser.cpp:63:
/opt/ros/noetic/include/ros/time.h:225:25: warning: too many template headers for ‘ros::min’ (should be 0)
  225 |   template<> const Time TimeBase<Time, Duration>::MIN;
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/abstract_parser.h:39,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/abstract_parser.cpp:63:
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:106:13: error: ‘ros::TimeBase<ros::WallTime, ros::WallDuration>::std’ has not been declared
  106 | #define MAX std::max
      |             ^~~
/opt/ros/noetic/include/ros/time.h:261:63: note: in expansion of macro ‘MAX’
  261 |   template<> const WallTime TimeBase<WallTime, WallDuration>::MAX;
      |                                                               ^~~
In file included from /opt/ros/noetic/include/ros/ros.h:38,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:134,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/abstract_parser.h:39,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/abstract_parser.cpp:63:
/opt/ros/noetic/include/ros/time.h:261:29: warning: too many template headers for ‘ros::max’ (should be 0)
  261 |   template<> const WallTime TimeBase<WallTime, WallDuration>::MAX;
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/abstract_parser.h:39,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/abstract_parser.cpp:63:
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:107:13: error: ‘ros::TimeBase<ros::WallTime, ros::WallDuration>::std’ has not been declared
  107 | #define MIN std::min
      |             ^~~
/opt/ros/noetic/include/ros/time.h:262:63: note: in expansion of macro ‘MIN’
  262 |   template<> const WallTime TimeBase<WallTime, WallDuration>::MIN;
      |                                                               ^~~
In file included from /opt/ros/noetic/include/ros/ros.h:38,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:134,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/abstract_parser.h:39,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/abstract_parser.cpp:63:
/opt/ros/noetic/include/ros/time.h:262:29: warning: too many template headers for ‘ros::min’ (should be 0)
  262 |   template<> const WallTime TimeBase<WallTime, WallDuration>::MIN;
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/abstract_parser.h:39,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/abstract_parser.cpp:63:
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:106:13: error: ‘ros::TimeBase<ros::SteadyTime, ros::WallDuration>::std’ has not been declared
  106 | #define MAX std::max
      |             ^~~
/opt/ros/noetic/include/ros/time.h:300:67: note: in expansion of macro ‘MAX’
  300 |   template<> const SteadyTime TimeBase<SteadyTime, WallDuration>::MAX;
      |                                                                   ^~~
In file included from /opt/ros/noetic/include/ros/ros.h:38,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:134,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/abstract_parser.h:39,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/abstract_parser.cpp:63:
/opt/ros/noetic/include/ros/time.h:300:31: warning: too many template headers for ‘ros::max’ (should be 0)
  300 |   template<> const SteadyTime TimeBase<SteadyTime, WallDuration>::MAX;
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/abstract_parser.h:39,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/abstract_parser.cpp:63:
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:107:13: error: ‘ros::TimeBase<ros::SteadyTime, ros::WallDuration>::std’ has not been declared
  107 | #define MIN std::min
      |             ^~~
/opt/ros/noetic/include/ros/time.h:301:67: note: in expansion of macro ‘MIN’
  301 |   template<> const SteadyTime TimeBase<SteadyTime, WallDuration>::MIN;
      |                                                                   ^~~
In file included from /opt/ros/noetic/include/ros/ros.h:38,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:134,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/abstract_parser.h:39,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/abstract_parser.cpp:63:
/opt/ros/noetic/include/ros/time.h:301:31: warning: too many template headers for ‘ros::min’ (should be 0)
  301 |   template<> const SteadyTime TimeBase<SteadyTime, WallDuration>::MIN;
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/abstract_parser.h:39,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/abstract_parser.cpp:63:
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:107:18: error: invalid use of ‘::’
  107 | #define MIN std::min
      |                  ^~~
/opt/ros/noetic/include/ros/time.h:163:20: note: in expansion of macro ‘MIN’
  163 |     static const T MIN; //!< Minimum representable time
      |                    ^~~
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:106:18: error: invalid use of ‘::’
  106 | #define MAX std::max
      |                  ^~~
/opt/ros/noetic/include/ros/time.h:164:20: note: in expansion of macro ‘MAX’
  164 |     static const T MAX; //!< Maximum representable time
      |                    ^~~
In file included from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:107:18: error: invalid use of ‘::’
  107 | #define MIN std::min
      |                  ^~~
/opt/ros/noetic/include/ros/time.h:163:20: note: in expansion of macro ‘MIN’
  163 |     static const T MIN; //!< Minimum representable time
      |                    ^~~
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:106:18: error: invalid use of ‘::’
  106 | #define MAX std::max
      |                  ^~~
/opt/ros/noetic/include/ros/time.h:164:20: note: in expansion of macro ‘MAX’
  164 |     static const T MAX; //!< Maximum representable time
      |                    ^~~
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:106:13: error: ‘ros::TimeBase<ros::Time, ros::Duration>::std’ has not been declared
  106 | #define MAX std::max
      |             ^~~
/opt/ros/noetic/include/ros/time.h:224:51: note: in expansion of macro ‘MAX’
  224 |   template<> const Time TimeBase<Time, Duration>::MAX;
      |                                                   ^~~
In file included from /opt/ros/noetic/include/ros/ros.h:38,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:134,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/abstract_parser.h:39,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/abstract_parser.cpp:63:
/opt/ros/noetic/include/ros/time.h:224:25: warning: too many template headers for ‘ros::max’ (should be 0)
  224 |   template<> const Time TimeBase<Time, Duration>::MAX;
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/abstract_parser.h:39,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/abstract_parser.cpp:63:
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:107:13: error: ‘ros::TimeBase<ros::Time, ros::Duration>::std’ has not been declared
  107 | #define MIN std::min
      |             ^~~
/opt/ros/noetic/include/ros/time.h:225:51: note: in expansion of macro ‘MIN’
  225 |   template<> const Time TimeBase<Time, Duration>::MIN;
      |                                                   ^~~
In file included from /opt/ros/noetic/include/ros/ros.h:38,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:134,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/abstract_parser.h:39,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/abstract_parser.cpp:63:
/opt/ros/noetic/include/ros/time.h:225:25: warning: too many template headers for ‘ros::min’ (should be 0)
  225 |   template<> const Time TimeBase<Time, Duration>::MIN;
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:106:13: error: ‘ros::TimeBase<ros::Time, ros::Duration>::std’ has not been declared
  106 | #define MAX std::max
      |             ^~~
/opt/ros/noetic/include/ros/time.h:224:51: note: in expansion of macro ‘MAX’
  224 |   template<> const Time TimeBase<Time, Duration>::MAX;
      |                                                   ^~~
In file included from /opt/ros/noetic/include/ros/ros.h:38,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:134,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/opt/ros/noetic/include/ros/time.h:224:25: warning: too many template headers for ‘ros::max’ (should be 0)
  224 |   template<> const Time TimeBase<Time, Duration>::MAX;
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:107:13: error: ‘ros::TimeBase<ros::Time, ros::Duration>::std’ has not been declared
  107 | #define MIN std::min
      |             ^~~
/opt/ros/noetic/include/ros/time.h:225:51: note: in expansion of macro ‘MIN’
  225 |   template<> const Time TimeBase<Time, Duration>::MIN;
      |                                                   ^~~
In file included from /opt/ros/noetic/include/ros/ros.h:38,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:134,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/opt/ros/noetic/include/ros/time.h:225:25: warning: too many template headers for ‘ros::min’ (should be 0)
  225 |   template<> const Time TimeBase<Time, Duration>::MIN;
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/abstract_parser.h:39,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/abstract_parser.cpp:63:
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:106:13: error: ‘ros::TimeBase<ros::WallTime, ros::WallDuration>::std’ has not been declared
  106 | #define MAX std::max
      |             ^~~
/opt/ros/noetic/include/ros/time.h:261:63: note: in expansion of macro ‘MAX’
  261 |   template<> const WallTime TimeBase<WallTime, WallDuration>::MAX;
      |                                                               ^~~
In file included from /opt/ros/noetic/include/ros/ros.h:38,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:134,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/abstract_parser.h:39,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/abstract_parser.cpp:63:
/opt/ros/noetic/include/ros/time.h:261:29: warning: too many template headers for ‘ros::max’ (should be 0)
  261 |   template<> const WallTime TimeBase<WallTime, WallDuration>::MAX;
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/abstract_parser.h:39,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/abstract_parser.cpp:63:
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:107:13: error: ‘ros::TimeBase<ros::WallTime, ros::WallDuration>::std’ has not been declared
  107 | #define MIN std::min
      |             ^~~
/opt/ros/noetic/include/ros/time.h:262:63: note: in expansion of macro ‘MIN’
  262 |   template<> const WallTime TimeBase<WallTime, WallDuration>::MIN;
      |                                                               ^~~
In file included from /opt/ros/noetic/include/ros/ros.h:38,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:134,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/abstract_parser.h:39,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/abstract_parser.cpp:63:
/opt/ros/noetic/include/ros/time.h:262:29: warning: too many template headers for ‘ros::min’ (should be 0)
  262 |   template<> const WallTime TimeBase<WallTime, WallDuration>::MIN;
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:106:13: error: ‘ros::TimeBase<ros::WallTime, ros::WallDuration>::std’ has not been declared
  106 | #define MAX std::max
      |             ^~~
/opt/ros/noetic/include/ros/time.h:261:63: note: in expansion of macro ‘MAX’
  261 |   template<> const WallTime TimeBase<WallTime, WallDuration>::MAX;
      |                                                               ^~~
In file included from /opt/ros/noetic/include/ros/ros.h:38,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:134,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/opt/ros/noetic/include/ros/time.h:261:29: warning: too many template headers for ‘ros::max’ (should be 0)
  261 |   template<> const WallTime TimeBase<WallTime, WallDuration>::MAX;
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:107:13: error: ‘ros::TimeBase<ros::WallTime, ros::WallDuration>::std’ has not been declared
  107 | #define MIN std::min
      |             ^~~
/opt/ros/noetic/include/ros/time.h:262:63: note: in expansion of macro ‘MIN’
  262 |   template<> const WallTime TimeBase<WallTime, WallDuration>::MIN;
      |                                                               ^~~
In file included from /opt/ros/noetic/include/ros/ros.h:38,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:134,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/opt/ros/noetic/include/ros/time.h:262:29: warning: too many template headers for ‘ros::min’ (should be 0)
  262 |   template<> const WallTime TimeBase<WallTime, WallDuration>::MIN;
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/abstract_parser.h:39,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/abstract_parser.cpp:63:
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:106:13: error: ‘ros::TimeBase<ros::SteadyTime, ros::WallDuration>::std’ has not been declared
  106 | #define MAX std::max
      |             ^~~
/opt/ros/noetic/include/ros/time.h:300:67: note: in expansion of macro ‘MAX’
  300 |   template<> const SteadyTime TimeBase<SteadyTime, WallDuration>::MAX;
      |                                                                   ^~~
In file included from /opt/ros/noetic/include/ros/ros.h:38,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:134,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/abstract_parser.h:39,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/abstract_parser.cpp:63:
/opt/ros/noetic/include/ros/time.h:300:31: warning: too many template headers for ‘ros::max’ (should be 0)
  300 |   template<> const SteadyTime TimeBase<SteadyTime, WallDuration>::MAX;
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/abstract_parser.h:39,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/abstract_parser.cpp:63:
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:107:13: error: ‘ros::TimeBase<ros::SteadyTime, ros::WallDuration>::std’ has not been declared
  107 | #define MIN std::min
      |             ^~~
/opt/ros/noetic/include/ros/time.h:301:67: note: in expansion of macro ‘MIN’
  301 |   template<> const SteadyTime TimeBase<SteadyTime, WallDuration>::MIN;
      |                                                                   ^~~
In file included from /opt/ros/noetic/include/ros/ros.h:38,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:134,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/abstract_parser.h:39,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/abstract_parser.cpp:63:
/opt/ros/noetic/include/ros/time.h:301:31: warning: too many template headers for ‘ros::min’ (should be 0)
  301 |   template<> const SteadyTime TimeBase<SteadyTime, WallDuration>::MIN;
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:106:13: error: ‘ros::TimeBase<ros::SteadyTime, ros::WallDuration>::std’ has not been declared
  106 | #define MAX std::max
      |             ^~~
/opt/ros/noetic/include/ros/time.h:300:67: note: in expansion of macro ‘MAX’
  300 |   template<> const SteadyTime TimeBase<SteadyTime, WallDuration>::MAX;
      |                                                                   ^~~
In file included from /opt/ros/noetic/include/ros/ros.h:38,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:134,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/opt/ros/noetic/include/ros/time.h:300:31: warning: too many template headers for ‘ros::max’ (should be 0)
  300 |   template<> const SteadyTime TimeBase<SteadyTime, WallDuration>::MAX;
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:107:13: error: ‘ros::TimeBase<ros::SteadyTime, ros::WallDuration>::std’ has not been declared
  107 | #define MIN std::min
      |             ^~~
/opt/ros/noetic/include/ros/time.h:301:67: note: in expansion of macro ‘MIN’
  301 |   template<> const SteadyTime TimeBase<SteadyTime, WallDuration>::MIN;
      |                                                                   ^~~
In file included from /opt/ros/noetic/include/ros/ros.h:38,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:134,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/opt/ros/noetic/include/ros/time.h:301:31: warning: too many template headers for ‘ros::min’ (should be 0)
  301 |   template<> const SteadyTime TimeBase<SteadyTime, WallDuration>::MIN;
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/sick_scan_lib.dir/build.make:128: CMakeFiles/sick_scan_lib.dir/driver/src/sick_cloud_transform.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 63%] Building CXX object CMakeFiles/sick_scan_shared_lib.dir/driver/src/sick_cloud_transform.cpp.o
make[2]: *** [CMakeFiles/sick_scan_shared_lib.dir/build.make:63: CMakeFiles/sick_scan_shared_lib.dir/driver/src/abstract_parser.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/sick_scan_lib.dir/build.make:63: CMakeFiles/sick_scan_lib.dir/driver/src/abstract_parser.cpp.o] Error 1
make[2]: *** [CMakeFiles/sick_scan_lib.dir/build.make:141: CMakeFiles/sick_scan_lib.dir/driver/src/sick_generic_callback.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2520: CMakeFiles/sick_scan_lib.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
In file included from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:107:18: error: invalid use of ‘::’
  107 | #define MIN std::min
      |                  ^~~
/opt/ros/noetic/include/ros/duration.h:98:18: note: in expansion of macro ‘MIN’
   98 |   static const T MIN; //!< Minimum representable duration (negative)
      |                  ^~~
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:106:18: error: invalid use of ‘::’
  106 | #define MAX std::max
      |                  ^~~
/opt/ros/noetic/include/ros/duration.h:99:18: note: in expansion of macro ‘MAX’
   99 |   static const T MAX; //!< Maximum representable duration
      |                  ^~~
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:106:13: error: ‘ros::DurationBase<ros::Duration>::std’ has not been declared
  106 | #define MAX std::max
      |             ^~~
/opt/ros/noetic/include/ros/duration.h:139:51: note: in expansion of macro ‘MAX’
  139 | template<> const Duration DurationBase<Duration>::MAX;
      |                                                   ^~~
In file included from /opt/ros/noetic/include/ros/time.h:57,
                 from /opt/ros/noetic/include/ros/ros.h:38,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:134,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/opt/ros/noetic/include/ros/duration.h:139:27: warning: too many template headers for ‘ros::max’ (should be 0)
  139 | template<> const Duration DurationBase<Duration>::MAX;
      |                           ^~~~~~~~~~~~~~~~~~~~~~
In file included from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:107:13: error: ‘ros::DurationBase<ros::Duration>::std’ has not been declared
  107 | #define MIN std::min
      |             ^~~
/opt/ros/noetic/include/ros/duration.h:140:51: note: in expansion of macro ‘MIN’
  140 | template<> const Duration DurationBase<Duration>::MIN;
      |                                                   ^~~
In file included from /opt/ros/noetic/include/ros/time.h:57,
                 from /opt/ros/noetic/include/ros/ros.h:38,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:134,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/opt/ros/noetic/include/ros/duration.h:140:27: warning: too many template headers for ‘ros::min’ (should be 0)
  140 | template<> const Duration DurationBase<Duration>::MIN;
      |                           ^~~~~~~~~~~~~~~~~~~~~~
In file included from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:106:13: error: ‘ros::DurationBase<ros::WallDuration>::std’ has not been declared
  106 | #define MAX std::max
      |             ^~~
/opt/ros/noetic/include/ros/duration.h:175:59: note: in expansion of macro ‘MAX’
  175 | template<> const WallDuration DurationBase<WallDuration>::MAX;
      |                                                           ^~~
In file included from /opt/ros/noetic/include/ros/time.h:57,
                 from /opt/ros/noetic/include/ros/ros.h:38,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:134,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/opt/ros/noetic/include/ros/duration.h:175:31: warning: too many template headers for ‘ros::max’ (should be 0)
  175 | template<> const WallDuration DurationBase<WallDuration>::MAX;
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:107:13: error: ‘ros::DurationBase<ros::WallDuration>::std’ has not been declared
  107 | #define MIN std::min
      |             ^~~
/opt/ros/noetic/include/ros/duration.h:176:59: note: in expansion of macro ‘MIN’
  176 | template<> const WallDuration DurationBase<WallDuration>::MIN;
      |                                                           ^~~
In file included from /opt/ros/noetic/include/ros/time.h:57,
                 from /opt/ros/noetic/include/ros/ros.h:38,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:134,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/opt/ros/noetic/include/ros/duration.h:176:31: warning: too many template headers for ‘ros::min’ (should be 0)
  176 | template<> const WallDuration DurationBase<WallDuration>::MIN;
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:107:18: error: invalid use of ‘::’
  107 | #define MIN std::min
      |                  ^~~
/opt/ros/noetic/include/ros/time.h:163:20: note: in expansion of macro ‘MIN’
  163 |     static const T MIN; //!< Minimum representable time
      |                    ^~~
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:106:18: error: invalid use of ‘::’
  106 | #define MAX std::max
      |                  ^~~
/opt/ros/noetic/include/ros/time.h:164:20: note: in expansion of macro ‘MAX’
  164 |     static const T MAX; //!< Maximum representable time
      |                    ^~~
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:106:13: error: ‘ros::TimeBase<ros::Time, ros::Duration>::std’ has not been declared
  106 | #define MAX std::max
      |             ^~~
/opt/ros/noetic/include/ros/time.h:224:51: note: in expansion of macro ‘MAX’
  224 |   template<> const Time TimeBase<Time, Duration>::MAX;
      |                                                   ^~~
In file included from /opt/ros/noetic/include/ros/ros.h:38,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:134,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/opt/ros/noetic/include/ros/time.h:224:25: warning: too many template headers for ‘ros::max’ (should be 0)
  224 |   template<> const Time TimeBase<Time, Duration>::MAX;
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:107:13: error: ‘ros::TimeBase<ros::Time, ros::Duration>::std’ has not been declared
  107 | #define MIN std::min
      |             ^~~
/opt/ros/noetic/include/ros/time.h:225:51: note: in expansion of macro ‘MIN’
  225 |   template<> const Time TimeBase<Time, Duration>::MIN;
      |                                                   ^~~
In file included from /opt/ros/noetic/include/ros/ros.h:38,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:134,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/opt/ros/noetic/include/ros/time.h:225:25: warning: too many template headers for ‘ros::min’ (should be 0)
  225 |   template<> const Time TimeBase<Time, Duration>::MIN;
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:106:13: error: ‘ros::TimeBase<ros::WallTime, ros::WallDuration>::std’ has not been declared
  106 | #define MAX std::max
      |             ^~~
/opt/ros/noetic/include/ros/time.h:261:63: note: in expansion of macro ‘MAX’
  261 |   template<> const WallTime TimeBase<WallTime, WallDuration>::MAX;
      |                                                               ^~~
In file included from /opt/ros/noetic/include/ros/ros.h:38,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:134,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/opt/ros/noetic/include/ros/time.h:261:29: warning: too many template headers for ‘ros::max’ (should be 0)
  261 |   template<> const WallTime TimeBase<WallTime, WallDuration>::MAX;
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:107:13: error: ‘ros::TimeBase<ros::WallTime, ros::WallDuration>::std’ has not been declared
  107 | #define MIN std::min
      |             ^~~
/opt/ros/noetic/include/ros/time.h:262:63: note: in expansion of macro ‘MIN’
  262 |   template<> const WallTime TimeBase<WallTime, WallDuration>::MIN;
      |                                                               ^~~
In file included from /opt/ros/noetic/include/ros/ros.h:38,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:134,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/opt/ros/noetic/include/ros/time.h:262:29: warning: too many template headers for ‘ros::min’ (should be 0)
  262 |   template<> const WallTime TimeBase<WallTime, WallDuration>::MIN;
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:106:13: error: ‘ros::TimeBase<ros::SteadyTime, ros::WallDuration>::std’ has not been declared
  106 | #define MAX std::max
      |             ^~~
/opt/ros/noetic/include/ros/time.h:300:67: note: in expansion of macro ‘MAX’
  300 |   template<> const SteadyTime TimeBase<SteadyTime, WallDuration>::MAX;
      |                                                                   ^~~
In file included from /opt/ros/noetic/include/ros/ros.h:38,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:134,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/opt/ros/noetic/include/ros/time.h:300:31: warning: too many template headers for ‘ros::max’ (should be 0)
  300 |   template<> const SteadyTime TimeBase<SteadyTime, WallDuration>::MAX;
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:107:13: error: ‘ros::TimeBase<ros::SteadyTime, ros::WallDuration>::std’ has not been declared
  107 | #define MIN std::min
      |             ^~~
/opt/ros/noetic/include/ros/time.h:301:67: note: in expansion of macro ‘MIN’
  301 |   template<> const SteadyTime TimeBase<SteadyTime, WallDuration>::MIN;
      |                                                                   ^~~
In file included from /opt/ros/noetic/include/ros/ros.h:38,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_ros_wrapper.h:134,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/include/sick_scan/sick_cloud_transform.h:73,
                 from /home/zestech/catkin_ws/src/sick_scan_xd/driver/src/sick_cloud_transform.cpp:58:
/opt/ros/noetic/include/ros/time.h:301:31: warning: too many template headers for ‘ros::min’ (should be 0)
  301 |   template<> const SteadyTime TimeBase<SteadyTime, WallDuration>::MIN;
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/sick_scan_shared_lib.dir/build.make:128: CMakeFiles/sick_scan_shared_lib.dir/driver/src/sick_cloud_transform.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:447: CMakeFiles/sick_scan_shared_lib.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
<== Failed to process package 'sick_scan': 
  Command '['/home/zestech/catkin_ws/install_isolated/env.sh', 'make', '-j4', '-l4']' returned non-zero exit status 2.

Reproduce this error by running:
==> cd /home/zestech/catkin_ws/build_isolated/sick_scan && /home/zestech/catkin_ws/install_isolated/env.sh make -j4 -l4

Command failed, exiting.

so i modified thiis code to next

#if defined _MSC_VER
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#else
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#endif

As a result it work

what is the right way?

rostest commented 11 months ago

Thanks for your feedback. Depending on the ROS distribution, MIN and MAX can be multiple defined. This error will be corrected in the next release.

Your fix looks good. Alternatively, you can use sick_scan_xd branch https://github.com/SICKAG/sick_scan_xd/tree/feature/bloom_pretest (see also issue https://github.com/SICKAG/sick_scan_xd/issues/202).