0
$\begingroup$

Rosanswers logo

Hi,

I am running on Ubuntu 20.04 ROS Foxy.

Following the instruction on navigation tutorial (https://navigation.ros.org/build_instructions/index.html) to build navigation stack. I downloaded the files from the repo git clone https://github.com/ros-planning/navigation2.git --branch foxy-devel

After running colcon build command, the building process failed while trying to build nav2_util with the following error message:

--- stderr: nav2_util                                
In file included from /opt/ros/foxy/include/test_msgs/action/fibonacci.hpp:9,
                 from /home/paulolui/navigation2_ws/src/navigation2/nav2_util/test/test_actions.cpp:22:
/opt/ros/foxy/include/test_msgs/action/detail/fibonacci__traits.hpp:23:25: error: expected initializer before ‘<’ token
   23 | inline const char * name<test_msgs::action::Fibonacci_Goal>()
      |                         ^
/opt/ros/foxy/include/test_msgs/action/detail/fibonacci__traits.hpp:52:25: error: expected initializer before ‘<’ token
   52 | inline const char * name<test_msgs::action::Fibonacci_Result>()
      |                         ^
/opt/ros/foxy/include/test_msgs/action/detail/fibonacci__traits.hpp:81:25: error: expected initializer before ‘<’ token
   81 | inline const char * name<test_msgs::action::Fibonacci_Feedback>()
      |                         ^
In file included from /opt/ros/foxy/include/test_msgs/action/fibonacci.hpp:9,
                 from /home/paulolui/navigation2_ws/src/navigation2/nav2_util/test/test_actions.cpp:22:
/opt/ros/foxy/include/test_msgs/action/detail/fibonacci__traits.hpp:116:25: error: expected initializer before ‘<’ token
  116 | inline const char * name<test_msgs::action::Fibonacci_SendGoal_Request>()
      |                         ^
In file included from /opt/ros/foxy/include/test_msgs/action/fibonacci.hpp:9,
                 from /home/paulolui/navigation2_ws/src/navigation2/nav2_util/test/test_actions.cpp:22:
/opt/ros/foxy/include/test_msgs/action/detail/fibonacci__traits.hpp:149:25: error: expected initializer before ‘<’ token
  149 | inline const char * name<test_msgs::action::Fibonacci_SendGoal_Response>()
      |                         ^
/opt/ros/foxy/include/test_msgs/action/detail/fibonacci__traits.hpp:178:25: error: expected initializer before ‘<’ token
  178 | inline const char * name<test_msgs::action::Fibonacci_SendGoal>()
      |                         ^
/opt/ros/foxy/include/test_msgs/action/detail/fibonacci__traits.hpp:238:25: error: expected initializer before ‘<’ token
  238 | inline const char * name<test_msgs::action::Fibonacci_GetResult_Request>()
      |                         ^
/opt/ros/foxy/include/test_msgs/action/detail/fibonacci__traits.hpp:272:25: error: expected initializer before ‘<’ token
  272 | inline const char * name<test_msgs::action::Fibonacci_GetResult_Response>()
      |                         ^
/opt/ros/foxy/include/test_msgs/action/detail/fibonacci__traits.hpp:301:25: error: expected initializer before ‘<’ token
  301 | inline const char * name<test_msgs::action::Fibonacci_GetResult>()
      |                         ^
/opt/ros/foxy/include/test_msgs/action/detail/fibonacci__traits.hpp:364:25: error: expected initializer before ‘<’ token
  364 | inline const char * name<test_msgs::action::Fibonacci_FeedbackMessage>()
      |                         ^
make[2]: *** [test/CMakeFiles/test_actions.dir/build.make:63: test/CMakeFiles/test_actions.dir/test_actions.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:443: test/CMakeFiles/test_actions.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:141: all] Error 2
---
Failed   <<< nav2_util [38.2s, exited with code 2]

Summary: 6 packages finished [44.3s]
  1 package failed: nav2_util
  1 package had stderr output: nav2_util
  22 packages not processed

Originally posted by PLui on ROS Answers with karma: 18 on 2020-09-17

Post score: 0


Original comments

Comment by mrunaljsarvaiya on 2020-10-12:
I'm having the same issue, did you figure this out?

Comment by chiyaan on 2022-09-16:
I have this issue in rolling distro..Any suggestions

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

This build failure is in the tests, which aren't critical to building the nav2_util package. Comment out the three lines configuring the broken test_actions.cpp test in nav2_util/test/CMakeLists.txt and try again. (I actually haven't tried this repo, but fixed a similar issue in the ros-controls/realtime_tools repo; it's possible this isn't the only issue.)

This problem actually originates in a maze of little problems; here's a summary and links to the gory details:

  • The compiler error is a result of the fibonacci action headers in the ros-foxy-test-msgs Debian package being generated by a newer version of the rosidl_runtime_cpp ROS package (v. 1.1.0+) than the actual ros-foxy-rosidl-runtime-cpp package currently shipped in Foxy (v. 1.0.1)
  • It's a miracle the fibonacci action even exists in the ros-foxy-test-msgs v. 1.0.0 package, given that the now-obsolete action was removed from the test_msgs source in git tag 0.7.2
  • Now there are issues in the ros-planning/navigation2 repo and ros-controls/realtime_tools repo noting that the obsolete action needs to be removed in ROS2 branches to avoid build failures

Originally posted by zultron with karma: 51 on 2020-11-04

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.