mkdir ros_nav_ws/src -p
cd ros_nav_ws/src
git clone https://github.com/ros-planning/navigation.git
cd ..
catkin_make
编译过程中可能出现的错误
error1:Could NOT find SDL (missing: SDL_LIBRARY SDL_INCLUDE_DIR)
solution:安装所缺少的依赖
sudo apt-get install libsdl-image1.2-dev
sudo apt-get install libsdl-dev
error2:Could not find a package configuration file provided by "tf2_sensor_msgs"
solution:安装所缺少的依赖
sudo apt-get install ros-noetic-tf2-sensor-msgs
//更换密钥:
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt-get update
error2:Could not find a package configuration file provided by "move_base_msgs"
solution: 安装所缺少的依赖
sudo apt-get install ros-noetic-move-base-msgs
再编译可编译成功