ros-drivers / microstrain_3dmgx2_imu

A driver for IMUs compatible the microstrain 3DM-GX2 and 3DM-GX3 protoco
GNU Lesser General Public License v2.1
16 stars 29 forks source link

Fix build error with GCC 7.3 + Ubuntu Bionic + ROS Melodic #10

Closed Julopvel closed 5 years ago

Julopvel commented 5 years ago

The attached changes are required to solve this build error:

/home/summit/catkin_ws/src/microstrain_3dmgx2_imu/include/microstrain_3dmgx2_imu/3dmgx2.h:101:25: error: ‘constexpr’ needed for in-class initialization of static data member ‘const double microstrain_3dmgx2_imu::IMU::KF_K_1’ of non-integral type [-fpermissive]
     static const double KF_K_1          = 0.00995031;
                         ^~~~~~
/home/summit/catkin_ws/src/microstrain_3dmgx2_imu/include/microstrain_3dmgx2_imu/3dmgx2.h:103:25: error: ‘constexpr’ needed for in-class initialization of static data member ‘const double microstrain_3dmgx2_imu::IMU::KF_K_2’ of non-integral type [-fpermissive]
     static const double KF_K_2          = 0.0000497506;
                         ^~~~~~
/home/summit/catkin_ws/src/microstrain_3dmgx2_imu/include/microstrain_3dmgx2_imu/3dmgx2.h:108:25: error: ‘constexpr’ needed for in-class initialization of static data member ‘const double microstrain_3dmgx2_imu::IMU::G’ of non-integral type [-fpermissive]
     static const double G               = 9.80665;
                         ^
k-okada commented 5 years ago

@Julopvel this is good for ubuntu 18.04, but broken on 14.04. if you need the source tree compilable both on 14 and 18, please check https://github.com/k-okada/microstrain_3dmgx2_imu/commit/f06c83793e98318c4687e475e198bb08d039fca7

any way, please merge and release into melodic. @chadrockey

k-okada commented 5 years ago

@davefeilseifer Thank you for releasing, but I am afraid it is failing on the build server -> http://build.ros.org/job/Mbin_uB64__microstrain_3dmgx2_imu__ubuntu_bionic_amd64__binary/

To compile on 18.04, I think we need to merge this PR (but need to drop 14.04) Or create new PR from https://github.com/k-okada/microstrain_3dmgx2_imu/commit/f06c83793e98318c4687e475e198bb08d039fca7, which can continue compile on both 18.04 and 14.04

Thanks

scpeters commented 5 years ago

@k-okada thanks for supplying k-okada@f06c837; I've submitted it as a backwards-compatible alternative to this in #11. @davefeilseifer it does feel a little weird to break support for trusty on the branch named indigo-devel. Perhaps #11 can be merged to indigo-devel and this PR could be merged to a new melodic-devel branch? At any rate, it would be really helpful to merge one of these in order to fix the melodic builds.

Cheers!

tonybaltovski commented 5 years ago

Closing in favour of #11