FLT_MAX not declared

Issue #11 resolved
Former user created an issue

After installing libnlopt(-dev) from Trusty on Precise, I've been able to get all pkgs in this repository to compile on a Hydro installation, and the plugin seems to work correctly.

I did run into issues with the FLT_MAX symbol not being defined. This appears to be used in trac_ik_lib/src/kdl_tl.cpp and trac_ik_lib/src/trac_ik.cpp. Including cmath fixes this (same for trac_ik.cpp):

diff --git a/trac_ik_lib/src/kdl_tl.cpp b/trac_ik_lib/src/kdl_tl.cpp
index 6df087f..4dc6d89 100644
--- a/trac_ik_lib/src/kdl_tl.cpp
+++ b/trac_ik_lib/src/kdl_tl.cpp
@@ -31,6 +31,8 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <trac_ik/kdl_tl.hpp>
 #include <boost/date_time.hpp>
 #include <ros/ros.h>
+#include <cfloat>
+

 namespace KDL
 {

I'm curious though: wouldn't numeric_limits<float>::max() from limits have been more appropriate?

Comments (5)

  1. gavanderhoorn

    FLT_MAX and std::numeric_limits<float>::max() are equivalent numbers

    Sure. std::numeric_limits<float>::max() is proper C++ though.

  2. Log in to comment