Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tf2_geometry_msgs header file #6

Open
mfe7 opened this issue Jan 27, 2023 · 0 comments
Open

tf2_geometry_msgs header file #6

mfe7 opened this issue Jan 27, 2023 · 0 comments

Comments

@mfe7
Copy link

mfe7 commented Jan 27, 2023

On Ubuntu 22.04 with ROS2 Humble, I was getting this error:

/home/mfe/scout_ws/src/scout_ros2/scout_base/include/scout_base/scout_messenger.hpp:21:10: fatal error: tf2_geometry_msgs/tf2_geometry_msgs.h: No such file or directory
   21 | #include <tf2_geometry_msgs/tf2_geometry_msgs.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

which I fixed by adding these 3 lines to CMakeLists.txt. Not sure if that is the right way to do so.

include_directories(/opt/ros/humble/include/tf2_geometry_msgs)
include_directories(/opt/ros/humble/include/tf2)
include_directories(/opt/ros/humble/include/tf2_ros)

per this comment and the error went away.

I also was getting this warning:

In file included from /home/mfe/scout_ws/src/scout_ros2/scout_base/include/scout_base/scout_messenger.hpp:21,
                 from /home/mfe/scout_ws/src/scout_ros2/scout_base/src/scout_base_ros.cpp:12:
/opt/ros/humble/include/tf2_geometry_msgs/tf2_geometry_msgs/tf2_geometry_msgs.h:35:2: warning: #warning is a GCC extension
   35 | #warning This header is obsolete, please include tf2_geometry_msgs/tf2_geometry_msgs.hpp instead
      |  ^~~~~~~
/opt/ros/humble/include/tf2_geometry_msgs/tf2_geometry_msgs/tf2_geometry_msgs.h:35:2: warning: #warning This header is obsolete, please include tf2_geometry_msgs/tf2_geometry_msgs.hpp instead [-Wcpp]
---

but this went away when I replaced the header extension to be .hpp instead of .h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant