yujinrobot / kobuki_desktop

Visualisation and simulation tools for Kobuki
http://www.ros.org/wiki/kobuki_desktop
37 stars 58 forks source link

Fix compile errors in kobuki_gazebo_plugins with Kinetic and Gazebo7 #45

Closed rohbotics closed 8 years ago

rohbotics commented 8 years ago

Kinetic moved to Gazebo7 which requires c++11 and has many changes to the API, this pull request makes koubki_gazebo_plugins compile with no errors on kinetic and Ubuntu 16.04.

This should be pulled into a separate branch for kinetic.

stonier commented 8 years ago

This looks good. I created the kinetic branch off jade. Could you resend this PR to the kinetic branch?

ghost commented 8 years ago

Thanks @rohbotics, these changes allowed me to compile Kobuki, although it seems I have not been receiving the same errors as others.

For one, I never received an error message requiring C++11 to be declared (like in #44), so I didn't modify my CMakeList.txt file.

I also received error messages referring to deprecated functions GetRange() and GetContact() - I fixed these by removing 'Get' from their names to put them in accordance to their current names (I found this link useful in finding their current names).

Edit: I just realized that the GetRange() and GetContact() messages are warnings, not errors. The changes I've made in the .cpp code to remove these warnings still allowed Kobuki to build.

rohbotics commented 8 years ago

@cerebro-deux What platform are you running on (OS, ROS version, Arch) ?

Thanks for the link, I will try to see if I can get rid of some of the warnings on the build.

ghost commented 8 years ago

@rohbotics I'm using Ubuntu Xenial, with ROS Kinetic. I've built Kobuki (and TurtleBot) following the instructions here, of course with your fixes. ROS and Gazebo were installed using apt-get in Ubuntu, but Rocon, Kobuki and TurtleBot were built from source.

rohbotics commented 8 years ago

@stonier Rebased in #46

@cerebro-deux, It's interesting that you are not getting the compiler error about C++11 features, I tried on a fresh install of Xenial, and the first error in the log was

In file included from /usr/include/c++/5/random:35:0,
                 from /usr/include/ignition/math2/ignition/math/Rand.hh:20,
                 from /usr/include/ignition/math2/ignition/math.hh:18,
                 from /usr/include/sdformat-4.0/sdf/Param.hh:34,
                 from /usr/include/sdformat-4.0/sdf/Element.hh:24,
                 from /usr/include/sdformat-4.0/sdf/sdf.hh:5,
                 from /usr/include/gazebo-7/gazebo/common/Battery.hh:25,
                 from /usr/include/gazebo-7/gazebo/common/common.hh:8,
                 from /usr/include/gazebo-7/gazebo/gazebo_core.hh:19,
                 from /usr/include/gazebo-7/gazebo/gazebo.hh:20,
                 from /home/rohan/catkin_ws/src/kobuki_desktop/kobuki_gazebo_plugins/include/kobuki_gazebo_plugins/gazebo_ros_kobuki.h:45,
                 from /home/rohan/catkin_ws/src/kobuki_desktop/kobuki_gazebo_plugins/src/gazebo_ros_kobuki_loads.cpp:36:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support \

Maybe you have a non-default version of gcc, but I am not sure.

ghost commented 8 years ago

@rohbotics - Yes, I have a fresh install of Xenial too. This is what came out of gcc --version: gcc (Ubuntu 5.3.1-14ubuntu2.1) 5.3.1 20160413

In any case, Kobuki and Turtlebot were able to build.