小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
编译NAV2出现的错误 是怎么回事,ROS2 humble
-
git clone https://ghproxy.com/https://github.com/ros-planning/navigation2.git -b foxy-devel 是不是下载的版本错了
wu@wu-virtual-machine:~/nav/src$ colcon build --packages-up-to navigation2
[1.162s] WARNING:colcon.colcon_core.package_selection:Some selected packages are already built in one or more underlay workspaces:
'nav2_common' is in: /opt/ros/humble
'nav2_util' is in: /opt/ros/humble
'nav2_map_server' is in: /opt/ros/humble
'nav2_navfn_planner' is in: /opt/ros/humble
'navigation2' is in: /opt/ros/humble
'nav2_controller' is in: /opt/ros/humble
'nav2_core' is in: /opt/ros/humble
'nav_2d_utils' is in: /opt/ros/humble
'nav2_amcl' is in: /opt/ros/humble
'nav2_lifecycle_manager' is in: /opt/ros/humble
'nav2_costmap_2d' is in: /opt/ros/humble
'nav2_planner' is in: /opt/ros/humble
'nav2_behavior_tree' is in: /opt/ros/humble
'nav_2d_msgs' is in: /opt/ros/humble
'nav2_regulated_pure_pursuit_controller' is in: /opt/ros/humble
'nav2_msgs' is in: /opt/ros/humble
If a package in a merged underlay workspace is overridden and it installs headers, then all packages in the overlay must sort their include directories by workspace order. Failure to do so may result in build failures or undefined behavior at run time.
If the overridden package is used by another package in any underlay, then the overriding package in the overlay must be API and ABI compatible or undefined behavior at run time may occur.If you understand the risks and want to override a package anyways, add the following to the command line:
--allow-overriding nav2_amcl nav2_behavior_tree nav2_common nav2_controller nav2_core nav2_costmap_2d nav2_lifecycle_manager nav2_map_server nav2_msgs nav2_navfn_planner nav2_planner nav2_regulated_pure_pursuit_controller nav2_util nav_2d_msgs nav_2d_utils navigation2This may be promoted to an error in a future release of colcon-override-check.
Starting >>> nav2_common
Starting >>> nav_2d_msgs
Finished <<< nav2_common [1.36s]
Starting >>> nav2_msgs
Finished <<< nav_2d_msgs [2.51s]
Starting >>> nav2_voxel_grid
Finished <<< nav2_voxel_grid [0.48s]
Starting >>> dwb_msgs
Finished <<< nav2_msgs [3.57s]
Starting >>> nav2_util
Finished <<< dwb_msgs [2.01s]
--- stderr: nav2_util
In file included from /home/wu/nav/src/navigation2/nav2_util/include/nav2_util/geometry_utils.hpp:24,
from /home/wu/nav/src/navigation2/nav2_util/src/costmap.cpp:19:
/opt/ros/humble/include/tf2_geometry_msgs/tf2_geometry_msgs/tf2_geometry_msgs.h:35:2: error: #warning This header is obsolete, please include tf2_geometry_msgs/tf2_geometry_msgs.hpp instead [-Werror=cpp]
35 | #warning This header is obsolete, please include tf2_geometry_msgs/tf2_geometry_msgs.hpp instead
| ^~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/logging.hpp:24,
from /opt/ros/humble/include/rclcpp/rclcpp/client.hpp:40,
from /opt/ros/humble/include/rclcpp/rclcpp/callback_group.hpp:24,
from /opt/ros/humble/include/rclcpp/rclcpp/any_executable.hpp:20,
from /opt/ros/humble/include/rclcpp/rclcpp/memory_strategy.hpp:25,
from /opt/ros/humble/include/rclcpp/rclcpp/memory_strategies.hpp:18,
from /opt/ros/humble/include/rclcpp/rclcpp/executor_options.hpp:20,
from /opt/ros/humble/include/rclcpp/rclcpp/executor.hpp:37,
from /opt/ros/humble/include/rclcpp/rclcpp/executors/multi_threaded_executor.hpp:25,
from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:21,
from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
from /home/wu/nav/src/navigation2/nav2_util/include/nav2_util/costmap.hpp:21,
from /home/wu/nav/src/navigation2/nav2_util/src/costmap.cpp:17:
/home/wu/nav/src/navigation2/nav2_util/src/costmap.cpp: In constructor ‘nav2_util::Costmap::Costmap(rclcpp::Node*, bool, bool, int, int)’:
/home/wu/nav/src/navigation2/nav2_util/src/costmap.cpp:42:28: error: format ‘%f’ expects argument of type ‘double’, but argument 5 has type ‘int’ [-Werror=format=]
42 | node_->get_logger(), "Costmap: Lethal threshold set to %.2f, it should be within"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43 | " bounds 0-100. This could result in potential collisions!", lethal_threshold_);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~
| |
| int
/home/wu/nav/src/navigation2/nav2_util/src/costmap.cpp:42:65: note: format string is defined here
42 | node_->get_logger(), "Costmap: Lethal threshold set to %.2f, it should be within"
| ~~~^
| |
| double
| %.2d
cc1plus: all warnings being treated as errors
gmake[2]: *** [src/CMakeFiles/nav2_util_core.dir/build.make:76: src/CMakeFiles/nav2_util_core.dir/costmap.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:212: src/CMakeFiles/nav2_util_core.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
gmake: *** [Makefile:146: all] Error 2Failed <<< nav2_util [15.9s, exited with code 2]
Summary: 5 packages finished [21.5s]
1 package failed: nav2_util
1 package had stderr output: nav2_util
22 packages not processed -
@157763095 这个是foxy版本的,米系统Ros哪个版本
-
@157763095 我装的是humble的有这个版本的代码吗