AutonomyLab / ardrone_autonomy

ROS driver for Parrot AR-Drone 1.0 and 2.0 quadrocopters
http://wiki.ros.org/ardrone_autonomy
BSD 3-Clause "New" or "Revised" License
357 stars 226 forks source link

min on other places of the library refers to macro-defined "min" on ardronelib #232

Open Retorikal opened 2 years ago

Retorikal commented 2 years ago

I tried to compile this on noetic, and got this error somewhere down the line:

[ 96%] Generating EusLisp code from ardrone_autonomy/LedAnim.srv
In file included from /usr/include/c++/9/bits/char_traits.h:39,
                 from /usr/include/c++/9/string:40,
                 from /opt/ros/noetic/include/ros/platform.h:38,
                 from /opt/ros/noetic/include/ros/time.h:53,
                 from /opt/ros/noetic/include/ros/ros.h:38,
                 from /media/ganthet/VAULT/Projects/TA/workspace/src/ardrone_autonomy/include/ardrone_autonomy/ardrone_driver.h:31,
                 from /media/ganthet/VAULT/Projects/TA/workspace/src/ardrone_autonomy/include/ardrone_autonomy/ardrone_sdk.h:70,
                 from /media/ganthet/VAULT/Projects/TA/workspace/src/ardrone_autonomy/include/ardrone_autonomy/video.h:28,
                 from /media/ganthet/VAULT/Projects/TA/workspace/src/ardrone_autonomy/src/video.cpp:25:
/usr/include/c++/9/bits/stl_algobase.h:246:56: error: macro "min" passed 3 arguments, but takes just 2
  246 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |                                                        ^
In file included from /media/ganthet/VAULT/Projects/TA/workspace/devel/src/ardronelib/ARDroneLib/Soft/Common/navdata_common.h:16,
                 from /media/ganthet/VAULT/Projects/TA/workspace/devel/src/ardronelib/ARDroneLib/Soft/Common/ardrone_api.h:22,
                 from /media/ganthet/VAULT/Projects/TA/workspace/devel/src/ardronelib/ARDroneLib/Soft/Lib/ardrone_tool/ardrone_tool.h:4,
                 from /media/ganthet/VAULT/Projects/TA/workspace/src/ardrone_autonomy/include/ardrone_autonomy/ardrone_sdk.h:55,
                 from /media/ganthet/VAULT/Projects/TA/workspace/src/ardrone_autonomy/include/ardrone_autonomy/video.h:28,
                 from /media/ganthet/VAULT/Projects/TA/workspace/src/ardrone_autonomy/src/video.cpp:25:
/media/ganthet/VAULT/Projects/TA/workspace/devel/src/ardronelib/ARDroneLib/Soft/Lib/Maths/maths.h:31: note: macro "min" defined here
   31 | #define min(a, b) (a) < (b) ? (a) : (b)
      |

Is there anything I can do to prevent this? Looks like the min declaration leaked out or something.