ROS2 : Rviz build failed : tf2_geometry_msgs issue
Hello All, while building the Rviz for for ROS2, getting below errors for tf2_geometry_msgs. I came to know that tf2 is not ported yet. Can anyone help with the compilation?
Starting >>> rviz_default_plugins
[Processing: rviz_default_plugins]
--- stderr: rviz_default_plugins
In file included from ~/ros2_rviz/build/rviz_default_plugins/include/rviz_default_plugins/transformation/../../../../../src/rviz/rviz_default_plugins/include/rviz_default_plugins/transformation/transformer_guard.hpp:43,
from ~/ros2_rviz/build/rviz_default_plugins/include/rviz_default_plugins/transformation/moc_transformer_guard.cpp:9:
~/ros2_rviz/src/rviz/rviz_default_plugins/include/rviz_default_plugins/transformation/tf_wrapper.hpp:40:10: fatal error: tf2_geometry_msgs/tf2_geometry_msgs.hpp: No such file or directory
40 | #include "tf2_geometry_msgs/tf2_geometry_msgs.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/rviz_default_plugins.dir/build.make:390: CMakeFiles/rviz_default_plugins.dir/include/rviz_default_plugins/transformation/moc_transformer_guard.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from ~/ros2_rviz/src/rviz/rviz_default_plugins/include/rviz_default_plugins/transformation/transformer_guard.hpp:43,
from ~/ros2_rviz/build/rviz_default_plugins/include/rviz_default_plugins/displays/laser_scan/../../../../../../src/rviz/rviz_default_plugins/include/rviz_default_plugins/displays/laser_scan/laser_scan_display.hpp:45,
from ~/ros2_rviz/build/rviz_default_plugins/include/rviz_default_plugins/displays/laser_scan/moc_laser_scan_display.cpp:9:
~/ros2_rviz/src/rviz/rviz_default_plugins/include/rviz_default_plugins/transformation/tf_wrapper.hpp:40:10: fatal error: tf2_geometry_msgs/tf2_geometry_msgs.hpp: No such file or directory
40 | #include "tf2_geometry_msgs/tf2_geometry_msgs.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/rviz_default_plugins.dir/build.make:338: CMakeFiles/rviz_default_plugins.dir/include/rviz_default_plugins/displays/laser_scan/moc_laser_scan_display.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1928: CMakeFiles/rviz_default_plugins.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
---
Failed <<< rviz_default_plugins [58.1s, exited with code 2]
Summary: 6 packages finished [1min 21s]
1 package failed: rviz_default_plugins
1 package had stderr output: rviz_default_plugins
1 package not processed
Which ROS version are you using, and did you install from binaries or source? I saw the following from rviz's README.md
I installed ROS2 following https://docs.ros.org/en/rolling/Insta...
Only suggestion I can think of, is to re-run rosdep, to make sure tf2_geometry_msgs gets installed correctly. It is listed as a dependency correctly in package.xml of rviz.
Try running below, taken from this step of installation procedure
In your workspace,
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro rolling -y --skip-keys "console_bridge fastcdr fastrtps rti-connext-dds-5.3.1 urdfdom_headers"
And re-run the colcon build command.
No success. Getting the same
tf2_geometry_msgs/tf2_geometry_msgs.hpp
error even if the rosdep installation.