小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
源码安装 Nav2,在如下截图的方式下编译运行生成包并且能查看到,但是在执行
-
源码编译
Error(s) in package '/home/vico/fishbot_ws/src/fishbot_navigation2/package.xml':
Error(s):- The generic dependency on 'nav2_bringup' is redundant with: exec_depend
vico@wp:~/fishbot_ws$ colcon build --packages-up-to navigation2
[0.424s] WARNING:colcon.colcon_core.package_identification:Failed to parse ROS package manifest in 'src/fishbot_navigation2': Error(s) in package 'src/fishbot_navigation2/package.xml':
Error(s): - The generic dependency on 'nav2_bringup' is redundant with: exec_depend
[0.641s] WARNING:colcon.colcon_core.package_selection:Some selected packages are already built in one or more underlay workspaces:
'nav2_map_server' 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_map_serverThis may be promoted to an error in a future release of colcon-override-check.
Starting >>> nav2_common
Starting >>> nav_2d_msgs
Finished <<< nav2_common [0.83s]
Starting >>> nav2_msgs
Starting >>> nav2_voxel_grid
Finished <<< nav2_voxel_grid [0.81s]
Finished <<< nav_2d_msgs [1.81s]
Starting >>> dwb_msgs
Aborted <<< dwb_msgs [0.47s] ..
Aborted <<< nav2_msgs [2.16s]Summary: 3 packages finished [3.38s]
2 packages aborted: dwb_msgs nav2_msgs编译后的包查看
vico@wp:~/fishbot_ws$ ros2 pkg list | grep navigation2
navigation2为fishbot 编译导航包
vico@wp:~/fishbot_ws/src$ colcon build --packages-up-to fishbot_navigation2
[0.654s] WARNING:colcon.colcon_core.package_selection:Some selected packages are already built in one or more underlay workspaces:
'nav2_map_server' is in: /home/vico/fishbot_ws/install/nav2_map_server, /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_map_serverThis may be promoted to an error in a future release of colcon-override-check.
Starting >>> nav2_common
Starting >>> nav_2d_msgs
Finished <<< nav2_common [0.91s]
Starting >>> nav2_msgs
Starting >>> nav2_voxel_grid
Finished <<< nav2_voxel_grid [0.49s]
Finished <<< nav_2d_msgs [2.01s]
Starting >>> dwb_msgs
Aborted <<< dwb_msgs [0.54s]
Aborted <<< nav2_msgs [1.66s]Summary: 3 packages finished [2.96s]
2 packages aborted: dwb_msgs nav2_msgs
2 packages had stderr output: dwb_msgs nav2_msgs
32 packages not processed
vico@wp:~/fishbot_ws/src$ colcon build --packages-up-to fishbot_navigation2
[0.638s] WARNING:colcon.colcon_core.package_selection:Some selected packages are already built in one or more underlay workspaces:
'nav2_map_server' is in: /home/vico/fishbot_ws/install/nav2_map_server, /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_map_serverThis may be promoted to an error in a future release of colcon-override-check.
Starting >>> nav2_common
Starting >>> nav_2d_msgs
Finished <<< nav2_common [0.92s]
Starting >>> nav2_msgs
Starting >>> nav2_voxel_grid
Finished <<< nav2_voxel_grid [0.46s]
Finished <<< nav_2d_msgs [1.98s]
Starting >>> dwb_msgs
--- stderr: nav2_msgs
CMake Warning at /opt/ros/humble/share/nav_msgs/cmake/ament_cmake_export_include_directories-extras.cmake:11 (message):
Package 'nav_msgs' exports the include directory
'/opt/ros/humble/share/nav_msgs/cmake/../../../include/nav_msgs' which
doesn't exist
Call Stack (most recent call first):
/opt/ros/humble/share/nav_msgs/cmake/nav_msgsConfig.cmake:41 (include)
CMakeLists.txt:7 (find_package)CMake Error in CMakeLists.txt:
Imported target "nav_msgs::nav_msgs__rosidl_generator_c" includes
non-existent path"/opt/ros/humble/include/nav_msgs"
in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
-
The path was deleted, renamed, or moved to another location.
-
An install or uninstall procedure did not complete successfully.
-
The installation package was faulty and references files it does not
provide.
CMake Error in CMakeLists.txt:
Imported target "nav_msgs::nav_msgs__rosidl_typesupport_fastrtps_c"
includes non-existent path"/opt/ros/humble/include/nav_msgs"
in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
-
The path was deleted, renamed, or moved to another location.
-
An install or uninstall procedure did not complete successfully.
-
The installation package was faulty and references files it does not
provide.
CMake Error in CMakeLists.txt:
Imported target "nav_msgs::nav_msgs__rosidl_typesupport_fastrtps_cpp"
includes non-existent path"/opt/ros/humble/include/nav_msgs"
in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
-
The path was deleted, renamed, or moved to another location.
-
An install or uninstall procedure did not complete successfully.
-
The installation package was faulty and references files it does not
provide.
CMake Error in CMakeLists.txt:
Imported target "nav_msgs::nav_msgs__rosidl_typesupport_introspection_c"
includes non-existent path"/opt/ros/humble/include/nav_msgs"
in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
-
The path was deleted, renamed, or moved to another location.
-
An install or uninstall procedure did not complete successfully.
-
The installation package was faulty and references files it does not
provide.
CMake Error in CMakeLists.txt:
Imported target "nav_msgs::nav_msgs__rosidl_typesupport_introspection_cpp"
includes non-existent path"/opt/ros/humble/include/nav_msgs"
in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
-
The path was deleted, renamed, or moved to another location.
-
An install or uninstall procedure did not complete successfully.
-
The installation package was faulty and references files it does not
provide.
CMake Error in CMakeLists.txt:
Imported target "nav_msgs::nav_msgs__rosidl_generator_cpp" includes
non-existent path"/opt/ros/humble/include/nav_msgs"
in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
-
The path was deleted, renamed, or moved to another location.
-
An install or uninstall procedure did not complete successfully.
-
The installation package was faulty and references files it does not
provide.
CMake Error in CMakeLists.txt:
Imported target "nav_msgs::nav_msgs__rosidl_typesupport_fastrtps_c"
includes non-existent path"/opt/ros/humble/include/nav_msgs"
in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
-
The path was deleted, renamed, or moved to another location.
-
An install or uninstall procedure did not complete successfully.
-
The installation package was faulty and references files it does not
provide.
CMake Error in CMakeLists.txt:
Imported target "nav_msgs::nav_msgs__rosidl_typesupport_fastrtps_c"
includes non-existent path"/opt/ros/humble/include/nav_msgs"
in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
-
The path was deleted, renamed, or moved to another location.
-
An install or uninstall procedure did not complete successfully.
-
The installation package was faulty and references files it does not
provide.
- The generic dependency on 'nav2_bringup' is redundant with: exec_depend
-
@vico1999 在 源码安装 Nav2,在如下截图的方式下编译运行生成包并且能查看到,但是在执行 中说:
"/opt/ros/humble/include/nav_msgs"
重装下系统中的ROS试试