@小鱼 你好我从动手学ros2中按照流程将nav2的源码下载到本地记性编译。在编译的过程中出现终端报错的问题。我的系统是ubuntu22.04,ros2humble。
(base) xiaoche@xiaoche:~/catkin_ws$ colcon build
Starting >>> nav2_common
Starting >>> nav_2d_msgs
Starting >>> cartographer
Starting >>> cartographer_ros_msgs
Finished <<< nav2_common [1.40s]
Starting >>> nav2_msgs
Finished <<< nav_2d_msgs [3.23s]
Starting >>> nav2_voxel_grid
Finished <<< nav2_voxel_grid [0.42s]
Starting >>> dwb_msgs
Finished <<< cartographer_ros_msgs [4.96s]
Starting >>> ascend_slam
Finished <<< ascend_slam [0.31s]
Starting >>> ls01b_v2
Finished <<< ls01b_v2 [0.33s]
Starting >>> xiaoguo
Finished <<< dwb_msgs [2.29s]
Starting >>> xiaoguo_cartographer
Finished <<< xiaoguo_cartographer [0.23s]
Starting >>> ydlidar
Finished <<< nav2_msgs [5.08s]
Starting >>> nav2_util
Finished <<< ydlidar [0.53s]
Starting >>> nav2_simple_commander
Finished <<< cartographer [7.11s]
Starting >>> cartographer_ros
Finished <<< nav2_util [0.85s]
Starting >>> nav_2d_utils
Finished <<< xiaoguo [2.39s]
Starting >>> nav2_behavior_tree
Finished <<< nav_2d_utils [0.74s]
Starting >>> nav2_lifecycle_manager
Finished <<< cartographer_ros [1.57s]
Starting >>> nav2_map_server
Finished <<< nav2_lifecycle_manager [0.86s]
Starting >>> nav2_amcl
Finished <<< nav2_simple_commander [2.72s]
Starting >>> nav2_velocity_smoother
Finished <<< nav2_amcl [1.91s]
Starting >>> nav2_rviz_plugins
Finished <<< nav2_velocity_smoother [1.42s]
Starting >>> cartographer_rviz
Finished <<< nav2_rviz_plugins [0.56s]
Finished <<< cartographer_rviz [0.66s]
--- stderr: nav2_behavior_tree
/usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to curs_set@NCURSES6_TINFO_5.0.19991023' /usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to wgetch@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to wattr_off@NCURSES6_5.0.19991023' /usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to wattr_on@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to wrefresh@NCURSES6_5.0.19991023' /usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to noecho@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to endwin@NCURSES6_5.0.19991023' /usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to initscr@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to werase@NCURSES6_5.0.19991023' /usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to mvwprintw@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to delwin@NCURSES6_5.0.19991023' /usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to newwin@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to cbreak@NCURSES6_TINFO_5.0.19991023' /usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to keypad@NCURSES6_TINFO_5.0.19991023'
collect2: error: ld returned 1 exit status
gmake[2]: *** [test/CMakeFiles/test_bt_conversions.dir/build.make:337:test/test_bt_conversions] 错误 1
gmake[1]: *** [CMakeFiles/Makefile2:1735:test/CMakeFiles/test_bt_conversions.dir/all] 错误 2
gmake[1]: *** 正在等待未完成的任务....
/usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to curs_set@NCURSES6_TINFO_5.0.19991023' /usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to wgetch@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to wattr_off@NCURSES6_5.0.19991023' /usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to wattr_on@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to wrefresh@NCURSES6_5.0.19991023' /usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to noecho@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to endwin@NCURSES6_5.0.19991023' /usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to initscr@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to werase@NCURSES6_5.0.19991023' /usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to mvwprintw@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to delwin@NCURSES6_5.0.19991023' /usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to newwin@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to cbreak@NCURSES6_TINFO_5.0.19991023' /usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to keypad@NCURSES6_TINFO_5.0.19991023'
collect2: error: ld returned 1 exit status
gmake[2]: *** [test/plugins/condition/CMakeFiles/test_condition_distance_traveled.dir/build.make:338:test/plugins/condition/test_condition_distance_traveled] 错误 1
gmake[1]: *** [CMakeFiles/Makefile2:1815:test/plugins/condition/CMakeFiles/test_condition_distance_traveled.dir/all] 错误 2
/usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to curs_set@NCURSES6_TINFO_5.0.19991023' /usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to wgetch@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to wattr_off@NCURSES6_5.0.19991023' /usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to wattr_on@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to wrefresh@NCURSES6_5.0.19991023' /usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to noecho@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to endwin@NCURSES6_5.0.19991023' /usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to initscr@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to werase@NCURSES6_5.0.19991023' /usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to mvwprintw@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to delwin@NCURSES6_5.0.19991023' /usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to newwin@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to cbreak@NCURSES6_TINFO_5.0.19991023' /usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so/usr/bin/ld: : undefined reference to keypad@NCURSES6_TINFO_5.0.19991023'
/opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to curs_set@NCURSES6_TINFO_5.0.19991023' /usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to wgetch@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to wattr_off@NCURSES6_5.0.19991023' /usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to wattr_on@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to wrefresh@NCURSES6_5.0.19991023' /usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to noecho@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to endwin@NCURSES6_5.0.19991023' collect2: error: ld returned 1 exit status /usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to initscr@NCURSES6_5.0.19991023'
gmake[2]: *** [test/plugins/condition/CMakeFiles/test_condition_time_expired.dir/build.make:430:test/plugins/condition/test_condition_time_expired] 错误 1
gmake[1]: *** [CMakeFiles/Makefile2:1843:test/plugins/condition/CMakeFiles/test_condition_time_expired.dir/all] 错误 2
/usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to werase@NCURSES6_5.0.19991023' /usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to mvwprintw@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to delwin@NCURSES6_5.0.19991023' /usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to newwin@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to cbreak@NCURSES6_TINFO_5.0.19991023' /usr/bin/ld: /opt/ros/humble/lib/libbehaviortree_cpp_v3.so: undefined reference to keypad@NCURSES6_TINFO_5.0.19991023'
collect2: error: ld returned 1 exit status
gmake[2]: *** [test/plugins/condition/CMakeFiles/test_condition_path_expiring_timer.dir/build.make:337:test/plugins/condition/test_condition_path_expiring_timer] 错误 1
gmake[1]: *** [CMakeFiles/Makefile2:1871:test/plugins/condition/CMakeFiles/test_condition_path_expiring_timer.dir/all] 错误 2
gmake: *** [Makefile:146:all] 错误 2
Failed <<< nav2_behavior_tree [3.58s, exited with code 2]
Aborted <<< nav2_map_server [7.75s]
Summary: 21 packages finished [16.7s]
1 package failed: nav2_behavior_tree
1 package aborted: nav2_map_server
2 packages had stderr output: nav2_behavior_tree nav2_map_server
25 packages not processed