Nav2: nav2_planner fails with -Werror=maybe-uninitialized
Hi,
I'm new to ROS, and I'm currently exploring Nav2 (and I have to say, Linux as well). I haven't found a related topic, and would like to know if anyone has encountered a similar issue.
When trying to setup a Nav2 workspace by following the build instructions, a warning ends up being treated as an error when processing nav2_planner:
[Processing: nav2_planner, nav2_recoveries, nav2_regulated_pure_pursuit_controller, smac_planner] --- stderr: nav2_planner In file included from /opt/ros/foxy/include/rclcpp/node_interfaces/node_parameters_interface.hpp:28,
- from /opt/ros/foxy/include/rclcpp/node.hpp:51,
- from /opt/ros/foxy/include/rclcpp/executors/single_threaded_executor.hpp:28,
- from /opt/ros/foxy/include/rclcpp/executors.hpp:22,
- from /opt/ros/foxy/include/rclcpp/rclcpp.hpp:146,
- from /home/xxxxxx/nav2_ws/install/nav2_util/include/nav2_util/costmap.hpp:21,
- from /home/xxxxxx/nav2_ws/src/navigation2/nav2_planner/src/planner_server.cpp:27:
- /opt/ros/foxy/include/rclcpp/parameter.hpp: In member function ‘virtual nav2_util::CallbackReturn nav2_planner::PlannerServer::on_configure(const rclcpp_lifecycle::State&)’: /opt/ros/foxy/include/rclcpp/parameter.hpp:70:42: error: ‘expected_planner_frequency’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
- 70 | : Parameter(name, ParameterValue(value))
- | ^
- /home/xxxxxx/nav2_ws/src/navigation2/nav2_planner/src/planner_server.cpp:117:10: note: ‘expected_planner_frequency’ was declared here
- 117 | double expected_planner_frequency;
- | ^~~~~~~~~~~~~~~~~~~~~~~~~~
- cc1plus: all warnings being treated as errors
- make[2]: *** [CMakeFiles/planner_server_core.dir/build.make:63: CMakeFiles/planner_server_core.dir/src/planner_server.cpp.o] Error 1
- make[1]: *** [CMakeFiles/Makefile2:107: CMakeFiles/planner_server_core.dir/all] Error 2
- make: *** [Makefile:141: all] Error 2
- ---
Failed <<< nav2_planner [1min 21s, exited with code 2]
Instructions being used:
https://navigation.ros.org/build_inst...
Changes I made to the original instructions because I'm using Linux Mint:
$ rosdep install -y -r -q --from-paths src --ignore-src --rosdistro foxy --os=ubuntu:focal
Error shows while running:
$ colcon build --symlink-install
I'm running Linux Mint 20.1 Ulyssa (kernel 5.4.0-73)
ROS information:
- ROS_VERSION=2
- ROS_PYTHON_VERSION=3
- ROS_LOCALHOST_ONLY=0
- ROS_DISTRO=foxy
Any help is greatly appreciated, thank you!