nav2_util - no such file or directory tf2_geometry_msgs
Hello,
I have observed during building the Navigation2 from source on new PC (with ROS Galactic, Ubuntu 20.04) that the nav2_util
package won't build correctly:
...
Finished <<< nav2_simple_commander [0.69s]
--- stderr: nav2_util
In file included from /home/piotr/nav2_ws/src/navigation2/nav2_util/src/costmap.cpp:19:
/home/piotr/nav2_ws/src/navigation2/nav2_util/include/nav2_util/geometry_utils.hpp:24:10: fatal error: tf2_geometry_msgs/tf2_geometry_msgs.hpp: No such file or directory
24 | #include "tf2_geometry_msgs/tf2_geometry_msgs.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [src/CMakeFiles/nav2_util_core.dir/build.make:76: src/CMakeFiles/nav2_util_core.dir/costmap.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:212: src/CMakeFiles/nav2_util_core.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:146: all] Error 2
---
Failed <<< nav2_util [8.28s, exited with code 2]Summary: 6 packages finished [31.9s]
1 package failed: nav2_util
1 package had stderr output: nav2_util
27 packages not processed
I followed these steps:
mkdir -p ~/nav2_ws/src
cd ~/nav2_ws/src
git clone https://github.com/ros-planning/navigation2.git --branch galactic
cd ~/nav2_ws
rosdep install -y -r -q --from-paths src --ignore-src --rosdistro galactic
colcon build --symlink-install
It seems only after installing additionally (next to rosdep):
sudo apt-get install ros-galactic-nav-2d-msgs ros-galactic-nav-msgs
Nav2 packages can build correctly.
I have searched a bit after this problem but I didn't find this as a solution suggestion. I am not sure it is even the correct approach too...
What could be the source of this problem? Any suggestions/better fixes/explanations are welcome.
Best,
Łukasz Janiec