Ask Your Question
0

ROS2 : Rviz build failed : tf2_geometry_msgs issue

asked 2021-08-15 09:46:21 -0500

baila gravatar image

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
edit retag flag offensive close merge delete

Comments

Which ROS version are you using, and did you install from binaries or source? I saw the following from rviz's README.md

Note: When building the current ros2 branch from source, the latest ROS 2 release for all dependencies might not be sufficient: it could be necessary to build the ROS 2 master branch. Make sure to have a source build of ROS 2 available (see installation procedure above).
ijnek gravatar image ijnek  ( 2021-08-15 21:07:05 -0500 )edit

I installed ROS2 following https://docs.ros.org/en/rolling/Insta...

baila gravatar image baila  ( 2021-08-16 00:20:44 -0500 )edit

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.

ijnek gravatar image ijnek  ( 2021-08-16 01:25:38 -0500 )edit

No success. Getting the same tf2_geometry_msgs/tf2_geometry_msgs.hpp error even if the rosdep installation.

$ rosdep install --from-paths src --ignore-src --rosdistro rolling -y --skip-keys "console_bridge fastcdr fastrtps rti-connext-dds-5.3.1 urdfdom_headers"
#All required rosdeps installed successfully
baila gravatar image baila  ( 2021-08-16 08:13:21 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-08-16 09:26:06 -0500

baila gravatar image

This issue is resolved after following the steps from Rviz Build. Do not do any modifications of path or anything. It will build cleanly.

edit flag offensive delete link more

Comments

Thank you for provide the solution!

kak13 gravatar image kak13  ( 2021-08-19 12:05:29 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

3 followers

Stats

Asked: 2021-08-15 09:46:21 -0500

Seen: 114 times

Last updated: Aug 16