Nav2 build from source error: CallbackGroupFunction

asked 2021-10-06 16:37:52 -0500

Haritha gravatar image

updated 2021-10-07 02:55:38 -0500

gvdhoorn gravatar image

Hello,

I have installed ROS2 Galactic on Ubuntu 20.04 and am able to run the example code correctly. Then I proceeded to install and build Nav2 from source. After having the 'Getting Started' module for Nav2 working correctly, I use this link to install and build Nav2.

While executing this statement:

git clone https://github.com/ros-planning/navigation2.git --branch <ros2-distro>-devel

There is no Galactic-devel branch on this github repo, However there is a Galactic branch. I cloned the Galactic branch and did colcon build.

My build failed at 24/33 and terminated the build. The build error I receive is:

--- stderr: nav2_controller                                                                                                                                                                               
In file included from /home/aghari19/nav2_galactic_ws/src/navigation2/nav2_controller/include/nav2_controller/plugins/simple_progress_checker.hpp:20,
                 from /home/aghari19/nav2_galactic_ws/src/navigation2/nav2_controller/plugins/test/progress_checker.cpp:39:
/home/aghari19/ros2_galactic/install/rclcpp_lifecycle/include/rclcpp_lifecycle/lifecycle_node.hpp:213:55: error: ‘CallbackGroupFunction’ in ‘class rclcpp::node_interfaces::NodeBaseInterface’ does not name a type
  213 |     const rclcpp::node_interfaces::NodeBaseInterface::CallbackGroupFunction & func);
      |                                                       ^~~~~~~~~~~~~~~~~~~~~
In file included from /home/aghari19/nav2_galactic_ws/src/navigation2/nav2_controller/include/nav2_controller/plugins/simple_goal_checker.hpp:42,
                 from /home/aghari19/nav2_galactic_ws/src/navigation2/nav2_controller/plugins/test/goal_checker.cpp:39:
/home/aghari19/ros2_galactic/install/rclcpp_lifecycle/include/rclcpp_lifecycle/lifecycle_node.hpp:213:55: error: ‘CallbackGroupFunction’ in ‘class rclcpp::node_interfaces::NodeBaseInterface’ does not name a type
  213 |     const rclcpp::node_interfaces::NodeBaseInterface::CallbackGroupFunction & func);

I tried to delete the workspace and build again, but saw the same error. I have googled and found no working solution. If anyone can help with this I would truly appreciate. I am not sure if I have the wrong github repo or even what the issue is,

Thank you

edit retag flag offensive close merge delete

Comments

Is there any specific reason why you want to install ros2 from build and not from binaries? If you just need the binaries, you just need to follow the steps under Install. If you are planning to contribute or change something to you needs then you can build it from source.

Edit: I guess you have already done the installation from the getting started step. You can just skip that build and install step (if you are not going to contribute :) ).

pmuthu2s gravatar image pmuthu2s  ( 2021-10-08 04:46:48 -0500 )edit

I need to have it from source as I am working in a research project and we are writing our own plugins so I'll have to edit src eventually,

Haritha gravatar image Haritha  ( 2021-10-08 09:04:25 -0500 )edit

did you install the dependencies? because I'm able to build it without any problem!

pmuthu2s gravatar image pmuthu2s  ( 2021-10-08 10:45:51 -0500 )edit

Are you taking about Nav2 specific dependencies? I do not think I did. Do you know the statement to install dependencies I can try doing that then doing colcon build

Haritha gravatar image Haritha  ( 2021-10-08 11:20:20 -0500 )edit

rosdep install -y -r -q --from-paths src --ignore-src --rosdistro <ros2-distro>

pmuthu2s gravatar image pmuthu2s  ( 2021-10-11 03:06:45 -0500 )edit

I ran this statement before doing the colon build. However, I fixed this issue. I did the following: sudo apt-get purge ros-galactic-navigation2 sudo apt-get purge ros-galactic-nav2-bringup sudo apt-get purge ros-galactic-turtlebot3*

Then installed it again sudo apt install ros-<distro>-navigation2 ros-<distro>-nav2-bringup '~ros-<distro>-turtlebot3-.*' and did build and it was able to build.

Thank you all for the help :)

Haritha gravatar image Haritha  ( 2021-10-12 09:49:06 -0500 )edit

Glad it worked. You could just self answer your question, so that people does not have to read through the comments

pmuthu2s gravatar image pmuthu2s  ( 2021-10-12 09:52:52 -0500 )edit