locusrobotics / robot_navigation

Spiritual successor to ros-planning/navigation.
450 stars 148 forks source link

Compilation with tf and tf2 #51

Closed FabianSchurig closed 4 years ago

FabianSchurig commented 4 years ago

Installing and using the robot_navigation by binaries with apt install ros-melodic-robot-navigation works fine. Now, I want to add some changes and tried compiling it with catkin from source. catkin build throws the following error.

I am using Ubuntu 18.04 LTS running ROS melodic and checked out the tf2 branch.

Errors     << nav_2d_utils:make /home/xxx/ws/logs/nav_2d_utils/build.make.002.log                                                                                                                                                                                  
In file included from /home/xxx/ws/src/robot_navigation/nav_2d_utils/src/conversions.cpp:34:
In file included from /home/xxx/ws/src/robot_navigation/nav_2d_utils/include/nav_2d_utils/conversions.h:50:
/opt/ros/melodic/include/tf/tf.h:67:15: error: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Werror,-Wnon-c-typedef-for-linkage]
typedef struct
              ^
               TransformLists
/opt/ros/melodic/include/tf/tf.h:67:9: note: type is not C-compatible due to this member declaration
typedef struct
        ^~~~~~
/opt/ros/melodic/include/tf/tf.h:71:3: note: type is given name 'TransformLists' for linkage purposes by this typedef declaration
} TransformLists;
  ^
1 error generated.

@DLu do you have any hints on compilation or do I miss something?

Thank you in advance!

FabianSchurig commented 4 years ago

It is the -Werror flag in the CMakeLists.txt because I might use a different compiler.

set_directory_properties(PROPERTIES COMPILE_OPTIONS "-std=c++11;-Wall;-Werror")